提交 625b0990 编写于 作者: X xkernel 提交者: Matt Caswell

check the return value of BIO_new_file()

Reviewed-by: NPaul Dale <pauli@openssl.org>
Reviewed-by: NTomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17820)
上级 43ed2429
......@@ -1146,6 +1146,10 @@ int s_client_main(int argc, char **argv)
break;
case OPT_MSGFILE:
bio_c_msg = BIO_new_file(opt_arg(), "w");
if (bio_c_msg == NULL) {
BIO_printf(bio_err, "Error writing file %s\n", opt_arg());
goto end;
}
break;
case OPT_TRACE:
#ifndef OPENSSL_NO_SSL_TRACE
......
......@@ -1394,6 +1394,10 @@ int s_server_main(int argc, char *argv[])
break;
case OPT_MSGFILE:
bio_s_msg = BIO_new_file(opt_arg(), "w");
if (bio_s_msg == NULL) {
BIO_printf(bio_err, "Error writing file %s\n", opt_arg());
goto end;
}
break;
case OPT_TRACE:
#ifndef OPENSSL_NO_SSL_TRACE
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册