From 0471d6d131e756f675e6f8b01328a8ba52dbf75a Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 3 Aug 2026 16:08:16 +0100 Subject: [PATCH] [crypto] Avoid false positive warnings about mutating static state iPXE is single-threaded by design, but automated tools still tend to erroneously report the mutation of static state as being unsafe, especially when that mutation happens within cryptographic code. At the cost of six bytes in the 32-bit BIOS binary, allocate the reference algorithm ASN.1 cursor on the stack to eliminate this class of false positive warning. Signed-off-by: Michael Brown --- src/crypto/ocsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crypto/ocsp.c b/src/crypto/ocsp.c index 1bae23417..e255ad70c 100644 --- a/src/crypto/ocsp.c +++ b/src/crypto/ocsp.c @@ -481,7 +481,7 @@ static int ocsp_parse_responder_id ( struct ocsp_check *ocsp, */ static int ocsp_parse_cert_id ( struct ocsp_check *ocsp, const struct asn1_cursor *raw ) { - static struct asn1_cursor algorithm = { + struct asn1_cursor algorithm = { .data = ocsp_algorithm_id, .len = sizeof ( ocsp_algorithm_id ), };