diff options
-rw-r--r-- | src/usr.bin/openssl/s_time.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/usr.bin/openssl/s_time.c b/src/usr.bin/openssl/s_time.c index 906d36228f..91a6855d88 100644 --- a/src/usr.bin/openssl/s_time.c +++ b/src/usr.bin/openssl/s_time.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: s_time.c,v 1.29 2018/08/22 20:36:24 cheloha Exp $ */ | 1 | /* $OpenBSD: s_time.c,v 1.30 2018/08/28 02:14:22 cheloha Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -376,11 +376,12 @@ run_test(SSL *scon) | |||
376 | if (s_time_config.www_path != NULL) { | 376 | if (s_time_config.www_path != NULL) { |
377 | retval = snprintf(buf, sizeof buf, | 377 | retval = snprintf(buf, sizeof buf, |
378 | "GET %s HTTP/1.0\r\n\r\n", s_time_config.www_path); | 378 | "GET %s HTTP/1.0\r\n\r\n", s_time_config.www_path); |
379 | if ((size_t)retval >= sizeof buf) { | 379 | if (retval == -1 || retval >= sizeof buf) { |
380 | fprintf(stderr, "URL too long\n"); | 380 | fprintf(stderr, "URL too long\n"); |
381 | return 0; | 381 | return 0; |
382 | } | 382 | } |
383 | SSL_write(scon, buf, strlen(buf)); | 383 | if (SSL_write(scon, buf, retval) != retval) |
384 | return 0; | ||
384 | while ((i = SSL_read(scon, buf, sizeof(buf))) > 0) | 385 | while ((i = SSL_read(scon, buf, sizeof(buf))) > 0) |
385 | bytes_read += i; | 386 | bytes_read += i; |
386 | } | 387 | } |