From e1ef23018738e8b72ad853671239ed40022bf1d9 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 4 Jun 2021 15:30:55 +0100 Subject: [PATCH] ss: h2: handle zero length COLON_PATH for metadata --- lib/secure-streams/protocols/ss-h1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/secure-streams/protocols/ss-h1.c b/lib/secure-streams/protocols/ss-h1.c index f6d51045d..b41d015bc 100644 --- a/lib/secure-streams/protocols/ss-h1.c +++ b/lib/secure-streams/protocols/ss-h1.c @@ -977,7 +977,7 @@ malformed: WSI_TOKEN_HTTP_COLON_METHOD), (unsigned int)m)) return -1; m = lws_hdr_total_length(wsi, WSI_TOKEN_HTTP_COLON_PATH); - if (lws_ss_alloc_set_metadata(h, "path", + if (m && lws_ss_alloc_set_metadata(h, "path", lws_hdr_simple_ptr(wsi, WSI_TOKEN_HTTP_COLON_PATH), (unsigned int)m)) return -1;