mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-23 23:09:39 +03:00
Squash access to freed memory.
Actually process form inputs which have been styled display:none; This needs revisiting after 1.0 as the following will still break: <form ..> <div style="display:none;"> <input type="hidden" name="foo" value="bar"/> </div> <input type="submit" name="submit" value="submit"/> </form> The children of the div are not processed (which is correct for display purposes, but results in the hidden input being ignored entirely). A more correct fix would be to perform form input -> gadget creation orthogonally from box tree generation; then styling will have no effect. svn path=/trunk/netsurf/; revision=3236
This commit is contained in:
parent
f059818d74
commit
94d12a96e7
@ -307,10 +307,6 @@ bool box_construct_element(xmlNode *n, struct content *content,
|
||||
style = box_get_style(content, parent_style, n);
|
||||
if (!style)
|
||||
return false;
|
||||
if (style->display == CSS_DISPLAY_NONE) {
|
||||
talloc_free(style);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* extract title attribute, if present */
|
||||
if ((title0 = xmlGetProp(n, (const xmlChar *) "title"))) {
|
||||
@ -348,7 +344,11 @@ bool box_construct_element(xmlNode *n, struct content *content,
|
||||
}
|
||||
if (style->display == CSS_DISPLAY_NONE) {
|
||||
talloc_free(style);
|
||||
box_free_box(box);
|
||||
/* We can't do this, as it will destroy any gadget
|
||||
* associated with the box, thus making any form usage
|
||||
* access freed memory. The box is in the talloc context,
|
||||
* anyway, so will get cleaned up with the content. */
|
||||
/* box_free_box(box); */
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user