From 0eb5a2df4a3028e7283189c2be2849493106a18b Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Fri, 25 Jul 2014 02:40:43 -0400 Subject: [PATCH] Fix tls1_get_curvelist default curves list size. The length is the number of elements now, not the size in bytes. Caught by ASan. Change-Id: I4c5ccee61711e8d2e272b9bacd292dbff04b5133 Reviewed-on: https://boringssl-review.googlesource.com/1336 Reviewed-by: Adam Langley --- ssl/t1_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 66add632..5bc0ae9f 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -480,7 +480,7 @@ static void tls1_get_curvelist(SSL *s, int get_client_curves, { case SSL_CERT_FLAG_SUITEB_128_LOS: *out_curve_ids = suiteb_curves; - *out_curve_ids_len = sizeof(suiteb_curves); + *out_curve_ids_len = sizeof(suiteb_curves) / sizeof(suiteb_curves[0]); break; case SSL_CERT_FLAG_SUITEB_128_LOS_ONLY: @@ -499,7 +499,7 @@ static void tls1_get_curvelist(SSL *s, int get_client_curves, if (!*out_curve_ids) { *out_curve_ids = eccurves_default; - *out_curve_ids_len = sizeof(eccurves_default); + *out_curve_ids_len = sizeof(eccurves_default) / sizeof(eccurves_default[0]); } }