summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 7534db1267..513d2d7aee 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -260,6 +260,8 @@ static inline ssize_t xwrite(int fd, const void *buf, size_t len)
static inline size_t xsize_t(off_t len)
{
+ if (len > (size_t) len)
+ die("Cannot handle files this big");
return (size_t)len;
}