Commit 91ba436
committed
fix heap corruption on LP64 platforms
Mixing unsigned long and int on LP64 platforms caused the chunksize
adjustment to be wrong for flash memory reads from "negative"
addresses. This caused runaway reads and heap corruption, because
chunksize was being adjusted to be greater than numBytes. Simplify
the computation by computing the offset within the page using a mask,
and use that to check the length against pageSize.
This is less necessary after the qXfer:memory-map:read support
was added, but it's definitely needed in 2.13, and maybe some
older GDB versions don't support qXfer:memory-map:read.1 parent 3c39ae8 commit 91ba436
1 file changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
| 155 | + | |
155 | 156 | | |
156 | 157 | | |
157 | | - | |
158 | | - | |
| 158 | + | |
| 159 | + | |
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
| |||
0 commit comments