mirror of https://github.com/OISF/suricata
src: replace postfix decremental loops
During fuzzing, UBSan discovered that postfix increments/decrements inside a loop condition are executed after the condition is met. While in most cases loop counter is dropped right after it's been used in some cases where it doesn't it may lead to unexpected behaviour. Yet in both cases loop peforms extra addition/subtraction, which would be nice to eliminate. So the solution is to switch to incremental "for" loop or nest such counters inside loops so they are executed only if loop termination condition isn't met. Ticket: #8184 Signed-off-by: Sergey Zhidkih <rx1513@altlinux.org>pull/14966/head
parent
6ec9e5c957
commit
ffbc648aa9
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue