From 05d4c9727f30a0e0e687ba6646dac5e93a970a6c Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Wed, 21 Jun 2017 16:35:10 -0400 Subject: [PATCH] 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 Commit-Queue: David Benjamin CQ-Verified: CQ bot account: commit-bot@chromium.org --- ssl/ssl_lib.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 3b951e0c..1b002a5e 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -1714,11 +1714,7 @@ found: 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(