Blame SOURCES/0040-Address-an-include-issue-discovered-by-coverity.patch

a223c4
From c9c326e1878a377ce4193aaa4b1b41cb711b5e48 Mon Sep 17 00:00:00 2001
a223c4
From: Rob Crittenden <rcritten@redhat.com>
a223c4
Date: Thu, 30 Apr 2020 12:46:41 -0400
a223c4
Subject: [PATCH] Address an include issue discovered by coverity
a223c4
a223c4
nspr.h isn't included so use PORT_ErrorToString() instead
a223c4
of PR_ErrorToString(), and remain consistent with the
a223c4
other PORT calls even though they directly translate
a223c4
to their NSPR equivalents.
a223c4
a223c4
Also remove a couple of unused variables in pkcs7.c
a223c4
---
a223c4
 src/pkcs7.c | 8 +++++---
a223c4
 1 file changed, 5 insertions(+), 3 deletions(-)
a223c4
a223c4
diff --git a/src/pkcs7.c b/src/pkcs7.c
a223c4
index f81174f..a569256 100644
a223c4
--- a/src/pkcs7.c
a223c4
+++ b/src/pkcs7.c
a223c4
@@ -57,6 +57,9 @@
a223c4
 #define _(_text) (_text)
a223c4
 #endif
a223c4
 
a223c4
+/* taken from nspr4.h */
a223c4
+#define PR_LANGUAGE_I_DEFAULT 0 /* i-default, the default language */
a223c4
+
a223c4
 /* Return 0 if we think "issuer" could have issued "issued", which includes
a223c4
  * self-signing. */
a223c4
 static int
a223c4
@@ -289,7 +292,7 @@ log_pkcs7_errors(int level, char *msg)
a223c4
     }
a223c4
 	nss_err = PORT_GetError();
a223c4
     if (nss_err < 0) {
a223c4
-		cm_log(level, "%d: %s\n", nss_err, PR_ErrorToString(nss_err, 0));
a223c4
+		cm_log(level, "%d: %s\n", nss_err, PORT_ErrorToString(nss_err));
a223c4
 	}
a223c4
 }
a223c4
 
a223c4
@@ -929,9 +932,8 @@ cm_pkcs7_verify_signed(unsigned char *data, size_t length,
a223c4
 	PKCS7_SIGNER_INFO *si;
a223c4
 	BIO *in, *out = NULL;
a223c4
 	const unsigned char *u;
a223c4
-	char *s, buf[LINE_MAX], *p, *q;
a223c4
+	char *s, *p, *q;
a223c4
 	int ret = -1, i;
a223c4
-	long error;
a223c4
 
a223c4
 	if (digest != NULL) {
a223c4
 		*digest = NULL;
a223c4
-- 
a223c4
2.21.1
a223c4