diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-10-19 10:48:29 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-19 10:48:29 -0700 |
commit | c31b87d111f6df359255979ea94e8648a51c3647 (patch) | |
tree | 0c3d2f5db3864192f435795c7ba41d85d30878b5 /builtin/apply.c | |
parent | e283548b85791fad6752e03cc15c6271b80c5fae (diff) | |
parent | 2c93286ab2ca5271e26779ffd1ecfd1c7a082a41 (diff) | |
download | git-c31b87d111f6df359255979ea94e8648a51c3647.tar.gz git-c31b87d111f6df359255979ea94e8648a51c3647.tar.xz |
Merge branch 'jm/maint-apply-detects-corrupt-patch-header'
* jm/maint-apply-detects-corrupt-patch-header:
fix "git apply --index ..." not to deref NULL
Diffstat (limited to 'builtin/apply.c')
-rw-r--r-- | builtin/apply.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/apply.c b/builtin/apply.c index 694f55dc5..84a8a0b52 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -1407,6 +1407,9 @@ static int find_header(char *line, unsigned long size, int *hdrsize, struct patc "%d leading pathname components (line %d)" , p_value, linenr); patch->old_name = patch->new_name = patch->def_name; } + if (!patch->is_delete && !patch->new_name) + die("git diff header lacks filename information " + "(line %d)", linenr); patch->is_toplevel_relative = 1; *hdrsize = git_hdr_len; return offset; |