Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-01-13 02:11:41 +0300
committerJunio C Hamano <gitster@pobox.com>2022-01-13 02:11:41 +0300
commitc9c082850d263f073483ebcaa118c3f8be2061c4 (patch)
tree159d705ed24eac77af77decb4658a22d9850cc45
parent4e2e2a4ffe0031a78ebeb702fdcdb9f0338f87ff (diff)
parenta5c97b016421a2869b460bbf6bdcd43dc186d433 (diff)
Merge branch 'jt/pack-header-lshift-overflow'
* jt/pack-header-lshift-overflow: packfile: fix off-by-one error in decoding logic
-rw-r--r--packfile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/packfile.c b/packfile.c
index 11bb262482..835b2d2716 100644
--- a/packfile.c
+++ b/packfile.c
@@ -1069,7 +1069,7 @@ unsigned long unpack_object_header_buffer(const unsigned char *buf,
size = c & 15;
shift = 4;
while (c & 0x80) {
- if (len <= used || (bitsizeof(long) - 7) <= shift) {
+ if (len <= used || (bitsizeof(long) - 7) < shift) {
error("bad object header");
size = used = 0;
break;