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>
Wed, 13 Jun 2012 17:40:37 +0000 (19:40 +0200)
Thanks to laurent gaffie <laurent.gaffie@gmail.com> for reporting
this issue!

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;