There are a lot of calls like this:
this->dispatcher->raise_event(this->dispatcher, "...", 0,
b->finalize(b));
However, if finalize() fails, e.g. because a previous call to add()
failed due to the size limit, it returns NULL. This then caused a
segmentation fault in raise_event() when it interacted with that value.
Closes strongswan/strongswan#1278
ck_assert(vici_register(conn, "test", event_cb, &count) == 0);
ck_assert(vici_register(conn, "nonexistent", event_cb, &count) != 0);
+ /* should just get ignored */
+ dispatcher->raise_event(dispatcher, "test", 0, NULL);
+
dispatcher->raise_event(dispatcher, "test", 0, vici_message_create_from_args(
VICI_KEY_VALUE, "key1", chunk_from_str("value1"),
VICI_END));
event_t *event;
u_int *current;
+ if (!message)
+ {
+ return;
+ }
+
this->mutex->lock(this->mutex);
event = this->events->get(this->events, name);
if (event)