summaryrefslogtreecommitdiffstats
path: root/XUtils.h
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-12-23 21:52:40 +0100
committercgzones <cgzones@googlemail.com>2021-01-02 22:35:13 +0100
commit8c8149d146f744b2c0c64b80ba9220bd464de013 (patch)
tree2ef7fe73216d7d9cc1926b6afad3ee0a3d0a2bb6 /XUtils.h
parenta150a81669027601aefc231f208a715e16b24c62 (diff)
XUtils: check for multiplication overflow in allocation size
Diffstat (limited to 'XUtils.h')
-rw-r--r--XUtils.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/XUtils.h b/XUtils.h
index 19cfadb3..9e5e62cf 100644
--- a/XUtils.h
+++ b/XUtils.h
@@ -23,10 +23,14 @@ void fail(void) ATTR_NORETURN;
void* xMalloc(size_t size);
+void* xMallocArray(size_t nmemb, size_t size);
+
void* xCalloc(size_t nmemb, size_t size);
void* xRealloc(void* ptr, size_t size);
+void* xReallocArray(void* ptr, size_t nmemb, size_t size);
+
/*
* String_startsWith gives better performance if strlen(match) can be computed
* at compile time (e.g. when they are immutable string literals). :)

© 2014-2024 Faster IT GmbH | imprint | privacy policy