summaryrefslogtreecommitdiff
path: root/crypto/bio/bss_mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/bio/bss_mem.c')
-rw-r--r--crypto/bio/bss_mem.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/bio/bss_mem.c b/crypto/bio/bss_mem.c
index d190765..b0394a9 100644
--- a/crypto/bio/bss_mem.c
+++ b/crypto/bio/bss_mem.c
@@ -91,7 +91,8 @@ BIO_METHOD *BIO_s_mem(void)
return (&mem_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;
@@ -105,7 +106,8 @@ BIO *BIO_new_mem_buf(void *buf, int len)
if (!(ret = BIO_new(BIO_s_mem())))
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;