]> git.ipfire.org Git - thirdparty/git.git/blobdiff - wrapper.c
commit: refer to commit template as s->fp
[thirdparty/git.git] / wrapper.c
index 55b074ec46b0a222b03f8bea42f4d5cdd9811293..4c147d6c48c000bab636fad3edc2fe7da6670948 100644 (file)
--- a/wrapper.c
+++ b/wrapper.c
@@ -53,7 +53,7 @@ void *xmalloc(size_t size)
 void *xmallocz(size_t size)
 {
        void *ret;
-       if (size + 1 < size)
+       if (unsigned_add_overflows(size, 1))
                die("Data too large to fit into virtual memory space.");
        ret = xmalloc(size + 1);
        ((char*)ret)[size] = 0;