pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/vimb vimb: Do not crash when opening a new tab via...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8053d5ffaa6e
branches:  trunk
changeset: 396255:8053d5ffaa6e
user:      leot <leot%pkgsrc.org@localhost>
date:      Sun May 26 20:25:13 2019 +0000

description:
vimb: Do not crash when opening a new tab via context menu

Backported from upstream commit 79c69ba194db0e4ddfb4ff985bc51c3b14ac8dd3.

PKGREVISION++

diffstat:

 www/vimb/Makefile                 |   4 +-
 www/vimb/distinfo                 |   4 ++-
 www/vimb/patches/patch-src_main.c |  56 +++++++++++++++++++++++++++++++++++++++
 www/vimb/patches/patch-src_util.c |  27 ++++++++++++++++++
 4 files changed, 88 insertions(+), 3 deletions(-)

diffs (118 lines):

diff -r 84931e7f1980 -r 8053d5ffaa6e www/vimb/Makefile
--- a/www/vimb/Makefile Sun May 26 19:51:25 2019 +0000
+++ b/www/vimb/Makefile Sun May 26 20:25:13 2019 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.30 2019/04/03 00:33:13 ryoon Exp $
+# $NetBSD: Makefile,v 1.31 2019/05/26 20:25:13 leot Exp $
 
 DISTNAME=      vimb-3.4.0
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    www
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=fanglingsu/}
 
diff -r 84931e7f1980 -r 8053d5ffaa6e www/vimb/distinfo
--- a/www/vimb/distinfo Sun May 26 19:51:25 2019 +0000
+++ b/www/vimb/distinfo Sun May 26 20:25:13 2019 +0000
@@ -1,7 +1,9 @@
-$NetBSD: distinfo,v 1.4 2019/03/31 20:52:16 leot Exp $
+$NetBSD: distinfo,v 1.5 2019/05/26 20:25:13 leot Exp $
 
 SHA1 (vimb-3.4.0.tar.gz) = 6a179822fd5bb03a4597ffc7267ccd2e8357ad16
 RMD160 (vimb-3.4.0.tar.gz) = a339e8227bbace0004d10f6d36095079559da973
 SHA512 (vimb-3.4.0.tar.gz) = 80586c1ee5836b848a63cb4efd53c4a75fbeede0a3f6ee405b6e145063a17c32c3856af122b6a385cd2283519b86ad480fbf88c978ec0a32830c74d68c95a6ea
 Size (vimb-3.4.0.tar.gz) = 138452 bytes
 SHA1 (patch-Makefile) = 973017a0cc4b2a65535aaa40ae2eb63a4b020acf
+SHA1 (patch-src_main.c) = 127beefbe9cb853a7f2e1b7a0f19d4e87cbc9db3
+SHA1 (patch-src_util.c) = 8794f09aaf86cb2e19372f404e3c60fa1b045505
diff -r 84931e7f1980 -r 8053d5ffaa6e www/vimb/patches/patch-src_main.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/vimb/patches/patch-src_main.c Sun May 26 20:25:13 2019 +0000
@@ -0,0 +1,56 @@
+$NetBSD: patch-src_main.c,v 1.1 2019/05/26 20:25:13 leot Exp $
+
+Backport upstream commit 79c69ba194db0e4ddfb4ff985bc51c3b14ac8dd3.
+
+Fix segfault on open in new tabe from context menu #556.
+
+--- src/main.c.orig    2019-03-26 22:47:03.000000000 +0000
++++ src/main.c
+@@ -1347,17 +1347,22 @@ static void on_webview_load_changed(WebK
+         WebKitLoadEvent event, Client *c)
+ {
+     GTlsCertificateFlags tlsflags;
++    const char *raw_uri;
+     char *uri = NULL;
+ 
++    raw_uri = webkit_web_view_get_uri(webview);
++    if (raw_uri) {
++        uri = util_sanitize_uri(raw_uri);
++    }
++
+     switch (event) {
+         case WEBKIT_LOAD_STARTED:
+ #ifdef FEATURE_AUTOCMD
+-            autocmd_run(c, AU_LOAD_STARTED, webkit_web_view_get_uri(webview), NULL);
++            autocmd_run(c, AU_LOAD_STARTED, raw_uri, NULL);
+ #endif
+             /* update load progress in statusbar */
+             c->state.progress = 0;
+             vb_statusbar_update(c);
+-            uri = util_sanitize_uri(webkit_web_view_get_uri(webview));
+             set_title(c, uri);
+             /* Make sure hinting is cleared before the new page is loaded.
+              * Without that vimb would still be in hinting mode after hinting
+@@ -1379,10 +1384,9 @@ static void on_webview_load_changed(WebK
+              * right place to remove the flag. */
+             c->mode->flags &= ~FLAG_IGNORE_FOCUS;
+ #ifdef FEATURE_AUTOCMD
+-            autocmd_run(c, AU_LOAD_COMMITTED, webkit_web_view_get_uri(webview), NULL);
++            autocmd_run(c, AU_LOAD_COMMITTED, raw_uri, NULL);
+ #endif
+             /* save the current URI in register % */
+-            uri = util_sanitize_uri(webkit_web_view_get_uri(webview));
+             vb_register_add(c, '%', uri);
+             /* check if tls is on and the page is trusted */
+             if (g_str_has_prefix(uri, "https://";)) {
+@@ -1405,9 +1409,8 @@ static void on_webview_load_changed(WebK
+             break;
+ 
+         case WEBKIT_LOAD_FINISHED:
+-            uri = util_sanitize_uri(webkit_web_view_get_uri(webview));
+ #ifdef FEATURE_AUTOCMD
+-            autocmd_run(c, AU_LOAD_FINISHED, webkit_web_view_get_uri(webview), NULL);
++            autocmd_run(c, AU_LOAD_FINISHED, raw_uri, NULL);
+ #endif
+             c->state.progress = 100;
+             if (strncmp(uri, "about:", 6)) {
diff -r 84931e7f1980 -r 8053d5ffaa6e www/vimb/patches/patch-src_util.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/vimb/patches/patch-src_util.c Sun May 26 20:25:13 2019 +0000
@@ -0,0 +1,27 @@
+$NetBSD: patch-src_util.c,v 1.1 2019/05/26 20:25:13 leot Exp $
+
+Backport upstream commit 79c69ba194db0e4ddfb4ff985bc51c3b14ac8dd3.
+
+Fix segfault on open in new tabe from context menu #556.
+
+--- src/util.c.orig    2019-03-26 22:47:03.000000000 +0000
++++ src/util.c
+@@ -821,7 +821,7 @@ char *util_sanitize_filename(char *filen
+ /**
+  * Strips password from a uri.
+  *
+- * Return newly allocated string.
++ * Return newly allocated string or NULL.
+  */
+ char *util_sanitize_uri(const char *uri_str)
+ {
+@@ -829,6 +829,9 @@ char *util_sanitize_uri(const char *uri_
+     char *sanitized_uri;
+     char *for_display;
+ 
++    if (!uri_str) {
++        return NULL;
++    }
+ #if WEBKIT_CHECK_VERSION(2, 24, 0)
+     for_display = webkit_uri_for_display(uri_str);
+ #else



Home | Main Index | Thread Index | Old Index