diff options
author | default <nobody@localhost> | 2023-12-16 15:15:00 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2023-12-16 15:15:00 +0100 |
commit | 5736f38968e889ca5a0d6d828f47abe4f1f33193 (patch) | |
tree | 4e9a99f4d33bde56814281cf04c47a181c4176f8 /activitypub.c | |
parent | f703a34e3faaa590f131e4afbe698ddba13c8378 (diff) |
Added more code to discard Delete messages earlier.
Diffstat (limited to 'activitypub.c')
-rw-r--r-- | activitypub.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c index 1513be3..732aaac 100644 --- a/activitypub.c +++ b/activitypub.c @@ -1514,6 +1514,22 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req) srv_debug(1, xs_fmt("dropped 'Delete' message from unknown actor '%s'", actor)); return -1; } + + /* discard crap */ + if (xs_is_null(object)) { + srv_log(xs_fmt("dropped 'Delete' message with invalid object from actor '%s'", actor)); + return -1; + } + + /* also discard if the object to be deleted is not here */ + char *obj_id = object; + if (xs_type(obj_id) == XSTYPE_DICT) + obj_id = xs_dict_get(obj_id, "id"); + + if (object_here(obj_id)) { + srv_debug(1, xs_fmt("dropped 'Delete' message from unknown object '%s'", obj_id)); + return -1; + } } /* bring the actor */ |