summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2022-08-31 12:29:09 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2022-08-31 12:29:09 +0000
commit584ab22952b128fa83900b93df177f8122357203 (patch)
treeef6813c1e47c75420c15574c92b4da565c466d9b /usr.bin
parent07f2ab6fbda0c87bbc12ba031eceefdad64c38ca (diff)
Avoid division by zero if no connection was made.
CID 184043
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/openssl/s_time.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/openssl/s_time.c b/usr.bin/openssl/s_time.c
index cdaac7e8583..92fdb59aa00 100644
--- a/usr.bin/openssl/s_time.c
+++ b/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: