Blob Blame Raw
From c9c326e1878a377ce4193aaa4b1b41cb711b5e48 Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcritten@redhat.com>
Date: Thu, 30 Apr 2020 12:46:41 -0400
Subject: [PATCH] Address an include issue discovered by coverity

nspr.h isn't included so use PORT_ErrorToString() instead
of PR_ErrorToString(), and remain consistent with the
other PORT calls even though they directly translate
to their NSPR equivalents.

Also remove a couple of unused variables in pkcs7.c
---
 src/pkcs7.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/pkcs7.c b/src/pkcs7.c
index f81174f..a569256 100644
--- a/src/pkcs7.c
+++ b/src/pkcs7.c
@@ -57,6 +57,9 @@
 #define _(_text) (_text)
 #endif
 
+/* taken from nspr4.h */
+#define PR_LANGUAGE_I_DEFAULT 0 /* i-default, the default language */
+
 /* Return 0 if we think "issuer" could have issued "issued", which includes
  * self-signing. */
 static int
@@ -289,7 +292,7 @@ log_pkcs7_errors(int level, char *msg)
     }
 	nss_err = PORT_GetError();
     if (nss_err < 0) {
-		cm_log(level, "%d: %s\n", nss_err, PR_ErrorToString(nss_err, 0));
+		cm_log(level, "%d: %s\n", nss_err, PORT_ErrorToString(nss_err));
 	}
 }
 
@@ -929,9 +932,8 @@ cm_pkcs7_verify_signed(unsigned char *data, size_t length,
 	PKCS7_SIGNER_INFO *si;
 	BIO *in, *out = NULL;
 	const unsigned char *u;
-	char *s, buf[LINE_MAX], *p, *q;
+	char *s, *p, *q;
 	int ret = -1, i;
-	long error;
 
 	if (digest != NULL) {
 		*digest = NULL;
-- 
2.21.1