summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/apply.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/apply.c b/src/apply.c
index e982ab682..40ba647f4 100644
--- a/src/apply.c
+++ b/src/apply.c
@@ -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);