summaryrefslogtreecommitdiffstats
path: root/crypto/bio/bss_mem.c
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2016-01-30 20:38:08 -0500
committerRich Salz <rsalz@openssl.org>2016-01-31 14:05:13 -0500
commit8ab31975bacb9c907261088937d3aa4102e3af84 (patch)
tree5c607508997ae2699e088446a2bd40f199fc6dfb /crypto/bio/bss_mem.c
parent0e87e05816d3e4b66ea7904634095aad5f6f325f (diff)
RT4129: BUF_new_mem_buf should take const void *
Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
Diffstat (limited to 'crypto/bio/bss_mem.c')
-rw-r--r--crypto/bio/bss_mem.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/bio/bss_mem.c b/crypto/bio/bss_mem.c
index 4a0fcdaa8f..4d4554719c 100644
--- a/crypto/bio/bss_mem.c
+++ b/crypto/bio/bss_mem.c
@@ -108,7 +108,7 @@ BIO_METHOD *BIO_s_secmem(void)
return(&secmem_method);
}
-BIO *BIO_new_mem_buf(void *buf, int len)
+BIO *BIO_new_mem_buf(const void *buf, int len)
{
BIO *ret;
BUF_MEM *b;
@@ -122,7 +122,8 @@ BIO *BIO_new_mem_buf(void *buf, int len)
if ((ret = BIO_new(BIO_s_mem())) == NULL)
return NULL;
b = (BUF_MEM *)ret->ptr;
- b->data = buf;
+ /* Cast away const and trust in the MEM_RDONLY flag. */
+ b->data = (void *)buf;
b->length = sz;
b->max = sz;
ret->flags |= BIO_FLAGS_MEM_RDONLY;