summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/crypto/bio
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2015-12-03 21:13:35 +0000
committerjkim <jkim@FreeBSD.org>2015-12-03 21:13:35 +0000
commit8d77ecefb78a0e7ec702cf614a78dd85de9395ee (patch)
treeade84397c16fe1b20cb2a441f603826e49c36cf2 /crypto/openssl/crypto/bio
parent5374819b03f4e6dcb332bf2729f9270e5d10b83a (diff)
parentafd52a5fc90e70242dbb0e7d29987c976eb993e0 (diff)
downloadFreeBSD-src-8d77ecefb78a0e7ec702cf614a78dd85de9395ee.zip
FreeBSD-src-8d77ecefb78a0e7ec702cf614a78dd85de9395ee.tar.gz
Merge OpenSSL 1.0.2e.
Diffstat (limited to 'crypto/openssl/crypto/bio')
-rw-r--r--crypto/openssl/crypto/bio/b_dump.c1
-rw-r--r--crypto/openssl/crypto/bio/bss_file.c13
2 files changed, 10 insertions, 4 deletions
diff --git a/crypto/openssl/crypto/bio/b_dump.c b/crypto/openssl/crypto/bio/b_dump.c
index ed8e521..ccf0e28 100644
--- a/crypto/openssl/crypto/bio/b_dump.c
+++ b/crypto/openssl/crypto/bio/b_dump.c
@@ -104,7 +104,6 @@ int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),
if ((rows * dump_width) < len)
rows++;
for (i = 0; i < rows; i++) {
- buf[0] = '\0'; /* start with empty string */
BUF_strlcpy(buf, str, sizeof buf);
BIO_snprintf(tmp, sizeof tmp, "%04x - ", i * dump_width);
BUF_strlcat(buf, tmp, sizeof buf);
diff --git a/crypto/openssl/crypto/bio/bss_file.c b/crypto/openssl/crypto/bio/bss_file.c
index d7f15b0..bfba93e 100644
--- a/crypto/openssl/crypto/bio/bss_file.c
+++ b/crypto/openssl/crypto/bio/bss_file.c
@@ -115,9 +115,8 @@ static BIO_METHOD methods_filep = {
NULL,
};
-BIO *BIO_new_file(const char *filename, const char *mode)
+static FILE *file_fopen(const char *filename, const char *mode)
{
- BIO *ret;
FILE *file = NULL;
# if defined(_WIN32) && defined(CP_UTF8)
@@ -164,6 +163,14 @@ BIO *BIO_new_file(const char *filename, const char *mode)
# else
file = fopen(filename, mode);
# endif
+ return (file);
+}
+
+BIO *BIO_new_file(const char *filename, const char *mode)
+{
+ BIO *ret;
+ FILE *file = file_fopen(filename, mode);
+
if (file == NULL) {
SYSerr(SYS_F_FOPEN, get_last_sys_error());
ERR_add_error_data(5, "fopen('", filename, "','", mode, "')");
@@ -386,7 +393,7 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
else
strcat(p, "t");
# endif
- fp = fopen(ptr, p);
+ fp = file_fopen(ptr, p);
if (fp == NULL) {
SYSerr(SYS_F_FOPEN, get_last_sys_error());
ERR_add_error_data(5, "fopen('", ptr, "','", p, "')");
OpenPOWER on IntegriCloud