Skip to content

Commit

Permalink
fixed another security issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jkriege2 committed May 21, 2024
1 parent 3a8d9cc commit 8072be8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/tinymatwriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,11 @@ const char *TinyMATWriter_getVersion()
else if (newsize < 1000 * 1024 * 1024) newsize = newsize * 3 / 2;
else newsize = newsize * 6 / 5;
}
file->filedata = (uint8_t*)realloc(file->filedata, newsize);
file->filedata_size = newsize;
auto newMem = (uint8_t*)realloc(file->filedata, newsize);
if (newMem) {
file->filedata=newMem;
file->filedata_size = newsize;
}
}
#endif
}
Expand Down

0 comments on commit 8072be8

Please sign in to comment.