Counter mixed signedness with a cast
authorRichard Levitte <levitte@openssl.org>
Wed, 9 Mar 2016 07:18:54 +0000 (08:18 +0100)
committerRichard Levitte <levitte@openssl.org>
Wed, 9 Mar 2016 07:58:43 +0000 (08:58 +0100)
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
ssl/ssl_lib.c

index 75e81252b3c57a5d69e6dd6974ba95d7910b6a11..f6bf42d1e5c2742a828508a9d94ed6d2f6456071 100644 (file)
@@ -1717,7 +1717,7 @@ long SSL_ctrl(SSL *s, int cmd, long larg, void *parg)
             s->split_send_fragment = s->max_send_fragment;
         return 1;
     case SSL_CTRL_SET_SPLIT_SEND_FRAGMENT:
-        if (larg > s->max_send_fragment || larg == 0)
+        if ((unsigned int)larg > s->max_send_fragment || larg == 0)
             return 0;
         s->split_send_fragment = larg;
         return 1;
@@ -1871,7 +1871,7 @@ long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
             ctx->split_send_fragment = ctx->split_send_fragment;
         return 1;
     case SSL_CTRL_SET_SPLIT_SEND_FRAGMENT:
-        if (larg > ctx->max_send_fragment || larg == 0)
+        if ((unsigned int)larg > ctx->max_send_fragment || larg == 0)
             return 0;
         ctx->split_send_fragment = larg;
         return 1;