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

coverity: 2019.03 fixes

This commit is contained in:
Andy Green 2019-07-01 06:39:55 +01:00
parent 75ef709ff7
commit e4ec282987
2 changed files with 6 additions and 5 deletions

View file

@ -694,7 +694,7 @@ lws_create_vhost(struct lws_context *context,
{
#ifdef LWS_HAVE_GETENV
p = getenv("http_proxy");
if (p)
if (p && strlen(p) > 0 && strlen(p) < 95)
lws_set_proxy(vh, p);
#endif
}
@ -709,7 +709,7 @@ lws_create_vhost(struct lws_context *context,
} else {
#ifdef LWS_HAVE_GETENV
p = getenv("socks_proxy");
if (p)
if (p && strlen(p) > 0 && strlen(p) < 95)
lws_set_socks(vh, p);
#endif
}

View file

@ -280,9 +280,10 @@ socks_reply_fail:
}
pt->serv_buf[13] = '\0';
if (strcmp(sb, "HTTP/1.0 200 ") &&
strcmp(sb, "HTTP/1.1 200 ")) {
lwsl_err("ERROR proxy: %s\n", sb);
if (strncmp(sb, "HTTP/1.0 200 ", 13) &&
strncmp(sb, "HTTP/1.1 200 ", 13)) {
lwsl_err("%s: ERROR proxy did not reply with h1\n",
__func__);
goto bail3;
}