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

COVA12046: make it clear the strdup target cannot be NULL

This commit is contained in:
Andy Green 2019-07-13 11:57:21 -07:00
parent e07d6986ab
commit cd56a4b97f
2 changed files with 8 additions and 5 deletions

View file

@ -349,10 +349,12 @@ create_new_conn:
if (!wsi->cli_hostname_copy) {
if (wsi->stash)
wsi->cli_hostname_copy = lws_strdup(wsi->stash->host);
else
wsi->cli_hostname_copy =
lws_strdup(lws_hdr_simple_ptr(wsi,
_WSI_TOKEN_CLIENT_PEER_ADDRESS));
else {
char *pa = lws_hdr_simple_ptr(wsi,
_WSI_TOKEN_CLIENT_PEER_ADDRESS);
if (pa)
wsi->cli_hostname_copy = lws_strdup(pa);
}
}
/*

View file

@ -352,7 +352,8 @@ retry_as_first:
if (!s->temp[0]) {
if (s->mp < (int)sizeof(s->content_disp) - 1)
s->content_disp[s->mp++] = *in;
s->content_disp[s->mp] = '\0';
if (s->mp < (int)sizeof(s->content_disp))
s->content_disp[s->mp] = '\0';
goto done;
}