From 114471d6cfbb475e68c86b775f4f39316a1d6b10 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Tue, 3 Jan 2023 15:23:43 -0800 Subject: [PATCH] add pragram around sanity check for vcpkg build warning --- src/internal.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/internal.c b/src/internal.c index 1afa361f9..c17158b34 100644 --- a/src/internal.c +++ b/src/internal.c @@ -12781,9 +12781,17 @@ static int ProcessPeerCertParse(WOLFSSL* ssl, ProcPeerCertArgs* args, return BAD_FUNC_ARG; } +PRAGMA_GCC_DIAG_PUSH +PRAGMA_GCC("GCC diagnostic ignored \"-Wstrict-overflow\"") + /* Surrounded in gcc pragma to avoid -Werror=strict-overflow when the + * compiler optimizes out the check and assumes no underflow. Keeping the + * check in place to handle multiple build configurations and future + * changes. */ + /* check to make sure certificate index is valid */ if (args->certIdx > args->count) return BUFFER_E; +PRAGMA_GCC_DIAG_POP /* check if returning from non-blocking OCSP */ /* skip this section because cert is already initialized and parsed */