Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/9c32564085de877b9fd98aeddc09812fe9b6efb5
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/9c32564085de877b9fd98aeddc09812fe9b6efb5
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/9c32564085de877b9fd98aeddc09812fe9b6efb5

The branch, master has been updated
       via  9c32564085de877b9fd98aeddc09812fe9b6efb5 (commit)
      from  a6de56583c56e2d438639b58b0ce1eb4b64a941a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=9c32564085de877b9fd98aeddc09812fe9b6efb5
commit 9c32564085de877b9fd98aeddc09812fe9b6efb5
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>

    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 <[email protected]>

diff --git a/content/handlers/html/html_script.c 
b/content/handlers/html/html_script.c
index 203dc50..2a72d51 100644
--- a/content/handlers/html/html_script.c
+++ b/content/handlers/html/html_script.c
@@ -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;
 


-----------------------------------------------------------------------

Summary of changes:
 content/handlers/html/html_script.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/content/handlers/html/html_script.c 
b/content/handlers/html/html_script.c
index 203dc50..2a72d51 100644
--- a/content/handlers/html/html_script.c
+++ b/content/handlers/html/html_script.c
@@ -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;
 


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to