From: Junio C Hamano Date: Mon, 12 Dec 2005 20:50:40 +0000 (-0800) Subject: diffcore-break.c: check diff_delta() return value. X-Git-Tag: v0.99.9n^2~25 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d28c8af623b0d15740c2af0106d8e2bf54a3ac52;p=git.git 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 --- diff --git a/diffcore-break.c b/diffcore-break.c index 06f9a7f0e..e6a468e6b 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,