Re: [PATCH 1/1] get_sha1_hex(): do not read past a NUL character
- From
Thomas Rast <trast@student.ethz.ch>
- Date
- Oct 5, 2011, 19:11 UTC
- Message-ID
- <201110052111.52701.trast@student.ethz.ch>
- In-Reply-To
- <7vaa9vulsw.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 11 quoted lines
> Michael Haggerty <mhagger@alum.mit.edu> writes: > > > Previously, get_sha1_hex() would read one character past the end of a > > null-terminated string whose strlen was an even number less than 40. > > Although the function correctly returned -1 in these cases, the extra > > memory access might have been to uninitialized (or even, conceivably, > > unallocated) memory. > > > > Add a check to avoid reading past the end of a string. > > Makes sense; thanks.
Has this fixed patch ever made it to pu? I'm still seeing the same breakage in the automated valgrind runs.
--
Thomas Rast
trast@{inf,student}.ethz.ch