From 1094cced952ce0565dde55c75f318124d0f84f3e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 20 Jul 2009 20:02:43 +0400 Subject: [PATCH] * Use g_ascii_isalnum for more strict decoding * Keep undecoded entitles undecoded * Fix log message --- src/html.c | 7 ++++--- 1 file 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; -- 2.39.5