Skip to content

Commit 20a63b8

Browse files
cosmo0920edsiper
authored andcommitted
in_winevtlog: Plug a negative overflow possibility
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
1 parent 84e73c1 commit 20a63b8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

plugins/in_winevtlog/winevtlog.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,9 @@ static DWORD calc_backoff_ms(struct winevtlog_channel *ch, const struct winevtlo
734734
span = (LONG)((ms * jitter) / 100);
735735
delta = (LONG)(prng16(&ch->prng_state) % (2 * span + 1)) - span;
736736
with_jitter = (LONG)ms + delta;
737+
if (with_jitter < 0) {
738+
with_jitter = 0;
739+
}
737740
return (DWORD)with_jitter;
738741
}
739742

0 commit comments

Comments
 (0)