Package: links2
Version: 2.18
Severity: important
Tags: fixed-upstream upstream patch
Control: submitter -1 Mikulas Patocka <miku...@twibright.com>

I just received the attached mail from upstream with a patch that
fixes a crash on an invalid IDN URL.

I intent to fix this in Debian Sid/Buster with applying the functional
part of the patch (but probably not the changelog part) against 2.18-1
and uploading 2.19 to Debian Experimental until Buster is released.

                Regards, Axel
-- 
 ,''`.  |  Axel Beckert <a...@debian.org>, https://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-    |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE
--- Begin Message ---
Hi

I submit this patch for links-2.18 in Debian Buster. It fixes a crash on 
invalid IDN URL.

For Debian Sid, you can upgrade to links-2.19.

Mikulas



commit 9dc711da9b61431f83f863920583d4c9d3bea26d
Author: Mikulas Patocka <miku...@twibright.com>
Date:   Sat Mar 30 22:36:43 2019 +0100

    fix a crash on invalid idn url

diff --git a/ChangeLog b/ChangeLog
index 92736b50..4ea09306 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Mar 30 21:56:02 CET 2019 mikulas:
+
+       Fixed a crash on invalid IDN URL, such as http://test,ï.com/
+       (found by lsxv...@gmail.com)
+
 Tue Mar 12 23:02:33 CET 2019 mikulas:
 
        Make it possible to select other fonts, using fontconfig and freetype
diff --git a/url.c b/url.c
index e6252d70..8dc34d47 100644
--- a/url.c
+++ b/url.c
@@ -1153,6 +1153,8 @@ static unsigned char *display_url_or_host(struct terminal 
*term, unsigned char *
                url_enc = idn_encode_url(url_conv2, 0);
        else
                url_enc = idn_encode_host(url_conv2, 
(int)strlen(cast_const_char url_conv2), separator, 0);
+       if (!url_enc)
+               url_enc = stracpy(url_conv2), is_idn = 1;
        mem_free(url_conv2);
        if (!strcmp(cast_const_char url_enc, cast_const_char url)) {
                if (is_idn && warn_idn) {

--- End Message ---

Attachment: signature.asc
Description: Digital signature

Reply via email to