Fix the buffer sizing in the fatalerrtest
authorMatt Caswell <matt@openssl.org>
Thu, 7 Dec 2017 14:35:30 +0000 (14:35 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 7 Dec 2017 14:35:30 +0000 (14:35 +0000)
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4867)

test/fatalerrtest.c

index fe2071f6e298ee5bf4d0e8bf954127ca19158b7b..23357351f5a8ad0d68f91dcc623603ebb358a6dd 100644 (file)
@@ -59,7 +59,7 @@ static int test_fatalerr(void)
         goto err;
 
     /* SSL_read()/SSL_write should fail because of a previous fatal error */
-    if (!TEST_int_le(len = SSL_read(sssl, buf, sizeof(buf - 1)), 0)) {
+    if (!TEST_int_le(len = SSL_read(sssl, buf, sizeof(buf) - 1), 0)) {
         buf[len] = '\0';
         TEST_error("Unexpected success reading data: %s\n", buf);
         goto err;