Skip to content

Commit

Permalink
packfile.c: set shift limit to sizeof(size_t), not long
Browse files Browse the repository at this point in the history
The code base now uses size_t for all memsized variables.
Allow shift to reach that bitness level.

Signed-off-by: Philip Oakley <[email protected]>
  • Loading branch information
Philip Oakley authored and dscho committed Jun 4, 2019
1 parent eeb79ff commit a8e0ee7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ size_t unpack_object_header_buffer(const unsigned char *buf,
size = c & 15;
shift = 4;
while (c & 0x80) {
if (len <= used || bitsizeof(long) <= shift) {
if (len <= used || bitsizeof(size_t) <= shift) {
error("bad object header");
size = used = 0;
break;
Expand Down

0 comments on commit a8e0ee7

Please sign in to comment.