aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/html.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-22 12:42:27 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-22 12:42:27 +0100
commit2779085c6126b86ea770c5a9c6c0b8c06da55bd8 (patch)
tree62f364139c142cead69167ddcd80cdc2871224c3 /src/libserver/html.c
parent3311477ebbd8e5457cbb2b75dec67cf58727acf6 (diff)
downloadrspamd-2779085c6126b86ea770c5a9c6c0b8c06da55bd8.tar.gz
rspamd-2779085c6126b86ea770c5a9c6c0b8c06da55bd8.zip
[Minor] Ignore unknown font sizes for now
Diffstat (limited to 'src/libserver/html.c')
-rw-r--r--src/libserver/html.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/libserver/html.c b/src/libserver/html.c
index d41ae78d9..85602aec5 100644
--- a/src/libserver/html.c
+++ b/src/libserver/html.c
@@ -2077,12 +2077,20 @@ rspamd_html_process_font_size (const gchar *line, guint len, guint *fs,
len --;
}
- rspamd_strlcpy (numbuf, p, MIN (sizeof (numbuf), len + 1));
- sz = strtod (numbuf, &err);
+ if (g_ascii_isdigit (*p)) {
+ rspamd_strlcpy (numbuf, p, MIN (sizeof (numbuf), len + 1));
+ sz = strtod (numbuf, &err);
- /* Now check leftover */
- if (sz < 0) {
- sz = 0;
+ /* Now check leftover */
+ if (sz < 0) {
+ sz = 0;
+ }
+ }
+ else {
+ /* Ignore the rest */
+ failsafe = TRUE;
+ sz = is_css ? 16 : 1;
+ /* TODO: add textual fonts descriptions */
}
if (err && *err != '\0') {