"Secure coding" audit checkers and Kerberos

Love Hörnquist Åstrand lha at kth.se
Wed Oct 15 16:00:30 EDT 2008


15 okt 2008 kl. 11:54 skrev Greg Hudson:

> buflen = strlen(s1) + strlen(s2) + strlen(s3) + 1;
> buf = malloc(buflen);
> if (!buf) return ENOMEM;
> (void) strlcpy(buf, s1, buflen);
> (void) strlcat(buf, s2, buflen);
> (void) strlcat(buf, s3, buflen);

asprintf(&buf, "%s%s%s", s1, s2, s3);
if (buf == NULL)
   return ENOMEM;

Love





More information about the krbdev mailing list