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:
parent
acf42bec9d
commit
80ea883796
1 changed files with 3 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue