Gitweb links:

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

The branch, master has been updated
       via  d3d17ded9c3d7707ac8a69fde424385465422be0 (commit)
       via  2cb33b0c334f0b389b8cbbf26a2a3f1af3bccd6d (commit)
      from  b577de7c5bbba6c2f9a0b4ede3f814ea3023ded6 (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=d3d17ded9c3d7707ac8a69fde424385465422be0
commit d3d17ded9c3d7707ac8a69fde424385465422be0
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>

    dukky: Don't allow js_exec on a thread pending destruction
    
    Signed-off-by: Daniel Silverstone <[email protected]>

diff --git a/content/handlers/javascript/duktape/dukky.c 
b/content/handlers/javascript/duktape/dukky.c
index 7357863..6d87712 100644
--- a/content/handlers/javascript/duktape/dukky.c
+++ b/content/handlers/javascript/duktape/dukky.c
@@ -925,6 +925,11 @@ js_exec(jsthread *thread, const uint8_t *txt, size_t 
txtlen, const char *name)
                return false;
        }
 
+       if (thread->pending_destroy) {
+               NSLOG(dukky, DEEPDEBUG, "Skipping exec call because thread is 
dead");
+               return false;
+       }
+
        dukky_enter_thread(thread);
 
        duk_set_top(CTX, 0);


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

    dukky: Various checks for win being NULL
    
    Signed-off-by: Daniel Silverstone <[email protected]>

diff --git a/content/handlers/javascript/duktape/Console.bnd 
b/content/handlers/javascript/duktape/Console.bnd
index 3de875a..fcf6ee8 100644
--- a/content/handlers/javascript/duktape/Console.bnd
+++ b/content/handlers/javascript/duktape/Console.bnd
@@ -51,7 +51,7 @@ write_log_entry(duk_context *ctx, unsigned int group, 
browser_window_console_fla
        duk_size_t msglen;
        const char *msg = duk_safe_to_lstring(ctx, 0, &msglen);
 
-       if (priv_win == NULL ||
+       if (priv_win == NULL || priv_win->win == NULL ||
            browser_window_console_log(priv_win->win, BW_CS_SCRIPT_CONSOLE,
                                       msg, msglen,
                                       flags) != NSERROR_OK) {
diff --git a/content/handlers/javascript/duktape/Window.bnd 
b/content/handlers/javascript/duktape/Window.bnd
index 175f4ac..2c26f1d 100644
--- a/content/handlers/javascript/duktape/Window.bnd
+++ b/content/handlers/javascript/duktape/Window.bnd
@@ -277,6 +277,9 @@ static duk_ret_t dukky_window_closedown_thread(duk_context 
*ctx)
 
 init Window(struct browser_window *win, struct html_content *htmlc)
 %{
+       /* It makes no sense if win or htmlc are NULL */
+       assert(win != NULL);
+       assert(htmlc != NULL);
        /* element window */
        priv->win = win;
        priv->htmlc = htmlc;


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

Summary of changes:
 content/handlers/javascript/duktape/Console.bnd |    2 +-
 content/handlers/javascript/duktape/Window.bnd  |    3 +++
 content/handlers/javascript/duktape/dukky.c     |    5 +++++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/content/handlers/javascript/duktape/Console.bnd 
b/content/handlers/javascript/duktape/Console.bnd
index 3de875a..fcf6ee8 100644
--- a/content/handlers/javascript/duktape/Console.bnd
+++ b/content/handlers/javascript/duktape/Console.bnd
@@ -51,7 +51,7 @@ write_log_entry(duk_context *ctx, unsigned int group, 
browser_window_console_fla
        duk_size_t msglen;
        const char *msg = duk_safe_to_lstring(ctx, 0, &msglen);
 
-       if (priv_win == NULL ||
+       if (priv_win == NULL || priv_win->win == NULL ||
            browser_window_console_log(priv_win->win, BW_CS_SCRIPT_CONSOLE,
                                       msg, msglen,
                                       flags) != NSERROR_OK) {
diff --git a/content/handlers/javascript/duktape/Window.bnd 
b/content/handlers/javascript/duktape/Window.bnd
index 175f4ac..2c26f1d 100644
--- a/content/handlers/javascript/duktape/Window.bnd
+++ b/content/handlers/javascript/duktape/Window.bnd
@@ -277,6 +277,9 @@ static duk_ret_t dukky_window_closedown_thread(duk_context 
*ctx)
 
 init Window(struct browser_window *win, struct html_content *htmlc)
 %{
+       /* It makes no sense if win or htmlc are NULL */
+       assert(win != NULL);
+       assert(htmlc != NULL);
        /* element window */
        priv->win = win;
        priv->htmlc = htmlc;
diff --git a/content/handlers/javascript/duktape/dukky.c 
b/content/handlers/javascript/duktape/dukky.c
index 7357863..6d87712 100644
--- a/content/handlers/javascript/duktape/dukky.c
+++ b/content/handlers/javascript/duktape/dukky.c
@@ -925,6 +925,11 @@ js_exec(jsthread *thread, const uint8_t *txt, size_t 
txtlen, const char *name)
                return false;
        }
 
+       if (thread->pending_destroy) {
+               NSLOG(dukky, DEEPDEBUG, "Skipping exec call because thread is 
dead");
+               return false;
+       }
+
        dukky_enter_thread(thread);
 
        duk_set_top(CTX, 0);


-- 
NetSurf Browser
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to