commit b19b760: [Minor] Fix OOB access

Vsevolod Stakhov vsevolod at highsecure.ru
Thu May 2 09:49:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-05-02 10:38:53 +0100
URL: https://github.com/rspamd/rspamd/commit/b19b76020f2b1b97d3eef47f174acab616a0584a

[Minor] Fix OOB access

---
 src/libserver/url.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/libserver/url.c b/src/libserver/url.c
index 96e3118eb..0ec256902 100644
--- a/src/libserver/url.c
+++ b/src/libserver/url.c
@@ -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://");


More information about the Commits mailing list