The previous code was assuming length ends at either `)` or `,`, and was
not handling the case where strcspn returns length due to end of string.
So specifying ":(top" as pathspec will cause the loop to go pass the end
of string.
Signed-off-by: Andrew Wong
---
setup.c | 6 --
1 file changed,
Andrew Wong writes:
> The previous code was assuming length ends at either `)` or `,`, and was
> not handling the case where strcspn returns length due to end of string.
> So specifying ":(top" as pathspec will cause the loop to go pass the end
> of string.
Thanks.
The parser that goes past the
On 3/7/13, Junio C Hamano wrote:
> The parser that goes past the end of the string may be a bug worth
> fixing, but is this patch sufficient to diagnose such an input as an
> error?
Yea, the patch should fix the passing end of string too. The parser
was going past end of string because the nextat
Andrew Wong writes:
> On 3/7/13, Junio C Hamano wrote:
>> The parser that goes past the end of the string may be a bug worth
>> fixing, but is this patch sufficient to diagnose such an input as an
>> error?
>
> Yea, the patch should fix the passing end of string too. The parser
> was going past
On 3/7/13, Junio C Hamano wrote:
> This did not error out for me, though.
>
> $ cd t && git ls-files ":(top"
No error message at all? Hm, maybe in your case, the byte after the
end of string happens to be '\0' and the loop ended by chance?
git doesn't crash for me, but it generates this erro
Andrew Wong writes:
> On 3/7/13, Junio C Hamano wrote:
>> This did not error out for me, though.
>>
>> $ cd t && git ls-files ":(top"
>
> No error message at all? Hm, maybe in your case, the byte after the
> end of string happens to be '\0' and the loop ended by chance?
>
> git doesn't crash
On 03/07/13 20:51, Junio C Hamano wrote:
> But it is equally broken to behave as if there is nothing wrong in
> the incomplete magic ":(top" that is not closed, isn't it?
Ah, yea, I did notice that, but then I saw a few lines below:
if (*copyfrom == ')')
copyfrom++;
which is exp
7 matches
Mail list logo