CID 451444: division by zero in lib/isc/histo.c
Coverity Scan claims division by zero in lib/isc/histo.c
, introduced in !7696 (merged).
/lib/isc/histo.c: 477 in isc_histo_moments()
471 mean += count * delta / pop;
472 sigma += count * delta * (value - mean);
473 }
474
475 OUTARG(pm0, pop);
476 OUTARG(pm1, mean);
>>> CID 451444: Incorrect expression (DIVIDE_BY_ZERO)
>>> In expression "sigma / pop", division by expression "pop" which may be zero has undefined behavior.
477 OUTARG(pm2, sqrt(sigma / pop));
478 }
479
480 /*
481 * Clamped linear interpolation
482 *
Edited by Michał Kępień