Skip to content

Commit

Permalink
Merge pull request #989 from slyshykO/fix-988
Browse files Browse the repository at this point in the history
st-flash: Fix for mmap() size_t overflow
  • Loading branch information
Nightwalker-87 committed Jun 18, 2020
2 parents 1ae3c08 + 1541dfc commit 9fb74bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@ static int map_file(mapped_file_t* mf, const char* path) {

if (sizeof(st.st_size) != sizeof(size_t)) {
// on 32 bit systems, check if there is an overflow
if (st.st_size > (off_t)UINT32_MAX) {
if (st.st_size > (off_t)INT32_MAX) {
fprintf(stderr, "mmap() size_t overflow for file %s\n", path);
goto on_error;
}
Expand Down

0 comments on commit 9fb74bd

Please sign in to comment.