Re: [PATCH] for-each-ref: fix off by one read.

Previous thread: Re: wishlist: git info by Jakub Narebski on Monday, November 12, 2007 - 7:46 pm. (11 messages)

Next thread: The 5th issue of the msysGit Herald by Johannes Schindelin on Monday, November 12, 2007 - 11:13 pm. (1 message)
To: Christian Couder <chriscool@...>
Cc: <git@...>
Date: Monday, November 12, 2007 - 8:05 pm

Good eyes. This would have broken if

(1) we had a header field that consists of a single character
and then LF. We would have mistaken such a line as the end
of header; or

(2) we had a commit or a tag that consists solely of header and
no body. We would have read past the terminating NUL.

Thanks.

-

To: Junio C Hamano <gitster@...>
Cc: <git@...>
Date: Tuesday, November 13, 2007 - 1:15 am

Well, Valgrind found it when I did:

I suspect that the end of the header was not properly detected, so that it
may have read one byte past a body ending with LF and the terminating NUL.

Christian.

-

Previous thread: Re: wishlist: git info by Jakub Narebski on Monday, November 12, 2007 - 7:46 pm. (11 messages)

Next thread: The 5th issue of the msysGit Herald by Johannes Schindelin on Monday, November 12, 2007 - 11:13 pm. (1 message)