diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-11-17 15:01:18 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-11-17 15:01:18 -0800 |
commit | ee438efbc1a05382fa6f2ab59e7d07240a5013be (patch) | |
tree | 2a0a571446019e49e3e573c3214d9fa4d04d3f40 /builtin | |
parent | 0510480510b181216d565ebcedea471d50c200b1 (diff) | |
parent | 24305cd7009d682ba4115103c95844446a2bb305 (diff) | |
download | git-ee438efbc1a05382fa6f2ab59e7d07240a5013be.tar.gz git-ee438efbc1a05382fa6f2ab59e7d07240a5013be.tar.xz |
Merge branch 'jk/maint-apply-no-binary'
* 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) |