mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-26 00:09:41 +03:00
html_script.c: html_script_exec() reqacquire script ptr
Since executing a script can cause more scripts to be appended to the script array, and that can cause a reallocation which might move the script array, reacquire the script pointer after running the script so that we don't wander off into the reeds. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
parent
a6de56583c
commit
9c32564085
@ -96,6 +96,11 @@ nserror html_script_exec(html_content *c, bool allow_defer)
|
||||
s->data.handle, &size );
|
||||
script_handler(c->jscontext, data, size,
|
||||
nsurl_access(hlcache_handle_get_url(s->data.handle)));
|
||||
/* We have to re-acquire this here since the
|
||||
* c->scripts array may have been reallocated
|
||||
* as a result of executing this script.
|
||||
*/
|
||||
s = &(c->scripts[i]);
|
||||
|
||||
s->already_started = true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user