From 1dbbbaf64ad0c8e3cd81ea7453f091f3bb4c9075 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 14 Oct 2010 00:59:39 +0000 Subject: ensure iframe stuff does not de-reference null pointers svn path=/trunk/netsurf/; revision=10884 --- desktop/frames.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'desktop/frames.c') diff --git a/desktop/frames.c b/desktop/frames.c index ee9c31d6e..856a56395 100644 --- a/desktop/frames.c +++ b/desktop/frames.c @@ -124,7 +124,8 @@ void browser_window_recalculate_iframes(struct browser_window *bw) { int bw_width, bw_height; int index; - assert(bw); + assert(bw != NULL); + assert(bw->window != NULL); /* update window dimensions */ gui_window_get_dimensions(bw->window, &bw_width, &bw_height, false); @@ -137,9 +138,15 @@ void browser_window_recalculate_iframes(struct browser_window *bw) { for (index = 0; index < bw->iframe_count; index++) { window = &(bw->iframes[index]); - box_bounds(window->box, &rect); - gui_window_position_frame(window->window, rect.x0, rect.y0, - rect.x1, rect.y1); + + if ((window != NULL) && (window->box != NULL)) { + box_bounds(window->box, &rect); + gui_window_position_frame(window->window, + rect.x0, rect.y0, + rect.x1, rect.y1); + } else { + LOG(("Bad IFrame window=%p, box=%p",window,window->box)); + } } } -- cgit v1.2.3