mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
nss: fix build issue with gcc-13
https://phabricator.services.mozilla.com/D174822
cbf5a2bce7
Bug 1826650 - cmd/ecperf: fix dangling pointer warning on gcc 13. r=djackson
This commit is contained in:
parent
9f03381568
commit
5112b24b8f
@ -0,0 +1,77 @@
|
||||
diff --git a/nss/cmd/ecperf/ecperf.c b/nss/cmd/ecperf/ecperf.c
|
||||
--- a/nss/cmd/ecperf/ecperf.c
|
||||
+++ b/nss/cmd/ecperf/ecperf.c
|
||||
@@ -51,10 +51,11 @@
|
||||
int iters = threadData->iters;
|
||||
unsigned char sigData[256];
|
||||
SECItem sig;
|
||||
CK_SESSION_HANDLE session;
|
||||
CK_RV crv;
|
||||
+ void *tmp = NULL;
|
||||
|
||||
threadData->status = SECSuccess;
|
||||
threadData->count = 0;
|
||||
|
||||
/* get our thread's session */
|
||||
@@ -66,10 +67,11 @@
|
||||
}
|
||||
|
||||
if (threadData->isSign) {
|
||||
sig.data = sigData;
|
||||
sig.len = sizeof(sigData);
|
||||
+ tmp = threadData->p2;
|
||||
threadData->p2 = (void *)&sig;
|
||||
}
|
||||
|
||||
while (iters--) {
|
||||
threadData->status = (*op)(session, threadData->p1,
|
||||
@@ -77,27 +79,33 @@
|
||||
if (threadData->status != SECSuccess) {
|
||||
break;
|
||||
}
|
||||
threadData->count++;
|
||||
}
|
||||
+
|
||||
+ if (threadData->isSign) {
|
||||
+ threadData->p2 = tmp;
|
||||
+ }
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
genericThread(void *data)
|
||||
{
|
||||
ThreadData *threadData = (ThreadData *)data;
|
||||
int iters = threadData->iters;
|
||||
unsigned char sigData[256];
|
||||
SECItem sig;
|
||||
+ void *tmp = NULL;
|
||||
|
||||
threadData->status = SECSuccess;
|
||||
threadData->count = 0;
|
||||
|
||||
if (threadData->isSign) {
|
||||
sig.data = sigData;
|
||||
sig.len = sizeof(sigData);
|
||||
+ tmp = threadData->p2;
|
||||
threadData->p2 = (void *)&sig;
|
||||
}
|
||||
|
||||
while (iters--) {
|
||||
threadData->status = (*threadData->op)(threadData->p1,
|
||||
@@ -105,10 +113,14 @@
|
||||
if (threadData->status != SECSuccess) {
|
||||
break;
|
||||
}
|
||||
threadData->count++;
|
||||
}
|
||||
+
|
||||
+ if (threadData->isSign) {
|
||||
+ threadData->p2 = tmp;
|
||||
+ }
|
||||
return;
|
||||
}
|
||||
|
||||
/* Time iter repetitions of operation op. */
|
||||
SECStatus
|
||||
|
Loading…
x
Reference in New Issue
Block a user