]> source.dussan.org Git - rspamd.git/commitdiff
* Use g_ascii_isalnum for more strict decoding
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 20 Jul 2009 16:02:43 +0000 (20:02 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 20 Jul 2009 16:02:43 +0000 (20:02 +0400)
* Keep undecoded entitles undecoded
* Fix log message

src/html.c

index 84db67d80beb2586b4a71c52cf77b9c40bcf33c6..363512df1185533f0f99bc663dfdd55143ef094b 100644 (file)
@@ -286,9 +286,10 @@ decode_entitles (char *s)
                        case 1:
                                if (*h == ';') {
                                        val = strtoul ((t + 2), &end_ptr, 10);
-                                       if ((end_ptr != NULL && *end_ptr != ';') || val < 0 || val > 128) {
-                                               msg_info ("decode_entitles: invalid entitle code, cannot convert, %d", val);
-                                               *t = 'U';
+                                       if ((end_ptr != NULL && *end_ptr != ';') || !g_ascii_isalnum ((char)val)) {
+                                               msg_info ("decode_entitles: invalid entitle code, cannot convert, strtoul returned %d", val);
+                                               /* Skip undecoded */
+                                               t = h;
                                        }
                                        else {
                                                *t = (char)val;