From 15eca26842e04912050d30a972fcce04e046da8a Mon Sep 17 00:00:00 2001 From: tb <> Date: Wed, 31 Aug 2022 12:29:08 +0000 Subject: Avoid division by zero if no connection was made. CID 184043 --- src/usr.bin/openssl/s_time.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/usr.bin/openssl/s_time.c b/src/usr.bin/openssl/s_time.c index cdaac7e858..92fdb59aa0 100644 --- a/src/usr.bin/openssl/s_time.c +++ b/src/usr.bin/openssl/s_time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_time.c,v 1.34 2019/07/14 03:30:46 guenther Exp $ */ +/* $OpenBSD: s_time.c,v 1.35 2022/08/31 12:29:08 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -458,9 +458,7 @@ benchmark(int reuse_session) printf("\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n", nConn, totalTime, ((double) nConn / totalTime), bytes_read); printf("%d connections in %.0f real seconds, %ld bytes read per connection\n", - nConn, - elapsed, - bytes_read / nConn); + nConn, elapsed, nConn > 0 ? bytes_read / nConn : 0); ret = 0; end: -- cgit v1.2.3-55-g6feb