Blame SOURCES/wget-1.19.5-CVE-2019-5953.patch

aa6d84
diff --git a/src/iri.c b/src/iri.c
aa6d84
index 7dcf3ac..1c8695c 100644
aa6d84
--- a/src/iri.c
aa6d84
+++ b/src/iri.c
aa6d84
@@ -189,9 +189,10 @@ do_conversion (const char *tocode, const char *fromcode, char const *in_org, siz
aa6d84
         {
aa6d84
           tooshort++;
aa6d84
           done = len;
aa6d84
-          len = outlen = done + inlen * 2;
aa6d84
-          s = xrealloc (s, outlen + 1);
aa6d84
-          *out = s + done;
aa6d84
+          len = done + inlen * 2;
aa6d84
+          s = xrealloc (s, len + 1);
aa6d84
+          *out = s + done - outlen;
aa6d84
+          outlen += inlen * 2;
aa6d84
         }
aa6d84
       else /* Weird, we got an unspecified error */
aa6d84
         {