From d0321aa92fcc7c80a3ea0d65f7ef96ff21aa0535 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 13 Dec 2016 11:03:31 +0000 Subject: [PATCH] [Minor] Fix cast --- src/libserver/html.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libserver/html.c b/src/libserver/html.c index fb2a8a477..3fb24c22e 100644 --- a/src/libserver/html.c +++ b/src/libserver/html.c @@ -1267,7 +1267,7 @@ rspamd_html_process_url (rspamd_mempool_t *pool, const gchar *start, guint len, dlen = 0; for (i = 0; i < len; i ++) { - if (G_UNLIKELY (!g_ascii_isgraph (s[i]))) { + if (G_UNLIKELY (((guint)s[i]) < 0x80 && !g_ascii_isgraph (s[i]))) { dlen += 3; } else { @@ -1283,7 +1283,7 @@ rspamd_html_process_url (rspamd_mempool_t *pool, const gchar *start, guint len, if (G_UNLIKELY (s[i] == '\r' || s[i] == '\n')) { continue; } - else if (G_UNLIKELY (s[i] < 0x80 && !g_ascii_isgraph (s[i]))) { + else if (G_UNLIKELY (((guint)s[i]) < 0x80 && !g_ascii_isgraph (s[i]))) { /* URL encode */ *d++ = '%'; *d++ = hexdigests[(s[i] >> 4) & 0xf]; -- 2.39.5