]> granicus.if.org Git - openssl/commitdiff
Fix the buffer sizing in the fatalerrtest
authorMatt Caswell <matt@openssl.org>
Thu, 7 Dec 2017 14:41:21 +0000 (14:41 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 7 Dec 2017 14:48:11 +0000 (14:48 +0000)
Fixes #4865

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4866)

ssl/fatalerrtest.c

index 749bc3697ea253d1007122a1156529077e163853..f9d66e27b30cebab3f9518e1ce45a25f7577691d 100644 (file)
@@ -76,7 +76,7 @@ int main(int argc, char *argv[])
     }
 
     /* 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;