diff --git a/wrapper.c b/wrapper.c
index 55b074ec46b0a222b03f8bea42f4d5cdd9811293..4c147d6c48c000bab636fad3edc2fe7da6670948 100644 (file)
--- a/wrapper.c
+++ b/wrapper.c
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;