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:37:33 +0000 (14:37 +0000)
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4868)

test/fatalerrtest.c

index 4a5883976ed0aeac121aaa10a94bb656eef66910..690d7e2d2b02195b1c031216f33d9e65a8e43ce9 100644 (file)
@@ -69,7 +69,7 @@ static int test_fatalerr(void)
     }
 
     /* SSL_read()/SSL_write should fail because of a previous fatal error */
-    if ((len = SSL_read(sssl, buf, sizeof(buf - 1))) > 0) {
+    if ((len = SSL_read(sssl, buf, sizeof(buf) - 1)) > 0) {
         buf[len] = '\0';
         printf("Unexpected success reading data: %s\n", buf);
         goto err;