From 317d9bf846b915309e512bd5653e29018c5046e4 Mon Sep 17 00:00:00 2001 From: Sukchan Lee Date: Sun, 24 Sep 2023 09:17:42 +0900 Subject: [PATCH] [SBI] crash when queryparam with empty key (#2626) Fixed crashes when path contains query parameter with an empty key --- lib/sbi/nghttp2-server.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/sbi/nghttp2-server.c b/lib/sbi/nghttp2-server.c index b1f004546..44f3242ff 100644 --- a/lib/sbi/nghttp2-server.c +++ b/lib/sbi/nghttp2-server.c @@ -1295,8 +1295,12 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame, j = 0; while(params[j].key && params[j].val) { - ogs_sbi_header_set(request->http.params, - params[j].key, params[j].val); + if (strlen(params[j].key)) + ogs_sbi_header_set(request->http.params, + params[j].key, params[j].val); + else + ogs_warn("No KEY in Query-Parms"); + j++; }