From a2f18ae0234bc6dbccaebd21bc7ea07ceac2ee7a Mon Sep 17 00:00:00 2001 From: Jesper Jensen Date: Mon, 14 Apr 2025 13:06:26 +0200 Subject: Don't crash on invalid dictionary --- src/query.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/query.c') diff --git a/src/query.c b/src/query.c index f0b9014..2276ac1 100644 --- a/src/query.c +++ b/src/query.c @@ -64,7 +64,8 @@ int handle_request(struct nodeid* self, struct tokens *tokens, time_t now, const bcur_next(&bcursor, 1); break; case -BENC_EBADP: - fatal("Bad dict"); + err("Bad query: Bad Dictionary"); + return QUERY_EBADQ; } } @@ -135,7 +136,8 @@ int handle_request(struct nodeid* self, struct tokens *tokens, time_t now, const bcur_next(&bcursor, 1); break; case -BENC_EBADP: - fatal("Bad dict"); + err("Bad query: Bad Dictionary"); + return QUERY_EBADQ; } } @@ -233,7 +235,8 @@ int handle_request(struct nodeid* self, struct tokens *tokens, time_t now, const bcur_next(&bcursor, 1); break; case -BENC_EBADP: - fatal("Bad dict"); + err("Bad query: Bad Dictionary"); + return QUERY_EBADQ; } } @@ -443,7 +446,8 @@ int handle_request(struct nodeid* self, struct tokens *tokens, time_t now, const bcur_next(&bcursor, 1); break; case -BENC_EBADP: - fatal("Bad dict"); + err("Bad query: Bad Dictionary"); + return QUERY_EBADQ; } } -- cgit v1.2.3