From c70c4bac89efb32850e7815f138914c296a4ab82 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 26 May 2021 14:07:00 +0100 Subject: [PATCH] coverity: ss: handle NULL omd --- lib/secure-streams/protocols/ss-h1.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/secure-streams/protocols/ss-h1.c b/lib/secure-streams/protocols/ss-h1.c index da982c7ad..f6d51045d 100644 --- a/lib/secure-streams/protocols/ss-h1.c +++ b/lib/secure-streams/protocols/ss-h1.c @@ -363,14 +363,16 @@ lws_extract_metadata(lws_ss_handle_t *h, struct lws *wsi) omd = lws_ss_get_handle_metadata(h, polmd->name); + if (omd) { - _lws_ss_set_metadata(omd, - polmd->name, p, (size_t)n); - omd->value_on_lws_heap = 1; + _lws_ss_set_metadata(omd, + polmd->name, p, (size_t)n); + omd->value_on_lws_heap = 1; #if defined(LWS_WITH_SECURE_STREAMS_PROXY_API) - omd->pending_onward = 1; + omd->pending_onward = 1; #endif + } } } #endif