@matheusbsbs / matheus-bagliano / commits / d28c8af623
Fork 0

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>

Junio C Hamano committed Dec 12, 2005 at 12:50 UTC d28c8af623b0d15740c2af0106d8e2bf54a3ac52
1 file changed +2
diffcore-break.c
+2
@@ -66,6 +66,8 @@ static int should_break(struct diff_filespec *src,
66 delta = diff_delta(src->data, src->size,
67 dst->data, dst->size,
68 &delta_size, 0);
69 + if (!delta)
70 + return 0; /* error but caught downstream */
71
72 /* Estimate the edit size by interpreting delta. */
73 if (count_delta(delta, delta_size,