mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-03 05:10:16 -05:00
Reject negative and out-of-range values in non-negative integer parsing
This commit is contained in:
parent
99a79b7049
commit
6f74455864
6 changed files with 131 additions and 23 deletions
|
|
@ -1444,7 +1444,7 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
int val = strtou(buffer, &e, 0);
|
||||
int val = strton(buffer, &e, 0);
|
||||
|
||||
if (e && !*e) {
|
||||
/* numerical form */
|
||||
|
|
@ -1593,7 +1593,7 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
state->autosave = strtoul(buffer, &e, 0);
|
||||
state->autosave = strtonl(buffer, &e, 0);
|
||||
|
||||
if (!e || *e) {
|
||||
/* LCOV_EXCL_START */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue