diff options
author | Pauli <ppzgs1@gmail.com> | 2021-03-17 12:23:52 +1000 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2021-03-18 21:24:25 +1000 |
commit | 7e7e034a10842dad3866c9447481b8527024bf44 (patch) | |
tree | 57d7ebc1d718f69dfe3f8e0af7cd09854278f806 /apps/s_time.c | |
parent | 3de7f014a985637361bdee775f78209300c88aae (diff) |
apps: fix coverity 966560: division by zero
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14586)
Diffstat (limited to 'apps/s_time.c')
-rw-r--r-- | apps/s_time.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/s_time.c b/apps/s_time.c index 2052a15c4f..386a81a78e 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 |