From adf5623044f7dcd84edb8345595a1bda651e5cbb Mon Sep 17 00:00:00 2001 From: default Date: Thu, 11 Jan 2024 20:20:01 +0100 Subject: [PATCH] Avoid invalid actors in mastoapi_status(). --- mastoapi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mastoapi.c b/mastoapi.c index a1b2c26..d8f6ccc 100644 --- a/mastoapi.c +++ b/mastoapi.c @@ -706,6 +706,10 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg) const char *type = xs_dict_get(msg, "type"); const char *id = xs_dict_get(msg, "id"); + /* fail if it's not a valid actor */ + if (xs_is_null(type) || xs_is_null(id)) + return NULL; + xs *acct = mastoapi_account(actor); xs *idx = NULL;