svn rev #25796: trunk/src/lib/krb5/asn.1/
ghudson@MIT.EDU
ghudson at MIT.EDU
Fri Mar 30 20:38:16 EDT 2012
http://mv.ezproxy.com.ezproxyberklee.flo.org/fisheye/changelog/krb5/?cs=25796
Commit By: ghudson
Log Message:
Avoid malloc(0) in ASN.1 bytestring decode
In k5_asn1_decode_bytestring, just leave *str_out as NULL if len is 0,
instead of calling malloc(0) and possibly returning a spurious ENOMEM.
Changed Files:
U trunk/src/lib/krb5/asn.1/asn1_encode.c
Modified: trunk/src/lib/krb5/asn.1/asn1_encode.c
===================================================================
--- trunk/src/lib/krb5/asn.1/asn1_encode.c 2012-03-28 21:11:06 UTC (rev 25795)
+++ trunk/src/lib/krb5/asn.1/asn1_encode.c 2012-03-31 00:38:16 UTC (rev 25796)
@@ -234,6 +234,8 @@
*str_out = NULL;
*len_out = 0;
+ if (len == 0)
+ return 0;
str = malloc(len);
if (str == NULL)
return ENOMEM;
More information about the cvs-krb5
mailing list