summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn M. Schanck <jschanck@mozilla.com>2023-04-13 17:43:46 +0000
committerJohn M. Schanck <jschanck@mozilla.com>2023-04-13 17:43:46 +0000
commitaf6cccfbf3d14f62f86e322ea56b4c3a4e3fd5df (patch)
tree9847d5ff6f84a7989ca92212a156654544b10be7
parentf694311423e42fc581d59cb1f9184ed93e918a2d (diff)
downloadnss-hg-af6cccfbf3d14f62f86e322ea56b4c3a4e3fd5df.tar.gz
Bug 1826650 - cmd/ecperf: fix dangling pointer warning on gcc 13. r=djackson
Differential Revision: https://phabricator.services.mozilla.com/D174822
-rw-r--r--cmd/ecperf/ecperf.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmd/ecperf/ecperf.c b/cmd/ecperf/ecperf.c
index 705d68f35..a07004d8e 100644
--- a/cmd/ecperf/ecperf.c
+++ b/cmd/ecperf/ecperf.c
@@ -53,6 +53,7 @@ PKCS11Thread(void *data)
SECItem sig;
CK_SESSION_HANDLE session;
CK_RV crv;
+ void *tmp = NULL;
threadData->status = SECSuccess;
threadData->count = 0;
@@ -68,6 +69,7 @@ PKCS11Thread(void *data)
if (threadData->isSign) {
sig.data = sigData;
sig.len = sizeof(sigData);
+ tmp = threadData->p2;
threadData->p2 = (void *)&sig;
}
@@ -79,6 +81,10 @@ PKCS11Thread(void *data)
}
threadData->count++;
}
+
+ if (threadData->isSign) {
+ threadData->p2 = tmp;
+ }
return;
}
@@ -89,6 +95,7 @@ genericThread(void *data)
int iters = threadData->iters;
unsigned char sigData[256];
SECItem sig;
+ void *tmp = NULL;
threadData->status = SECSuccess;
threadData->count = 0;
@@ -96,6 +103,7 @@ genericThread(void *data)
if (threadData->isSign) {
sig.data = sigData;
sig.len = sizeof(sigData);
+ tmp = threadData->p2;
threadData->p2 = (void *)&sig;
}
@@ -107,6 +115,10 @@ genericThread(void *data)
}
threadData->count++;
}
+
+ if (threadData->isSign) {
+ threadData->p2 = tmp;
+ }
return;
}