mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Fix potential division by zero in nalloc_nofail when size is zero
This commit is contained in:
parent
dac999e693
commit
3e4f79180e
1 changed files with 1 additions and 1 deletions
|
|
@ -116,7 +116,7 @@ void* malloc_nofail(size_t size)
|
|||
|
||||
void* nalloc_nofail(size_t count, size_t size)
|
||||
{
|
||||
if (count > SIZE_MAX / size) {
|
||||
if (size != 0 && count > SIZE_MAX / size) {
|
||||
log_fatal(EINTERNAL, "Allocation size overflow\n");
|
||||
os_abort();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue