This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Commit dea615b
Null-terminate buffers that strncpy writes to (#24095)
It is possible that the string being copied is so large that strncpy
fills up the destination array and does not write any null characters to
it. That will lead to buffer overflows. Work around that by always
writing a null character at the end of the destination array.1 parent 37957f4 commit dea615b
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| 308 | + | |
| 309 | + | |
308 | 310 | | |
309 | 311 | | |
310 | 312 | | |
| |||
412 | 414 | | |
413 | 415 | | |
414 | 416 | | |
| 417 | + | |
415 | 418 | | |
416 | 419 | | |
417 | 420 | | |
| |||
0 commit comments