From 5112b24b8fe87f2099846e5c3351b21c8ba6186b Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Sun, 9 Apr 2023 13:23:08 +0000 Subject: [PATCH] nss: fix build issue with gcc-13 https://phabricator.services.mozilla.com/D174822 https://github.com/nss-dev/nss/commit/cbf5a2bce75ca2c2fd3e247796b9892f5298584e Bug 1826650 - cmd/ecperf: fix dangling pointer warning on gcc 13. r=djackson --- ...s-11-D174822-allow-build-with-gcc-13.patch | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 packages/security/nss/patches/nss-11-D174822-allow-build-with-gcc-13.patch diff --git a/packages/security/nss/patches/nss-11-D174822-allow-build-with-gcc-13.patch b/packages/security/nss/patches/nss-11-D174822-allow-build-with-gcc-13.patch new file mode 100644 index 0000000000..dbb88d0cbb --- /dev/null +++ b/packages/security/nss/patches/nss-11-D174822-allow-build-with-gcc-13.patch @@ -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 +