diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-07-20 20:02:43 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-07-20 20:02:43 +0400 |
commit | 1094cced952ce0565dde55c75f318124d0f84f3e (patch) | |
tree | b112ec6ff840303c526680779490aaa04738bc85 /src/html.c | |
parent | 3499fefcd2a33d80d5f9400a161106a2bd1ff72f (diff) | |
download | rspamd-1094cced952ce0565dde55c75f318124d0f84f3e.tar.gz rspamd-1094cced952ce0565dde55c75f318124d0f84f3e.zip |
* Use g_ascii_isalnum for more strict decoding
* Keep undecoded entitles undecoded
* Fix log message
Diffstat (limited to 'src/html.c')
-rw-r--r-- | src/html.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/html.c b/src/html.c index 84db67d80..363512df1 100644 --- a/src/html.c +++ b/src/html.c @@ -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; |