Skip to content

Commit

Permalink
Load: Fix signed integer limit error.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bin He committed Jan 26, 2022
1 parent 5206ece commit 2e233c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/load.c
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ static cyaml_err_t cyaml__read_int(
return CYAML_ERR_INVALID_DATA_SIZE;
}

max = (INT64_MAX >> ((8 - schema->data_size) * 8)) / 2;
max = (int64_t)((UINT64_MAX >> ((8 - schema->data_size) * 8)) / 2);
min = (-max) - 1;

errno = 0;
Expand Down

0 comments on commit 2e233c6

Please sign in to comment.