mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-03 00:43:41 +00:00
Fix longstanding valgrind warning
There was a possible circumstance that could result in reading past the end of a buffer. This check fixes that.
This commit is contained in:
parent
29e92d385e
commit
e7d0ced219
@ -87,7 +87,7 @@ int git_buf_text_crlf_to_lf(git_buf *tgt, const git_buf *src)
|
||||
}
|
||||
|
||||
/* Do not drop \r unless it is followed by \n */
|
||||
if (next[1] != '\n')
|
||||
if (next + 1 == scan_end || next[1] != '\n')
|
||||
*out++ = '\r';
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user