diff options
author | James Bursa <james@netsurf-browser.org> | 2004-08-25 22:11:38 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2004-08-25 22:11:38 +0000 |
commit | 26d107c444cd6e30a0dacf707470c6cda267d34b (patch) | |
tree | 147775bafe0ee7d95a95f33318e435d1ee264c7b /render/box.c | |
parent | 6e795f9cb5ebf9d9c6c0a062e117dc35c5870ec2 (diff) | |
download | netsurf-26d107c444cd6e30a0dacf707470c6cda267d34b.tar.gz netsurf-26d107c444cd6e30a0dacf707470c6cda267d34b.tar.bz2 |
[project @ 2004-08-25 22:11:38 by bursa]
Fix a NULL pointer read.
svn path=/import/netsurf/; revision=1249
Diffstat (limited to 'render/box.c')
-rw-r--r-- | render/box.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/render/box.c b/render/box.c index e707e680f..64b225bce 100644 --- a/render/box.c +++ b/render/box.c @@ -2925,8 +2925,9 @@ struct box *box_object_at_point(struct content *c, int x, int y) return object_box; } + /** - * Find a box based upon its id attribute + * Find a box based upon its id attribute. * * \param box box to search * \param id id to look for @@ -2936,11 +2937,11 @@ struct box *box_find_by_id(struct box *box, const char *id) { struct box *a, *b; - if (strcmp(id, box->id) == 0) + if (box->id != NULL && strcmp(id, box->id) == 0) return box; for (a = box->children; a; a = a->next) { - if ((b = box_find_by_id(a, id)) != 0) + if ((b = box_find_by_id(a, id)) != NULL) return b; } |