zlib can use m_malloc/m_free too

--HG--
branch : fuzz
This commit is contained in:
Matt Johnston
2017-05-22 22:09:26 +08:00
parent 50bde9976b
commit 114438e669
3 changed files with 15 additions and 7 deletions

View File

@@ -77,7 +77,9 @@ void * m_malloc(size_t size) {
}
void * m_calloc(size_t nmemb, size_t size) {
assert(nmemb <= 1000 && size <= 10000);
if (SIZE_T_MAX / nmemb < size) {
dropbear_exit("m_calloc failed");
}
return m_malloc(nmemb*size);
}