diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-26 13:04:50 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-26 13:04:50 +0100 |
commit | c9f14aba4d6c263deee8fb17615db80a63f6be55 (patch) | |
tree | 1b82b47cca5084c3c8d1b778c2907db445bfe2fd /src/libutil/http.c | |
parent | 08bb2e8e8c39dbaa9bce29a227eb875f5999c941 (diff) | |
download | rspamd-c9f14aba4d6c263deee8fb17615db80a63f6be55.tar.gz rspamd-c9f14aba4d6c263deee8fb17615db80a63f6be55.zip |
[Feature] Deal with unnormalised Unicode obfuscation
Diffstat (limited to 'src/libutil/http.c')
-rw-r--r-- | src/libutil/http.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libutil/http.c b/src/libutil/http.c index 5732f8b8e..c6b77ee15 100644 --- a/src/libutil/http.c +++ b/src/libutil/http.c @@ -3252,12 +3252,14 @@ rspamd_http_router_finish_handler (struct rspamd_http_connection *conn, http_parser_parse_url (msg->url->str, msg->url->len, TRUE, &u); if (u.field_set & (1 << UF_PATH)) { + guint unnorm_len; lookup.begin = msg->url->str + u.field_data[UF_PATH].off; lookup.len = u.field_data[UF_PATH].len; rspamd_http_normalize_path_inplace ((gchar *)lookup.begin, lookup.len, - &lookup.len); + &unnorm_len); + lookup.len = unnorm_len; } else { lookup.begin = msg->url->str; @@ -3712,7 +3714,7 @@ rspamd_http_message_unref (struct rspamd_http_message *msg) void -rspamd_http_normalize_path_inplace (gchar *path, gsize len, gsize *nlen) +rspamd_http_normalize_path_inplace (gchar *path, guint len, guint *nlen) { const gchar *p, *end, *slash = NULL, *dot = NULL; gchar *o; |