Re: [PATCH] Fix off-by-one error: don't read the byte before a malloc'd buffer.

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

 




On Dec 9, 2007, at 1:15 PM, Junio C Hamano wrote:

The fix may be correct but the comment above the part the patch fixes is
very misleading and I wasted a few minutes checking to see what it is
doing is correct.

The fix is correct. I did not anticipate empty strings when I wrote the loop in question. Although I wonder if that should be expanded to use isspace instead of checking for just ' '. I'm less familiar with the config parsing than I was.

The "quote" variable does not really control quoting; the quoting with
backslash is always done for the value, and this check is about adding a dq pair around it, so that the parser does not lose leading or trailing
SP or string after start-of-comment marker characters.

It's for adding quotes, which made the comment make sense to me. But your expanded description is correct and matches the commit message I wrote. Thanks for clarifying it in the code.

~~ Brian
-
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