mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 04:09:50 +00:00
Bug 1082524 - Do not deref null pointers in link_map. r=nfroyd
This commit is contained in:
parent
3b8be5cd0d
commit
c9456870c0
@ -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…
x
Reference in New Issue
Block a user