summaryrefslogtreecommitdiff
path: root/crypto/bio
diff options
context:
space:
mode:
authorDariusz Michaluk <d.michaluk@samsung.com>2018-11-22 11:46:02 +0100
committerDariusz Michaluk <d.michaluk@samsung.com>2018-11-22 11:46:02 +0100
commit0c4c39e921372ead218d7b8cedd71b7430798a0e (patch)
treeca29f64239b5085ea172e6b05e6a09f4fe71d277 /crypto/bio
parent6e3d29609234c63db2e97ae09681c31f3e710b18 (diff)
downloadopenssl-0c4c39e921372ead218d7b8cedd71b7430798a0e.tar.gz
openssl-0c4c39e921372ead218d7b8cedd71b7430798a0e.tar.bz2
openssl-0c4c39e921372ead218d7b8cedd71b7430798a0e.zip
Imported Upstream version 1.0.2pupstream/1.0.2p
Diffstat (limited to 'crypto/bio')
-rw-r--r--crypto/bio/bss_log.c4
-rw-r--r--crypto/bio/bss_mem.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/crypto/bio/bss_log.c b/crypto/bio/bss_log.c
index 1283a52..1b063fc 100644
--- a/crypto/bio/bss_log.c
+++ b/crypto/bio/bss_log.c
@@ -1,6 +1,6 @@
/* crypto/bio/bss_log.c */
/* ====================================================================
- * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
+ * Copyright (c) 1999-2018 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -242,7 +242,7 @@ static int MS_CALLBACK slg_write(BIO *b, const char *in, int inl)
if ((buf = (char *)OPENSSL_malloc(inl + 1)) == NULL) {
return (0);
}
- strncpy(buf, in, inl);
+ memcpy(buf, in, inl);
buf[inl] = '\0';
i = 0;
diff --git a/crypto/bio/bss_mem.c b/crypto/bio/bss_mem.c
index b0394a9..6ccb8e2 100644
--- a/crypto/bio/bss_mem.c
+++ b/crypto/bio/bss_mem.c
@@ -188,6 +188,8 @@ static int mem_write(BIO *b, const char *in, int inl)
}
BIO_clear_retry_flags(b);
+ if (inl == 0)
+ return 0;
blen = bm->length;
if (BUF_MEM_grow_clean(bm, blen + inl) != (blen + inl))
goto end;