diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-11-24 12:47:04 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-11-24 12:47:04 -0800 |
commit | 9bdef78fb05ce2ca7788518e17ae20488b153335 (patch) | |
tree | 7ad1aaab6e9e0adcf9e627f9e5d0357d86bac838 /builtin | |
parent | d2a99221a768e2a231338fbe17d92ffa7e0458af (diff) | |
parent | 24305cd7009d682ba4115103c95844446a2bb305 (diff) | |
download | git-9bdef78fb05ce2ca7788518e17ae20488b153335.tar.gz git-9bdef78fb05ce2ca7788518e17ae20488b153335.tar.xz |
Merge branch 'jk/maint-apply-no-binary' into maint
* jk/maint-apply-no-binary:
apply: don't segfault on binary files with missing data
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/apply.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin/apply.c b/builtin/apply.c index 23c18c573..f051e66dc 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -2645,6 +2645,12 @@ static int apply_binary_fragment(struct image *img, struct patch *patch) unsigned long len; void *dst; + if (!fragment) + return error("missing binary patch data for '%s'", + patch->new_name ? + patch->new_name : + patch->old_name); + /* Binary patch is irreversible without the optional second hunk */ if (apply_in_reverse) { if (!fragment->next) |