From d28c8af623b0d15740c2af0106d8e2bf54a3ac52 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 12 Dec 2005 12:50:40 -0800 Subject: [PATCH] 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 --- diffcore-break.c | 2 ++ 1 file changed, 2 insertions(+) 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, -- 2.30.2