mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1082524 - Do not deref null pointers in link_map. r=nfroyd
This commit is contained in:
parent
329a5d00db
commit
a6593e4218
@ -885,16 +885,18 @@ ElfLoader::DebuggerHelper::Remove(ElfLoader::link_map *map)
|
||||
dbg->r_brk();
|
||||
if (dbg->r_map == map)
|
||||
dbg->r_map = map->l_next;
|
||||
else
|
||||
else if (map->l_prev) {
|
||||
map->l_prev->l_next = map->l_next;
|
||||
}
|
||||
if (map == firstAdded) {
|
||||
firstAdded = map->l_prev;
|
||||
/* When removing the first added library, its l_next is going to be
|
||||
* data handled by the system linker, and that data may be read-only */
|
||||
EnsureWritable w(&map->l_next->l_prev);
|
||||
map->l_next->l_prev = map->l_prev;
|
||||
} else
|
||||
} else if (map->l_next) {
|
||||
map->l_next->l_prev = map->l_prev;
|
||||
}
|
||||
dbg->r_state = r_debug::RT_CONSISTENT;
|
||||
dbg->r_brk();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user