]> source.dussan.org Git - rspamd.git/commitdiff
Remove quotes in HTTP query values
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 16 Oct 2015 14:13:35 +0000 (15:13 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 16 Oct 2015 14:13:35 +0000 (15:13 +0100)
src/libutil/http.c

index 72134e22d290192d18017c979696187b5b8daf0c..f6f08e3762ea67dd3ca746c20c0d727db7113284 100644 (file)
@@ -2466,6 +2466,15 @@ rspamd_http_message_parse_query (struct rspamd_http_message *msg)
                                                        value_tok->len = rspamd_decode_url (value->str,
                                                                        value->str,
                                                                        value->len);
+                                                       /* Detect quotes for value */
+                                                       if (value_tok->begin[0] == '"') {
+                                                               memmove (value->str, value->str + 1,
+                                                                               value_tok->len - 1);
+                                                               value_tok->len --;
+                                                       }
+                                                       if (value_tok->begin[value_tok->len - 1] == '"') {
+                                                               value_tok->len --;
+                                                       }
                                                }
                                                else {
                                                        value = rspamd_fstring_new_init ("", 0);