1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00

coverity: 62550: back up assert with runtime NULL check

This commit is contained in:
Andy Green 2020-08-18 12:42:33 +01:00
parent acf42bec9d
commit 80ea883796

View file

@ -168,6 +168,9 @@ lws_apply_metadata(lws_ss_handle_t *h, struct lws *wsi, uint8_t *buf,
polmd = lws_ss_policy_metadata_index(h->policy, m);
assert(polmd);
if (!polmd)
return -1;
/* has to have a value */
if (polmd->value && ((uint8_t *)polmd->value)[0]) {
if (lws_add_http_header_by_name(wsi,