Initialise a variable to zero for GCC 7.2.0.
GCC 7.2.0 (in Release builds) can't figure out that |type| is always
set:
../ssl/tls_record.cc: In function ‘bssl::OpenRecordResult bssl::OpenRecord(SSL*, bssl::Span<unsigned char>*, size_t*, uint8_t*, bssl::Span<unsigned char>)’:
../ssl/tls_record.cc:595:44: error: ‘type’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (type != SSL3_RT_APPLICATION_DATA && type != SSL3_RT_ALERT) {
cc1plus: all warnings being treated as errors
Change-Id: I1ca9683a18d89097288018f48b50991bce185da8
Reviewed-on: https://boringssl-review.googlesource.com/21724
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
diff --git a/ssl/tls_record.cc b/ssl/tls_record.cc
index 73a8869..83453ee 100644
--- a/ssl/tls_record.cc
+++ b/ssl/tls_record.cc
@@ -586,7 +586,7 @@
}
Span<uint8_t> plaintext;
- uint8_t type;
+ uint8_t type = 0;
const ssl_open_record_t result = tls_open_record(
ssl, &type, &plaintext, out_record_len, out_alert, in);