summaryrefslogtreecommitdiff
path: root/meta-openembedded/meta-oe/recipes-support/nss/nss/0001-Bug-1826650-cmd-ecperf-fix-dangling-pointer-warning-.patch
blob: dc7e172aae9ccfaa771ec230403e70ed82d8bfb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
From cbf5a2bce75ca2c2fd3e247796b9892f5298584e Mon Sep 17 00:00:00 2001
From: "John M. Schanck" <jschanck@mozilla.com>
Date: Thu, 13 Apr 2023 17:43:46 +0000
Subject: [PATCH] Bug 1826650 - cmd/ecperf: fix dangling pointer warning on gcc
 13. r=djackson

Differential Revision: https://phabricator.services.mozilla.com/D174822

--HG--
extra : moz-landing-system : lando
---
 cmd/ecperf/ecperf.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

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;
 }
 
-- 
2.40.1