From: Michael Brown Date: Mon, 3 Aug 2026 15:08:16 +0000 (+0100) Subject: [crypto] Avoid false positive warnings about mutating static state X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fipxe.git [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 --- 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 ), };