honggfuzz.c: stats - avoid divbyzero
@@ -190,7 +190,9 @@ static void printSummary(honggfuzz_t* hfuzz) {
exec_per_sec = hfuzz->cnts.mutationsCnt / elapsed_sec;
}
uint64_t branch_percent_cov =
- (100 * hfuzz->linux.hwCnts.softCntEdge) / hfuzz->feedback.feedbackMap->guardNb;
+ hfuzz->feedback.feedbackMap->guardNb
+ ? ((100 * hfuzz->linux.hwCnts.softCntEdge) / hfuzz->feedback.feedbackMap->guardNb)
+ : 0;
LOG_I("Summary iterations:%zu time:%" PRIu64 " speed:%" PRIu64 " "
"crashes_count:%zu timeout_count:%zu new_units_added:%zu "
"slowest_unit_ms:%" PRId64 " guard_nb:%" PRIu64 " branch_coverage_percent:%" PRIu64,
