mirror of
https://git.proxmox.com/git/libgit2
synced 2025-07-17 20:01:59 +00:00
apply: safety check files that dont end with eol
This commit is contained in:
parent
c065f6a1d2
commit
581a4d3942
@ -53,7 +53,10 @@ static int patch_image_init_fromstr(
|
|||||||
for (start = in; start < in + in_len; start = end) {
|
for (start = in; start < in + in_len; start = end) {
|
||||||
end = memchr(start, '\n', in_len);
|
end = memchr(start, '\n', in_len);
|
||||||
|
|
||||||
if (end < in + in_len)
|
if (end == NULL)
|
||||||
|
end = in + in_len;
|
||||||
|
|
||||||
|
else if (end < in + in_len)
|
||||||
end++;
|
end++;
|
||||||
|
|
||||||
line = git_pool_mallocz(&out->pool, 1);
|
line = git_pool_mallocz(&out->pool, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user