Commit 7cb841d
committed
Fix integer overflow vulnerability in pkcs1_decode.c (#883)
This commit fixes an integer overflow vulnerability in the pkcs1_decode function.
Previously, the code was incrementing the position value returned by safe_search
before checking if it was SIZE_T_MAX (error condition). This could lead to an
overflow when adding 10 to SIZE_T_MAX, causing the subsequent error check to fail.
The fix ensures we check for the error condition before performing the addition,
preventing the potential overflow vulnerability.
Fixes #8831 parent 2c3a890 commit 7cb841d
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| 260 | + | |
260 | 261 | | |
261 | 262 | | |
262 | 263 | | |
| |||
0 commit comments