mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
coverity: 2021-12-1 uplevel fixes
This commit is contained in:
parent
843ee10205
commit
946b1fbff1
3 changed files with 16 additions and 8 deletions
|
@ -209,9 +209,12 @@ lws_cose_sign_payload_chunk(struct lws_cose_sign_context *csc,
|
|||
|
||||
lws_lec_init(&lec, lbuf, sizeof(lbuf));
|
||||
|
||||
/* we know it will fit */
|
||||
lws_lec_printf(&lec, "{1:%lld}",
|
||||
/* we know it will fit... but coverity doesn't */
|
||||
ret = lws_lec_printf(&lec, "{1:%lld}",
|
||||
(long long)alg->cose_alg);
|
||||
if (ret != LWS_LECPCTX_RET_FINISHED)
|
||||
return ret;
|
||||
|
||||
lws_lec_scratch(&lec);
|
||||
|
||||
if (!csc->subsequent) {
|
||||
|
@ -293,9 +296,11 @@ lws_cose_sign_payload_chunk(struct lws_cose_sign_context *csc,
|
|||
|
||||
lws_lec_init(&lec, lbuf, sizeof(lbuf));
|
||||
|
||||
/* we know it will fit */
|
||||
lws_lec_printf(&lec, "{1:%lld}",
|
||||
/* we know it will fit... but coverity doesn't... */
|
||||
ret = lws_lec_printf(&lec, "{1:%lld}",
|
||||
(long long)alg->cose_alg);
|
||||
if (ret != LWS_LECPCTX_RET_FINISHED)
|
||||
return ret;
|
||||
|
||||
lws_lec_init(&lec1, lb, sizeof(lb));
|
||||
lws_lec_int(&lec1, LWS_CBOR_MAJTYP_BSTR, 0,
|
||||
|
@ -454,8 +459,10 @@ inner_protected:
|
|||
lws_lec_init(&lec1, lb, sizeof(lb));
|
||||
lws_lec_int(&lec1, LWS_CBOR_MAJTYP_BSTR, 0,
|
||||
lec.used);
|
||||
lws_lec_printf(csc->info.lec, "{1:%lld}",
|
||||
(long long)csc->alg->cose_alg);
|
||||
if (lws_lec_printf(csc->info.lec, "{1:%lld}",
|
||||
(long long)csc->alg->cose_alg) != LWS_LECPCTX_RET_FINISHED)
|
||||
/* coverity */
|
||||
return 0;
|
||||
break;
|
||||
default:
|
||||
lec.used = 0;
|
||||
|
|
|
@ -183,9 +183,10 @@ lws_plat_init(struct lws_context *context,
|
|||
{
|
||||
char *klf_env = getenv("SSLKEYLOGFILE");
|
||||
|
||||
if (klf_env)
|
||||
if (klf_env && strlen(klf_env) && strlen(klf_env) < sizeof(context->keylog_file)) {
|
||||
lws_strncpy(context->keylog_file, klf_env,
|
||||
sizeof(context->keylog_file));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -2013,7 +2013,7 @@ lws_callback_raw_sshd(struct lws *wsi, enum lws_callback_reasons reason,
|
|||
const struct lws_protocol_vhost_options *pvo;
|
||||
const struct lws_protocols *prot;
|
||||
struct lws_ssh_channel *ch;
|
||||
char lang[10];
|
||||
char lang[10] = "";
|
||||
int n, m, o;
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Reference in a new issue