Commit 871c1a3
Fix potential underflow in MachoView::ParseSymbolTable string bounds check
The existing guard compared sym.n_strx against symtab.strsize, but the
string list buffer is filled by Read() which may return fewer bytes than
requested on a truncated file. When the buffer is shorter than strsize,
an n_strx value that passes the strsize check can still exceed the actual
buffer length, causing the strnlen length argument to underflow and read
past the end of the buffer. Replacing the check with a comparison against
stringList.GetLength() ensures the subtraction always stays in bounds.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 16a0342 commit 871c1a3
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3382 | 3382 | | |
3383 | 3383 | | |
3384 | 3384 | | |
3385 | | - | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
3386 | 3389 | | |
3387 | 3390 | | |
3388 | 3391 | | |
| |||
0 commit comments