X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=wrapper.c;h=28290002b9f6434d716a39612f3afc9958c292af;hb=25197ebe7f813407b028a2c304ff8ee58da40a16;hp=55b074ec46b0a222b03f8bea42f4d5cdd9811293;hpb=05f08e4c9ed4a9c34eb2d62300189a3e8a86b5a5;p=git.git diff --git a/wrapper.c b/wrapper.c index 55b074ec4..28290002b 100644 --- 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; @@ -209,7 +209,7 @@ int xmkstemp(char *template) if (!template[0]) template = origtemplate; - nonrelative_template = make_nonrelative_path(template); + nonrelative_template = absolute_path(template); errno = saved_errno; die_errno("Unable to create temporary file '%s'", nonrelative_template); @@ -344,7 +344,7 @@ int xmkstemp_mode(char *template, int mode) if (!template[0]) template = origtemplate; - nonrelative_template = make_nonrelative_path(template); + nonrelative_template = absolute_path(template); errno = saved_errno; die_errno("Unable to create temporary file '%s'", nonrelative_template);