Skip to content

Commit 1f7bcea

Browse files
committed
Do not abort with a critical warning when no query is used
It's also worth noting that the "crash on anything looking weird" is 100% deliberate -- i.e. we're doing `G_DEBUG=fatal-criticals` so that any critical warning causes an instant "crash" -- on the logic a dead daemon is better than a buffer or stack overflow. Fixes #25
1 parent 59c73a8 commit 1f7bcea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/passim-server.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,10 @@ passim_server_handler_cb(SoupServer *server,
755755
}
756756

757757
/* find the request hash argument */
758+
if (g_uri_get_query(uri) == NULL) {
759+
passim_server_msg_send_error(self, msg, SOUP_STATUS_BAD_REQUEST, NULL);
760+
return;
761+
}
758762
request = g_strsplit(g_uri_get_query(uri), "&", -1);
759763
for (guint i = 0; request[i] != NULL; i++) {
760764
g_auto(GStrv) kv = g_strsplit(request[i], "=", -1);

0 commit comments

Comments
 (0)