mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-28 19:06:42 -05:00
Prevent integer wrap-around when checking string length in sgetbs
This commit is contained in:
parent
c0961dc695
commit
6758ef411f
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 */
|
/* LCOV_EXCL_STOP */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len + 1 > size) {
|
if (len >= size) {
|
||||||
/* LCOV_EXCL_START */
|
/* LCOV_EXCL_START */
|
||||||
return -1;
|
return -1;
|
||||||
/* LCOV_EXCL_STOP */
|
/* LCOV_EXCL_STOP */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue