summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junio@twinsun.com>2005-12-12 20:50:40 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-12-12 20:57:25 (GMT)
commitd28c8af623b0d15740c2af0106d8e2bf54a3ac52 (patch)
treec4976b157150e6795423d1158cf0a06e59ca6bb1
parentb825e6ff5d003db8efd1ed43cdbbb9d637df0a0c (diff)
downloadgit-d28c8af623b0d15740c2af0106d8e2bf54a3ac52.zip
git-d28c8af623b0d15740c2af0106d8e2bf54a3ac52.tar.gz
git-d28c8af623b0d15740c2af0106d8e2bf54a3ac52.tar.bz2
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>
-rw-r--r--diffcore-break.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/diffcore-break.c b/diffcore-break.c
index 06f9a7f..e6a468e 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,