From 2730955e7449989bb982092d3301f89340dbc189 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Thu, 5 May 2016 21:17:53 -0400 Subject: [PATCH] Check BIO_flush return value. That we're ignoring the return value is clearly wrong when dtls1_retransmit_message has other code that doesn't ignore it, by way of dtls1_do_handshake_write. Change-Id: Ie3f8c0defdf1f5e709d67af4ca6fa4f0d83c76c9 Reviewed-on: https://boringssl-review.googlesource.com/7872 Reviewed-by: Adam Langley --- ssl/d1_both.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ssl/d1_both.c b/ssl/d1_both.c index 7bd28241..e14eae73 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -759,10 +759,11 @@ int dtls1_retransmit_buffered_messages(SSL *ssl) { } } - /* TODO(davidben): Check return value? */ - (void)BIO_flush(SSL_get_wbio(ssl)); - - ret = 1; + ret = BIO_flush(SSL_get_wbio(ssl)); + if (ret <= 0) { + ssl->rwstate = SSL_WRITING; + goto err; + } err: if (!was_buffered) {