Check for failure.
Also reuse retval for the buffer length in lieu of strlen.
ok?
Index: s_time.c
===================================================================
RCS file: /cvs/src/usr.bin/openssl/s_time.c,v
retrieving revision 1.29
diff -u -p -r1.29 s_time.c
--- s_time.c 22 Aug 2018 20:36:24 -0000 1.29
+++ s_time.c 22 Aug 2018 22:08:54 -0000
@@ -380,7 +380,8 @@ run_test(SSL *scon)
fprintf(stderr, "URL too long\n");
return 0;
}
- SSL_write(scon, buf, strlen(buf));
+ if (SSL_write(scon, buf, retval) <= 0)
+ return 0;
while ((i = SSL_read(scon, buf, sizeof(buf))) > 0)
bytes_read += i;
}