From 6b09e5f8f748db3e32755ca3af5230e7efee9c6c Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 18 Aug 2020 11:37:54 +0100 Subject: [PATCH] coverity: 62313: static blob cant be null but coverity needs convincing --- lib/core/context.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/core/context.c b/lib/core/context.c index 6f1b78682..90988d6f1 100644 --- a/lib/core/context.c +++ b/lib/core/context.c @@ -113,6 +113,9 @@ lws_state_notify_protocol_init(struct lws_state_manager *mgr, { struct lws_context *context = lws_container_of(mgr, struct lws_context, mgr_system); +#if defined(LWS_WITH_SECURE_STREAMS) && defined(LWS_WITH_SECURE_STREAMS_SYS_AUTH_API_AMAZON_COM) + lws_system_blob_t *ab0, *ab1; +#endif int n; /* @@ -150,14 +153,14 @@ lws_state_notify_protocol_init(struct lws_state_manager *mgr, * * If root token is empty, skip too. */ + + ab0 = lws_system_get_blob(context, LWS_SYSBLOB_TYPE_AUTH, 0); + ab1 = lws_system_get_blob(context, LWS_SYSBLOB_TYPE_AUTH, 1); + if (target == LWS_SYSTATE_AUTH1 && - context->pss_policies && - !lws_system_blob_get_size(lws_system_get_blob(context, - LWS_SYSBLOB_TYPE_AUTH, - 0)) && - lws_system_blob_get_size(lws_system_get_blob(context, - LWS_SYSBLOB_TYPE_AUTH, - 1))) { + context->pss_policies && ab0 && ab1 && + !lws_system_blob_get_size(ab0) && + lws_system_blob_get_size(ab1)) { lwsl_info("%s: AUTH1 state triggering api.amazon.com auth\n", __func__); /* * Start trying to acquire it if it's not already in progress