|
|
|
@ -249,8 +249,8 @@ void *cli_malloc(size_t size) |
|
|
|
|
void *alloc; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(size > MAX_ALLOCATION) { |
|
|
|
|
cli_errmsg("Attempt to allocate more than %d bytes. Please report to bugs@clamav.net\n", MAX_ALLOCATION); |
|
|
|
|
if(size > MAX_ALLOCATION || size < 0) { |
|
|
|
|
cli_errmsg("Attempt to allocate %d bytes. Please report to bugs@clamav.net\n", size); |
|
|
|
|
return NULL; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -268,8 +268,9 @@ void *cli_calloc(size_t nmemb, size_t size) |
|
|
|
|
{ |
|
|
|
|
void *alloc; |
|
|
|
|
|
|
|
|
|
if(size > MAX_ALLOCATION) { |
|
|
|
|
cli_errmsg("Attempt to allocate more than %d bytes. Please report to bugs@clamav.net\n", MAX_ALLOCATION); |
|
|
|
|
|
|
|
|
|
if(size > MAX_ALLOCATION || size < 0) { |
|
|
|
|
cli_errmsg("Attempt to allocate %d bytes. Please report to bugs@clamav.net\n", size); |
|
|
|
|
return NULL; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -287,10 +288,6 @@ void *cli_realloc(void *ptr, size_t size) |
|
|
|
|
{ |
|
|
|
|
void *alloc; |
|
|
|
|
|
|
|
|
|
if(size > MAX_ALLOCATION) { |
|
|
|
|
cli_errmsg("Attempt to allocate more than %d bytes. Please report to bugs@clamav.net\n", MAX_ALLOCATION); |
|
|
|
|
return NULL; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
alloc = realloc(ptr, size); |
|
|
|
|
|
|
|
|
|