Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
xsize_t: check whether we lose bits
[gitweb.git]
/
git-compat-util.h
diff --git
a/git-compat-util.h
b/git-compat-util.h
index 7534db1267bfa64a4a0cba80680fefc42177f0e8..513d2d7aee1bc56e23ac3f5829c3ff531f37ae5b 100644
(file)
--- 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;
}