mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Prevent integer wrap-around when checking string length in sgetbs
This commit is contained in:
parent
4f7bbf1b9b
commit
15246b6eaf
1 changed files with 1 additions and 1 deletions
|
|
@ -679,7 +679,7 @@ int sgetbs(STREAM* f, char* str, size_t size)
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
if (len + 1 > size) {
|
||||
if (len >= size) {
|
||||
/* LCOV_EXCL_START */
|
||||
return -1;
|
||||
/* LCOV_EXCL_STOP */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue