Repository navigation
Commit 513daa3
nandpart: fix UAF when freeing mbr
The cleanup loop frees all mbrs entries, including the one referenced by
mbr. This leaves mbr pointing to freed memory that is subsequently used
to update and write the partition tables.
Skip mbr in the initial cleanup and free it after writing or when the
user cancels.
Signed-off-by: r4v3n6101 <raven6107@gmail.com>1 parent a08a24a commit 513daa3
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
| 236 | + | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
243 | 244 | | |
244 | 245 | | |
245 | 246 | | |
| |||
256 | 257 | | |
257 | 258 | | |
258 | 259 | | |
| 260 | + | |
259 | 261 | | |
260 | 262 | | |
261 | 263 | | |
| |||
0 commit comments