Commit bcdfea7
committed
fix potential MEM_SIZE overflow in expected_size()
Coverity says:
CID 584099: Integer handling issues (INTEGER_OVERFLOW)
Expression "newlen + 8UL", where "newlen" is known to be equal to 18446744073709551615, overflows the type of "newlen + 8UL", which is type "unsigned long".
(Referring to (n) + PTRSIZE - 1 where n = newlen and PTRSIZE = 8UL.)
Crudely avoid the issue by checking n for overflow beforehand and dying
with a "panic: memory wrap" error if so.1 parent f29af08 commit bcdfea7
1 file changed
+9
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1700 | 1700 | | |
1701 | 1701 | | |
1702 | 1702 | | |
1703 | | - | |
1704 | | - | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
1705 | 1712 | | |
1706 | 1713 | | |
1707 | 1714 | | |
| |||
0 commit comments