From: Linus Torvalds Date: Mon, 23 May 2005 19:31:59 +0000 (-0700) Subject: git-apply: bad patch fragments are fatal X-Git-Tag: v0.99~487 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5e224a2ed01facb1233474dd169307f499e70257;p=git.git git-apply: bad patch fragments are fatal Don't just stop at them and look for the next header. Die, die, die! --- diff --git a/apply.c b/apply.c index 85d7965da..536b06829 100644 --- a/apply.c +++ b/apply.c @@ -240,7 +240,7 @@ static int apply_single_patch(char *line, unsigned long size) while (size > 4 && !memcmp(line, "@@ -", 4)) { int len = apply_fragment(line, size); if (len <= 0) - break; + die("corrupt patch"); printf("applying fragment:\n%.*s\n\n", len, line);