Skip to content

Commit 745654f

Browse files
committed
Merge branch 'tr/xsize-bits' into maint
* tr/xsize-bits: xsize_t: check whether we lose bits
2 parents 6baa9bd + 46be82d commit 745654f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

git-compat-util.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,8 @@ extern int odb_pack_keep(char *name, size_t namesz, unsigned char *sha1);
388388

389389
static inline size_t xsize_t(off_t len)
390390
{
391+
if (len > (size_t) len)
392+
die("Cannot handle files this big");
391393
return (size_t)len;
392394
}
393395

0 commit comments

Comments
 (0)