]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix OOB access
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 2 May 2019 09:38:53 +0000 (10:38 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 2 May 2019 09:38:53 +0000 (10:38 +0100)
src/libserver/url.c

index 96e3118eb16e5b60e5c948e2d6c275bc579277ad..0ec25690211d5265567e7ea327ecc38b6182203a 100644 (file)
@@ -3439,10 +3439,10 @@ rspamd_url_encode (struct rspamd_url *url, gsize *pdlen,
        dend = d + dlen;
 
        if (url->protocollen > 0) {
+               const gchar *known_proto = rspamd_url_protocol_name (url->protocol);
                d += rspamd_snprintf ((gchar *) d, dend - d,
-                               "%*s://",
-                               url->protocollen,
-                               rspamd_url_protocol_name (url->protocol));
+                               "%s://",
+                               known_proto);
        }
        else {
                d += rspamd_snprintf ((gchar *) d, dend - d, "http://");