X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=patch-delta.c;h=56e0a5ede22c9396fc897bf1d3444dce92d8916f;hb=8e848868fff625a8dda92fb11edf2b7975827e1a;hp=d218faa02bd12b0e6a0df298a6a0e5787e46d93f;hpb=e8a12280530f16bf2089999ceefe35794d115d07;p=thirdparty%2Fgit.git diff --git a/patch-delta.c b/patch-delta.c index d218faa02b..56e0a5ede2 100644 --- a/patch-delta.c +++ b/patch-delta.c @@ -48,7 +48,7 @@ void *patch_delta(const void *src_buf, unsigned long src_size, if (cmd & 0x20) cp_size |= (*data++ << 8); if (cmd & 0x40) cp_size |= (*data++ << 16); if (cp_size == 0) cp_size = 0x10000; - if (cp_off + cp_size < cp_size || + if (unsigned_add_overflows(cp_off, cp_size) || cp_off + cp_size > src_size || cp_size > size) break;