svn rev #23376: trunk/src/include/

Ken Raeburn raeburn at MIT.EDU
Mon Nov 30 00:25:04 EST 2009


On Nov 28, 2009, at 10:51, ghudson at MIT.EDU wrote:
> +static inline krb5_error_code
> +alloc_data(krb5_data *data, unsigned int len)
> +{
> +    char *ptr = (char *) calloc(len, 1);
> +
> +    if (ptr == NULL)
> +        return ENOMEM;

This is not the only change recently that assumes that malloc and  
friends will never return NULL in a success case; k5-int.h:k5alloc  
makes that assumption too.  Are you assuming that the krb5 code will  
never make a call requesting zero bytes?  (Or asserting that it  
shouldn't and any such cases are bugs; or actually checking the call  
sites?)  Or is this just an oversight?

Ken




More information about the krbdev mailing list