]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/commitdiff
Add missing cast.
authorSimon Ruderich <simon@ruderich.org>
Thu, 8 Aug 2013 20:13:57 +0000 (22:13 +0200)
committerSimon Ruderich <simon@ruderich.org>
Thu, 8 Aug 2013 20:13:57 +0000 (22:13 +0200)
src/tlsproxy.c

index 8b9b6d92e1bb3309010b54a7240900a23419268c..1ccee20c22ab16b541f39e2adee26c65f5d6a30a 100644 (file)
@@ -24,6 +24,7 @@
 #include "connection.h"
 
 #include <arpa/inet.h>
+#include <assert.h>
 #include <errno.h>
 #include <pthread.h>
 #include <signal.h>
@@ -31,6 +32,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
+#include <limits.h>
 
 #if GNUTLS_VERSION_NUMBER <= 0x020b00
 /* Necessary for GnuTLS when used with threads. */
@@ -422,7 +424,8 @@ static void initialize_gnutls(void) {
         exit(EXIT_FAILURE);
     }
     dh_parameters_datum.data = (unsigned char *)dh_parameters;
-    dh_parameters_datum.size = strlen(dh_parameters);
+    assert(strlen(dh_parameters) <= UINT_MAX);
+    dh_parameters_datum.size = (unsigned int)(strlen(dh_parameters));
 
     result = gnutls_dh_params_init(&global_tls_dh_params);
     GNUTLS_ERROR_EXIT(result, "gnutls_dh_params_init()");