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

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