From 5f43ce6784b64810e2431343fd3d90d431e37cc1 Mon Sep 17 00:00:00 2001 From: "jiayl@webrtc.org" Date: Mon, 14 Jul 2014 16:42:46 +0000 Subject: [PATCH] Fix a type cast issue for compiling webrtc with BoringSSL. BUG= R=juberti@google.com, juberti@webrtc.org Review URL: https://webrtc-codereview.appspot.com/16039004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6672 4adac7df-926f-26a2-2b94-8c16560cd09d --- talk/base/openssladapter.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/talk/base/openssladapter.cc b/talk/base/openssladapter.cc index 7e27fe3b19..7623d1a7a7 100644 --- a/talk/base/openssladapter.cc +++ b/talk/base/openssladapter.cc @@ -712,7 +712,10 @@ bool OpenSSLAdapter::VerifyServerName(SSL* ssl, const char* host, } STACK_OF(CONF_VALUE)* value = meth->i2v(meth, ext_str, NULL); - for (int j = 0; j < sk_CONF_VALUE_num(value); ++j) { + + // Cast to size_t to be compilable for both OpenSSL and BoringSSL. + for (size_t j = 0; j < static_cast(sk_CONF_VALUE_num(value)); + ++j) { CONF_VALUE* nval = sk_CONF_VALUE_value(value, j); // The value for nval can contain wildcards if (!strcmp(nval->name, "DNS") && string_match(host, nval->value)) {