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>
This commit is contained in:
Adam Langley 2017-10-11 16:15:34 -07:00 committed by Adam Langley
parent 1f1ac63bff
commit 771df4416a

View File

@ -586,7 +586,7 @@ OpenRecordResult OpenRecord(SSL *ssl, Span<uint8_t> *out,
} }
Span<uint8_t> plaintext; Span<uint8_t> plaintext;
uint8_t type; uint8_t type = 0;
const ssl_open_record_t result = tls_open_record( const ssl_open_record_t result = tls_open_record(
ssl, &type, &plaintext, out_record_len, out_alert, in); ssl, &type, &plaintext, out_record_len, out_alert, in);