Commit e473c83
Marcin Drzymala
Fix two UAF errors in read_ihex_chunks()
1. Linked list uses realloc but did not update
the pointer in the previous linked list item
resulting in Use-After-Free error. A backlink_p
local variable is introduced to update the pointer
address after a reallocation.
2. The local variable chunks_p was not updated
after realloc which also resulted in UAF when
allocating a new element to the linked list.
A refreshing of the address was added after realloc.1 parent ec34106 commit e473c83
1 file changed
+13
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| |||
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
153 | | - | |
| 154 | + | |
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| |||
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
173 | 180 | | |
174 | 181 | | |
175 | 182 | | |
| |||
178 | 185 | | |
179 | 186 | | |
180 | 187 | | |
181 | | - | |
182 | 188 | | |
183 | 189 | | |
184 | 190 | | |
| |||
255 | 261 | | |
256 | 262 | | |
257 | 263 | | |
258 | | - | |
| 264 | + | |
259 | 265 | | |
260 | 266 | | |
261 | | - | |
| 267 | + | |
262 | 268 | | |
263 | 269 | | |
264 | 270 | | |
| |||
274 | 280 | | |
275 | 281 | | |
276 | 282 | | |
277 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
278 | 286 | | |
279 | 287 | | |
280 | 288 | | |
| |||
0 commit comments