diff options
author | Daniel Carl <danielcarl@gmx.de> | 2019-05-20 23:53:59 +0200 |
---|---|---|
committer | Daniel Carl <danielcarl@gmx.de> | 2019-05-20 23:53:59 +0200 |
commit | 333496479192bd995b5dce0384c080c2915c3b20 (patch) | |
tree | 9c4885996ef495c43f5b4a8ff2266aea8987eed2 /src/util.c | |
parent | 3c00e1c8c05d91df5b8dea894107a3e28a0382f8 (diff) |
Avoid double free in on_webview_notify_uri #561.
Thank to Valérian Rousset for pointing this out. Also change the
until_sanitize_uri function to return given uri in case an error occurred
during sanitization process to reduce cases where this function returns
NULL.
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -834,12 +834,12 @@ char *util_sanitize_uri(const char *uri_str) } #if WEBKIT_CHECK_VERSION(2, 24, 0) for_display = webkit_uri_for_display(uri_str); + if (!for_display) { + for_display = g_strdup(uri_str); + } #else for_display = g_strdup(uri_str); #endif - if (!for_display) { - return NULL; - } /* Sanitize the uri only in case there is a @ which might be the indicator * for credentials used in uri. */ |