diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-02-10 14:45:55 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-02-10 14:45:55 -0800 |
commit | b308bf18633964102472db5065929a359d4ad265 (patch) | |
tree | ad03f24d6bcaa3228f20f0141e73bdadffaf3cda /patch-delta.c | |
parent | 1a9fe453263137be7d42e6fbfc041b5b2d9521d7 (diff) | |
parent | 1368f65002bf39fdde7dd736a75ae35475184371 (diff) | |
download | git-b308bf18633964102472db5065929a359d4ad265.tar.gz git-b308bf18633964102472db5065929a359d4ad265.tar.xz |
Merge branch 'maint'
* maint:
compat: helper for detecting unsigned overflow
Diffstat (limited to 'patch-delta.c')
-rw-r--r-- | patch-delta.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/patch-delta.c b/patch-delta.c index d218faa02..56e0a5ede 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; |