[PATCH 1/4] Add new public header gssapi_alloc.h

Greg Hudson ghudson at MIT.EDU
Thu Oct 6 13:31:06 EDT 2011


On Thu, 2011-10-06 at 13:25 -0400, Sam Hartman wrote:
> +    char *copy = gssalloc_malloc(strlen(str)+1);
> +    if (copy) {
> +        strcpy(copy, str);
> +    }

Don't use strcpy here; it gets flagged in Coverity.  Remember the length
and use strlcpy.

http://k5wiki.kerberos.org/wiki/Coding_style/Practices#String_Handling





More information about the krbdev mailing list