You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2016/03/02 23:10:20 UTC

svn commit: r1733381 - in /tomcat/native/trunk: native/src/sslcontext.c native/src/sslnetwork.c native/src/sslutils.c xdocs/miscellaneous/changelog.xml

Author: rjung
Date: Wed Mar  2 22:10:19 2016
New Revision: 1733381

URL: http://svn.apache.org/viewvc?rev=1733381&view=rev
Log:
Fix some compiler warnings in native ssl code.

Modified:
    tomcat/native/trunk/native/src/sslcontext.c
    tomcat/native/trunk/native/src/sslnetwork.c
    tomcat/native/trunk/native/src/sslutils.c
    tomcat/native/trunk/xdocs/miscellaneous/changelog.xml

Modified: tomcat/native/trunk/native/src/sslcontext.c
URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/sslcontext.c?rev=1733381&r1=1733380&r2=1733381&view=diff
==============================================================================
--- tomcat/native/trunk/native/src/sslcontext.c (original)
+++ tomcat/native/trunk/native/src/sslcontext.c Wed Mar  2 22:10:19 2016
@@ -978,7 +978,7 @@ TCN_IMPLEMENT_CALL(jboolean, SSLContext,
                                                          jbyteArray javaCert, jbyteArray javaKey, jint idx)
 {
 #ifdef HAVE_ECC
-#if defined(SSL_CTX_set_ecdh_auto)
+#ifndef SSL_CTX_set_ecdh_auto
     EC_KEY *eckey = NULL;
 #endif
 #endif

Modified: tomcat/native/trunk/native/src/sslnetwork.c
URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/sslnetwork.c?rev=1733381&r1=1733380&r2=1733381&view=diff
==============================================================================
--- tomcat/native/trunk/native/src/sslnetwork.c (original)
+++ tomcat/native/trunk/native/src/sslnetwork.c Wed Mar  2 22:10:19 2016
@@ -617,9 +617,6 @@ TCN_IMPLEMENT_CALL(jint, SSLSocket, rene
     tcn_socket_t *s   = J2P(sock, tcn_socket_t *);
     tcn_ssl_conn_t *con;
     int retVal;
-    int ecode = SSL_ERROR_WANT_READ;
-    apr_status_t rv;
-    apr_interval_time_t timeout;
 
     UNREFERENCED_STDARGS;
     TCN_ASSERT(sock != 0);

Modified: tomcat/native/trunk/native/src/sslutils.c
URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/sslutils.c?rev=1733381&r1=1733380&r2=1733381&view=diff
==============================================================================
--- tomcat/native/trunk/native/src/sslutils.c (original)
+++ tomcat/native/trunk/native/src/sslutils.c Wed Mar  2 22:10:19 2016
@@ -599,7 +599,7 @@ int select_next_proto(SSL *ssl, const un
     const unsigned char *p;
     const unsigned char *end;
     const unsigned char *proto;
-    unsigned char proto_len;
+    unsigned char proto_len = '\0';
 
     while (i < supported_protos_len) {
         target_proto_len = *supported_protos;
@@ -630,11 +630,10 @@ int select_next_proto(SSL *ssl, const un
         supported_protos += target_proto_len;
     }
 
-    if (failure_behavior == SSL_SELECTOR_FAILURE_CHOOSE_MY_LAST_PROTOCOL) {
+    if (supported_protos_len > 0 && inlen > 0 && failure_behavior == SSL_SELECTOR_FAILURE_CHOOSE_MY_LAST_PROTOCOL) {
          // There were no match but we just select our last protocol and hope the other peer support it.
          //
          // decrement the pointer again so the pointer points to the start of the protocol.
-         /* XXX compiler warning: 'proto_len' and 'p' may be used uninitialized in this function */
          p -= proto_len;
          *out = p;
          *outlen = proto_len;

Modified: tomcat/native/trunk/xdocs/miscellaneous/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/native/trunk/xdocs/miscellaneous/changelog.xml?rev=1733381&r1=1733380&r2=1733381&view=diff
==============================================================================
--- tomcat/native/trunk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/native/trunk/xdocs/miscellaneous/changelog.xml Wed Mar  2 22:10:19 2016
@@ -36,6 +36,9 @@
 </section>
 <section name="Changes in 1.2.6">
   <changelog>
+    <fix>
+      Fix some compiler warnings in native ssl code. (rjung)
+    </fix>
   </changelog>
 </section>
 <section name="Changes in 1.2.5">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org