Check for allocation failure. Caught by Will Fiveash
authorKen Raeburn <raeburn@mit.edu>
Tue, 10 Oct 2006 23:40:55 +0000 (23:40 +0000)
committerKen Raeburn <raeburn@mit.edu>
Tue, 10 Oct 2006 23:40:55 +0000 (23:40 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18672 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/asn.1/ldap_key_seq.c

index 68a93554ddaa70165458d443b537fbcc9c3381fe..c77c51c03412a7fadb914199f21e5ab816799343 100644 (file)
@@ -144,7 +144,8 @@ asn1_encode_sequence_of_keys (krb5_key_data *key_data,
     if (n_key_data == 0) cleanup (ASN1_MISSING_FIELD);
 
     /* Allocate the buffer */
-    asn1buf_create(&buf);
+    ret = asn1buf_create(&buf);
+    checkerr;
 
     /* Sequence of keys */
     {
@@ -360,7 +361,7 @@ static asn1_error_code asn1_decode_key(asn1buf *buf, krb5_key_data *key)
 
        ret = decode_tagged_octetstring (&kbuf, 1, &ival,
                                         &key->key_data_contents[0]); checkerr;
-       key->key_data_length[0] = ival;
+       key->key_data_length[0] = ival; /* XXX range check? */
 
        safe_syncbuf (&subbuf, &kbuf);
     }