Fix use-after-move in TlsConnection
Fix reading from a moved-from variable in
quic::TlsConnection::TlsConnection(). This issue was found by the
bugprone-use-after-move clang-tidy diagnostic:
net/third_party/quiche/src/quic/core/crypto/tls_connection.cc:109:
'ssl_config' used after it was moved
net/third_party/quiche/src/quic/core/crypto/tls_connection.cc:96:
move occurred here
This fix is part of the effort to fix use-after-move errors in
Chromium, as tracked by crbug.com/1122844.
PiperOrigin-RevId: 416179037
diff --git a/quic/core/crypto/tls_connection.cc b/quic/core/crypto/tls_connection.cc
index fa9be97..901ae66 100644
--- a/quic/core/crypto/tls_connection.cc
+++ b/quic/core/crypto/tls_connection.cc
@@ -106,8 +106,8 @@
ssl(), ssl_config_.signing_algorithm_prefs->data(),
ssl_config_.signing_algorithm_prefs->size());
}
- if (ssl_config.disable_ticket_support.has_value()) {
- if (*ssl_config.disable_ticket_support) {
+ if (ssl_config_.disable_ticket_support.has_value()) {
+ if (*ssl_config_.disable_ticket_support) {
SSL_set_options(ssl(), SSL_OP_NO_TICKET);
}
}