diff --git a/src/internal.c b/src/internal.c index d5cf35026..b0e5b086b 100644 --- a/src/internal.c +++ b/src/internal.c @@ -12417,8 +12417,8 @@ static byte MaskMac(const byte* data, int sz, int macSz, byte* expMac) unsigned char started, notEnded; unsigned char good = 0; - if (scanStart < 0) - scanStart = 0; + scanStart &= (~scanStart) >> (sizeof(int) * 8 - 1); + macStart &= (~macStart) >> (sizeof(int) * 8 - 1); /* Div on Intel has different speeds depending on value. * Use a bitwise AND or mod a specific value (converted to mul). */