mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-25 13:37:02 +03:00
Avoid NULL pointer dereferences
svn path=/trunk/netsurf/; revision=9684
This commit is contained in:
parent
c2fd55cbab
commit
2562f7e8c2
@ -1265,21 +1265,31 @@ void browser_window_find_target_internal(struct browser_window *bw,
|
||||
return;
|
||||
|
||||
depth++;
|
||||
|
||||
if (bw->children != NULL) {
|
||||
for (i = 0; i < (bw->cols * bw->rows); i++) {
|
||||
if ((bw->children[i].name) &&
|
||||
(!strcasecmp(bw->children[i].name, target))) {
|
||||
if ((page == &bw->children[i]) || (depth > *rdepth)) {
|
||||
(!strcasecmp(bw->children[i].name,
|
||||
target))) {
|
||||
if ((page == &bw->children[i]) ||
|
||||
(depth > *rdepth)) {
|
||||
*rdepth = depth;
|
||||
*bw_target = &bw->children[i];
|
||||
}
|
||||
}
|
||||
if (bw->children[i].children)
|
||||
browser_window_find_target_internal(&bw->children[i],
|
||||
browser_window_find_target_internal(
|
||||
&bw->children[i],
|
||||
target, depth, page,
|
||||
rdepth, bw_target);
|
||||
}
|
||||
}
|
||||
|
||||
if (bw->iframes != NULL) {
|
||||
for (i = 0; i < bw->iframe_count; i++)
|
||||
browser_window_find_target_internal(&bw->iframes[i],
|
||||
target, depth, page, rdepth, bw_target);
|
||||
}
|
||||
for (i = 0; i < bw->iframe_count; i++)
|
||||
browser_window_find_target_internal(&bw->iframes[i], target,
|
||||
depth, page, rdepth, bw_target);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user