svn rev #22197: trunk/src/lib/krb5/os/

Tom Yu tlyu at MIT.EDU
Tue Apr 14 00:34:53 EDT 2009


ghudson at MIT.EDU writes:

> http://src.mit.edu/fisheye/changelog/krb5/?cs=22197
> Commit By: ghudson
> Log Message:
> In krb5int_dns_init, fix a malloc-returning-null check which could let
> a null result slip past.
>

Can we make things even simpler if we assume realloc(NULL, len) is
always equivalent to malloc(len)?  How safe an assumption is that
these days?

>
>
> Changed Files:
> U   trunk/src/lib/krb5/os/dnsglue.c
> Modified: trunk/src/lib/krb5/os/dnsglue.c
> ===================================================================
> --- trunk/src/lib/krb5/os/dnsglue.c	2009-04-12 15:40:41 UTC (rev 22196)
> +++ trunk/src/lib/krb5/os/dnsglue.c	2009-04-13 17:16:35 UTC (rev 22197)
> @@ -112,7 +112,7 @@
>  	p = (ds->ansp == NULL)
>  	    ? malloc(nextincr) : realloc(ds->ansp, nextincr);
>  
> -	if (p == NULL && ds->ansp != NULL) {
> +	if (p == NULL) {
>  	    ret = -1;
>  	    goto errout;
>  	}
>
> _______________________________________________
> cvs-krb5 mailing list
> cvs-krb5 at mit.edu
> https://mailman.mit.edu/mailman/listinfo/cvs-krb5



More information about the krbdev mailing list