fix: prevent division by zero in intHandler when no events received
@MarioHewardt ci sta già lavorando.
Dal 4/4/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Summary
Fix a potential division by zero crash in the intHandler signal
handler when Sysmon is stopped before processing any events
(totalEvents == 0).
Problem
In intHandler(), the following line:
printf("Total events: %ld, bad events: %ld, ratio = %f\n",
totalEvents, badEvents, (double)badEvents / totalEvents);
...will produce a division by zero (resulting in NaN or crash) if
Sysmon is interrupted immediately after startup before any eBPF
events are received.
Fix
Guard the division with a ternary check:
(double)badEvents / totalEvents
→
totalEvents > 0 ? (double)badEvents / totalEvents : 0.0
Testing
- Start Sysmon and immediately send SIGINT (Ctrl+C)
- Confirm clean output showing ratio = 0.000000 instead of crash/NaN
Notes
- No functional change to normal operation
- Zero risk of regression
- Fixes undefined behavior per C standard (integer division by zero)
- Lingua principale
- C
- Stelle
- 2.2k
- Fork
- 222
- Merge medio
- 4h 50m
- PR unite (30g)
- 3
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/Sysmon-Linux
-
ProcessCreate: ParentImage is empty when the parent starts the process from a non-main threadAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
microsoft/Sysmon-Linux#253 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
microsoft/Sysmon-Linux#252 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
microsoft/Sysmon-Linux#247 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 12/100
microsoft/Sysmon-Linux#246 · 3 commenti ·
-
Sysmon service executable remains `(deleted)` after restart, causing repeated needrestart restarts and systemd start-limit-hitForse di nuovo libera @MarioHewardt l’ha presa 31 giorni fa e non c’è nessuna pull request aperta. Aperta
microsoft/Sysmon-Linux#244 · 1 assegnatario ·
Tutte le issue di microsoft/Sysmon-Linux
Issue simili
-
enhancement good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
bug multiplayer status: planned
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
ChupathingyCE/chupathingyce#851 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
HigherOrderCO/Bend#2104 ·
-
research-radar
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue help wanted program
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
hffgzktbcc-blip/ounce-core#297 ·
I maintainer di solito rispondono entro 1 giorno