From 1dd88aa6f67beca1ea769f2545417f50531fa4ea Mon Sep 17 00:00:00 2001 From: default Date: Sun, 11 Jun 2023 20:03:42 +0200 Subject: [PATCH] Log malformed Likes from wafrn.net (who else?). --- activitypub.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/activitypub.c b/activitypub.c index 042835b..402d6a1 100644 --- a/activitypub.c +++ b/activitypub.c @@ -1479,6 +1479,12 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req) if (xs_type(object) == XSTYPE_DICT) object = xs_dict_get(object, "id"); + if (xs_type(object) != XSTYPE_STRING) { + snac_log(snac, xs_fmt("malformed 'Like' from %s", actor)); + srv_archive_error("malformed_message", "Bad 'Like'", req, msg); + return 1; + } + timeline_admire(snac, object, actor, 1); snac_log(snac, xs_fmt("new 'Like' %s %s", actor, object)); do_notify = 1;