From: Pauli Date: Wed, 17 Mar 2021 02:23:52 +0000 (+1000) Subject: apps: fix coverity 966560: division by zero X-Git-Tag: openssl-3.0.0-alpha14~216 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e7e034a10842dad3866c9447481b8527024bf44;p=thirdparty%2Fopenssl.git apps: fix coverity 966560: division by zero Reviewed-by: Tomas Mraz Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/14586) --- diff --git a/apps/s_time.c b/apps/s_time.c index 2052a15c4fe..386a81a78ef 100644 --- a/apps/s_time.c +++ b/apps/s_time.c @@ -320,7 +320,8 @@ int s_time_main(int argc, char **argv) nConn, totalTime, ((double)nConn / totalTime), bytes_read); printf ("%d connections in %ld real seconds, %ld bytes read per connection\n", - nConn, (long)time(NULL) - finishtime + maxtime, bytes_read / nConn); + nConn, (long)time(NULL) - finishtime + maxtime, + nConn > 0 ? bytes_read / nConn : 0l); /* * Now loop and time connections using the same session id over and over