Fix s_server/s_client handling of the split_send_frag argument
authorMatt Caswell <matt@openssl.org>
Mon, 7 Mar 2016 10:06:42 +0000 (10:06 +0000)
committerMatt Caswell <matt@openssl.org>
Mon, 7 Mar 2016 21:39:28 +0000 (21:39 +0000)
Ensure that a value of 0 is correctly handled for the split_send_frag
argument.

Reviewed-by: Tim Hudson <tjh@openssl.org>
apps/s_client.c
apps/s_server.c

index 5a5a90b1cb41a5d9b5f2b47b00c652aabafa6abb..a1ef64b13fe4da4f72472dfb7a8cad695c27259d 100644 (file)
@@ -1389,8 +1389,11 @@ int s_client_main(int argc, char **argv)
         case OPT_SPLIT_SEND_FRAG:
             split_send_fragment = atoi(opt_arg());
             if (split_send_fragment == 0) {
         case OPT_SPLIT_SEND_FRAG:
             split_send_fragment = atoi(opt_arg());
             if (split_send_fragment == 0) {
-                /* Not allowed - set to a deliberately bad value */
-                split_send_fragment = -1;
+                /*
+                 * Not allowed - set to a deliberately bad value so we get an
+                 * error message below
+                 */
+                split_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH + 1;
             }
             break;
         case OPT_MAX_PIPELINES:
             }
             break;
         case OPT_MAX_PIPELINES:
index 870c7b24f949f2fed9054de36facd362a302cb7e..35a22f79006813ba90f3543922650b0deded5e48 100644 (file)
@@ -1517,8 +1517,11 @@ int s_server_main(int argc, char *argv[])
         case OPT_SPLIT_SEND_FRAG:
             split_send_fragment = atoi(opt_arg());
             if (split_send_fragment == 0) {
         case OPT_SPLIT_SEND_FRAG:
             split_send_fragment = atoi(opt_arg());
             if (split_send_fragment == 0) {
-                /* Not allowed - set to a deliberately bad value */
-                split_send_fragment = -1;
+                /*
+                 * Not allowed - set to a deliberately bad value so we get an
+                 * error message below
+                 */
+                split_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH + 1;
             }
             break;
         case OPT_MAX_PIPELINES:
             }
             break;
         case OPT_MAX_PIPELINES: