diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-10-21 10:49:24 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-21 10:49:24 -0700 |
commit | cec3e186f7b76cdced54286ef1da42b6978c4c8d (patch) | |
tree | 8e7ca592b5e92112c30b940b5ef8242a3fa48a38 /builtin | |
parent | df6840855d24c2f54c0b8a66cbac33d8af43333a (diff) | |
parent | 2c93286ab2ca5271e26779ffd1ecfd1c7a082a41 (diff) | |
download | git-cec3e186f7b76cdced54286ef1da42b6978c4c8d.tar.gz |
Merge branch 'jm/maint-apply-detects-corrupt-patch-header' into maint
* jm/maint-apply-detects-corrupt-patch-header:
fix "git apply --index ..." not to deref NULL
Diffstat (limited to 'builtin')
-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 f2edc52818..aaa39fe17e 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; |