summaryrefslogtreecommitdiff
path: root/diffcore-break.c
diff options
context:
space:
mode:
authorJunio C Hamano <junio@twinsun.com>2005-12-12 12:50:40 -0800
committerJunio C Hamano <junkio@cox.net>2005-12-12 12:57:25 -0800
commitd28c8af623b0d15740c2af0106d8e2bf54a3ac52 (patch)
treec4976b157150e6795423d1158cf0a06e59ca6bb1 /diffcore-break.c
parentb825e6ff5d003db8efd1ed43cdbbb9d637df0a0c (diff)
downloadgit-d28c8af623b0d15740c2af0106d8e2bf54a3ac52.tar.gz
diffcore-break.c: check diff_delta() return value.
This bug caused Darrin Thompson to notice that our deltifier was half broken and punting on an empty blob. Signed-off-by: Junio C Hamano <junio@twinsun.com>
Diffstat (limited to 'diffcore-break.c')
-rw-r--r--diffcore-break.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/diffcore-break.c b/diffcore-break.c
index 06f9a7f0ee..e6a468e6b0 100644
--- a/diffcore-break.c
+++ b/diffcore-break.c
@@ -66,6 +66,8 @@ static int should_break(struct diff_filespec *src,
delta = diff_delta(src->data, src->size,
dst->data, dst->size,
&delta_size, 0);
+ if (!delta)
+ return 0; /* error but caught downstream */
/* Estimate the edit size by interpreting delta. */
if (count_delta(delta, delta_size,