summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2010-08-18 12:14:23 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-08-18 12:14:23 -0700
commit7e00a9104bc8ce27f73132fbaa8f8528e26206a8 (patch)
treec691d01d180f63c632dd08a4569f9cf4d616ec2f /git-compat-util.h
parentMerge branch 'tc/checkout-B' (diff)
parentxsize_t: check whether we lose bits (diff)
downloadtgif-7e00a9104bc8ce27f73132fbaa8f8528e26206a8.tar.xz
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 02a73eeb66..fe845ae639 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;
}