XUtils: check for multiplication overflow in allocation size

This commit is contained in:
Christian Göttsche
2020-12-23 21:52:40 +01:00
committed by cgzones
parent a150a81669
commit 8c8149d146
3 changed files with 28 additions and 2 deletions

View File

@ -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). :)