apply: safety check files that dont end with eol

This commit is contained in:
Edward Thomson 2016-07-14 23:32:35 -04:00
parent c065f6a1d2
commit 581a4d3942

View File

@ -53,7 +53,10 @@ static int patch_image_init_fromstr(
for (start = in; start < in + in_len; start = end) {
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++;
line = git_pool_mallocz(&out->pool, 1);