[OpenWrt-Devel] [PATCH ucert 7/9] fix possibly garbage value returned in cert_process_revoker

Petr Štetiar ynezz at true.cz
Thu Dec 19 17:04:19 EST 2019


Fixes following warning reported by clang-9 scan-build analyzer:

 ucert.c:585:2: warning: Undefined or garbage value returned to caller
        return ret;
        ^~~~~~~~~~

Signed-off-by: Petr Štetiar <ynezz at true.cz>
---
 ucert.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ucert.c b/ucert.c
index 8503eeb26cd8..b9c5c889ddfa 100644
--- a/ucert.c
+++ b/ucert.c
@@ -508,7 +508,7 @@ static int cert_process_revoker(const char *certfile, const char *pubkeydir) {
 	char *fingerprint;
 	char rfname[512];
 
-	int ret;
+	int ret = -1;
 
 	if (cert_load(certfile, &certchain)) {
 		DPRINTF("cannot parse cert\n");

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list