summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-01-14 12:19:35 +0100
committerdefault <nobody@localhost>2024-01-14 12:19:35 +0100
commit7ca08aebd245dc7116113bae97e31881fcc09eb0 (patch)
tree206997fd305c5a56cf7456b6090e3dabdcd1c2fb /data.c
parentd02116297883d2ff15d7ea58810e915a956a6928 (diff)
Fixed crashes in command-line options.
Diffstat (limited to 'data.c')
-rw-r--r--data.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/data.c b/data.c
index 97cd94f..b71436e 100644
--- a/data.c
+++ b/data.c
@@ -1508,6 +1508,13 @@ int actor_get(const char *actor, xs_dict **data)
return status;
}
+ /* if the object is corrupted, discard it */
+ if (xs_is_null(xs_dict_get(d, "id")) || xs_is_null(xs_dict_get(d, "type"))) {
+ srv_debug(1, xs_fmt("corrupted actor object %s", actor));
+ d = xs_free(d);
+ return 404;
+ }
+
if (data)
*data = d;
else
@@ -2169,7 +2176,7 @@ void enqueue_output_raw(const char *keyid, const char *seckey,
qmsg = xs_dict_append(qmsg, "seckey", seckey);
/* if it's to be sent right now, bypass the disk queue and post the job */
- if (retries == 0)
+ if (retries == 0 && p_state != NULL)
job_post(qmsg, 0);
else {
qmsg = _enqueue_put(fn, qmsg);