From 82b9b3af389b70ed38963ca8d6e2aa9f69b16450 Mon Sep 17 00:00:00 2001 From: William Ahern Date: Thu, 23 Jun 2016 10:49:27 -0700 Subject: initialize attr to NULL in xr_setExtensionByNid to silence clang, which can't see that has_attrs indirectly assures at least one iteration of the for loop (in the single-threaded case, at least) --- src/openssl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/openssl.c b/src/openssl.c index f8c5047..6b74025 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -5516,6 +5516,7 @@ static int xr_setExtensionByNid(lua_State *L, X509_REQ *csr, int target_nid, voi // Delete the old extensions attribute, so that the one we just added takes priority if (has_attrs) { + attr = NULL; for (pnid = X509_REQ_get_extension_nids(); *pnid != NID_undef; pnid++) { idx = X509_REQ_get_attr_by_NID(csr, *pnid, -1); if (idx == -1) -- cgit v1.2.3-59-g8ed1b