Commit 6f75146
fix(linux): fix off-by-one buffer overflow in process_parse_stat (#2324)
When slash_pos is 0 (executable path starts with '/'), the null
terminator was written to cmdline_procname[BUFFER_LEN], which is one
byte past the end of the array.
Subtract 1 from both the strncpy length and the null terminator index
so they are always within the [0, BUFFER_LEN-1] bounds of the buffer.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 451dd43 commit 6f75146
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3026 | 3026 | | |
3027 | 3027 | | |
3028 | 3028 | | |
3029 | | - | |
3030 | | - | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
3031 | 3032 | | |
3032 | 3033 | | |
3033 | 3034 | | |
| |||
0 commit comments