mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-28 09:13:08 +03:00
[project @ 2004-08-25 22:11:38 by bursa]
Fix a NULL pointer read. svn path=/import/netsurf/; revision=1249
This commit is contained in:
parent
6e795f9cb5
commit
26d107c444
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user