Re: [PATCH] alloc_ref(): allow for trailing NUL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 28 Sep 2007, Johannes Schindelin wrote:

> The parameter name "namelen" suggests that you pass the equivalent of
> strlen() to the function alloc_ref().  However, this function did not
> allocate enough space to put a NUL after the name.
> 
> Since struct ref does not have any member to describe the length of the
> string, this just does not make sense.
> 
> So make space for the NUL.

Good point, but shouldn't you then fix call sites that use strlen(name) + 
1?

	-Daniel
*This .sig left intentionally blank*
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux