Simplify SSL_get0_next_proto_negotiated. The pointer and length fields should always be kept in sync. Other code already assumes this anyway. Change-Id: I62bc77b805cd4d81f2caa4aa49ad3e9d96faa25e Reviewed-on: https://boringssl-review.googlesource.com/17306 Reviewed-by: Steven Valdez <svaldez@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 3b951e0..1b002a5 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c
@@ -1714,11 +1714,7 @@ void SSL_get0_next_proto_negotiated(const SSL *ssl, const uint8_t **out_data, unsigned *out_len) { *out_data = ssl->s3->next_proto_negotiated; - if (*out_data == NULL) { - *out_len = 0; - } else { - *out_len = ssl->s3->next_proto_negotiated_len; - } + *out_len = ssl->s3->next_proto_negotiated_len; } void SSL_CTX_set_next_protos_advertised_cb(