diff --git a/AUTHORS b/AUTHORS index 458ff06c3..784bab3ee 100644 --- a/AUTHORS +++ b/AUTHORS @@ -23,6 +23,7 @@ Dmitry Kovega Emeric Fermas Emmanuel Rodriguez Eric Myhre +Erik Aigner Florian Forster Holger Weiss Ingmar Vanhassel diff --git a/src/apply.c b/src/apply.c index d72aa8374..0becf9495 100644 --- a/src/apply.c +++ b/src/apply.c @@ -59,7 +59,7 @@ static int patch_image_init_fromstr( git_pool_init(&out->pool, sizeof(git_diff_line)); for (start = in; start < in + in_len; start = end) { - end = memchr(start, '\n', in_len); + end = memchr(start, '\n', in_len - (start - in)); if (end == NULL) end = in + in_len;