diff options
author | default <nobody@localhost> | 2024-08-24 14:36:19 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2024-08-24 14:36:19 +0200 |
commit | 60e907219b38caba051bccf8e99c9a30365e6d79 (patch) | |
tree | b1ccca18960ff10d0dc765c6e41e2498cc2f9c31 /html.c | |
parent | e6483368d017d3c9e8918314e97446127a8dc3b1 (diff) |
Archive and try to avoid crashing on unexpected 'content' field data type.
Diffstat (limited to 'html.c')
-rw-r--r-- | html.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1692,7 +1692,14 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, /** build the content string **/ const char *content = xs_dict_get(msg, "content"); - xs *c = sanitize(xs_is_null(content) ? "" : content); + if (xs_type(content) != XSTYPE_STRING) { + srv_archive_error("unexpected_content_xstype", + "content field type", xs_stock(XSTYPE_DICT), msg); + + content = ""; + } + + xs *c = sanitize(content); /* do some tweaks to the content */ c = xs_replace_i(c, "\r", ""); |