detect: bytemath do not left shift more than 64

As it is undefined behavior by C standard.
In this case, zeroes the value.

Ticket: #5900
pull/8635/head
Philippe Antoine 2 years ago committed by Victor Julien
parent 60e67db452
commit 473ca6dcf4

@ -168,7 +168,11 @@ int DetectByteMathDoMatch(DetectEngineThreadCtx *det_ctx, const SigMatchData *sm
val *= rvalue;
break;
case LeftShift:
val <<= rvalue;
if (rvalue < 64) {
val <<= rvalue;
} else {
val = 0;
}
break;
case RightShift:
val >>= rvalue;

Loading…
Cancel
Save