Skip to content

Commit

Permalink
fix bug when round_sz() rounds to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierpierre committed Apr 20, 2021
1 parent b6865c4 commit a9d9c9e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/slimguard.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@ void* xxmalloc(size_t sz) {
uint8_t index = 255;
need = round_sz(sz);

/* Can happen if sz is large enough */
if(!need)
return NULL;

if (need >= (1 << 17)) {
Debug("sz %lu\n", need);
ret = xxmalloc_large(need, 0);
Expand Down

0 comments on commit a9d9c9e

Please sign in to comment.