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; }