s3: Fix uninitialized memory read in talloc_free()
authorVolker Lendecke <vl@samba.org>
Mon, 4 Jun 2012 19:22:21 +0000 (12:22 -0700)
committerKarolin Seeger <kseeger@samba.org>
Sat, 30 Jun 2012 11:44:22 +0000 (13:44 +0200)
Thanks to laurent gaffie <laurent.gaffie@gmail.com> for reporting
this issue!
(cherry picked from commit bc4a2c143b531f9362acb8f3d6e099cbac070840)

source3/libsmb/clispnego.c

index 36d21d0a9659de5cd56531f5c3496cc97ce50783..33225290f9ebab325f41f4aa2aaa6f2247cd2a5c 100644 (file)
@@ -161,6 +161,9 @@ bool spnego_parse_negTokenInit(DATA_BLOB blob,
        for (i=0; asn1_tag_remaining(data) > 0 && i < ASN1_MAX_OIDS-1; i++) {
                const char *oid_str = NULL;
                asn1_read_OID(data,talloc_autofree_context(),&oid_str);
+               if (data->has_error) {
+                       break;
+               }
                OIDs[i] = CONST_DISCARD(char *, oid_str);
        }
        OIDs[i] = NULL;