From bb674321aaf45eedca3ab81ebf0d69a592f7d2e6 Mon Sep 17 00:00:00 2001 From: Reda Chouk Date: Thu, 19 Dec 2024 20:50:08 +0100 Subject: [PATCH] Fix C4333 warning by adjusting right shift operation on byte cast --- src/internal.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/internal.c b/src/internal.c index 7856abb24b..f98a618829 100644 --- a/src/internal.c +++ b/src/internal.c @@ -41409,8 +41409,7 @@ static int DefTicketEncCb(WOLFSSL* ssl, byte key_name[WOLFSSL_TICKET_NAME_SZ], ret = args->lastErr; args->lastErr = 0; /* reset */ /* On error 'ret' will be negative */ - mask = ((byte)ret >> - ((sizeof(ret) * 8) - 1)) - 1; + mask = (byte)((ret >> ((sizeof(ret) * 8) - 1)) & 0xFF) - 1; /* build PreMasterSecret */ ssl->arrays->preMasterSecret[0] = ssl->chVersion.major;