summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-08-18 19:14:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-08-18 19:14:23 (GMT)
commit7e00a9104bc8ce27f73132fbaa8f8528e26206a8 (patch)
treec691d01d180f63c632dd08a4569f9cf4d616ec2f /git-compat-util.h
parent07cd900112b19657531a1f5c2a15e639d98fbd18 (diff)
parent46be82dfd0850d7e96b1401a81a396e0cd0e0527 (diff)
downloadgit-7e00a9104bc8ce27f73132fbaa8f8528e26206a8.zip
git-7e00a9104bc8ce27f73132fbaa8f8528e26206a8.tar.gz
git-7e00a9104bc8ce27f73132fbaa8f8528e26206a8.tar.bz2
Merge branch 'tr/xsize-bits'
* tr/xsize-bits: xsize_t: check whether we lose bits
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 02a73ee..fe845ae 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -388,6 +388,8 @@ extern int odb_pack_keep(char *name, size_t namesz, unsigned char *sha1);
static inline size_t xsize_t(off_t len)
{
+ if (len > (size_t) len)
+ die("Cannot handle files this big");
return (size_t)len;
}