diff options
author | Matt Caswell <matt@openssl.org> | 2020-11-25 13:13:24 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2020-11-30 10:37:14 +0000 |
commit | a07dc8167ba79efe739fef18d7e2ef823bef16c9 (patch) | |
tree | 5c25d9ab7f0eff4bf3d7f63e092790095e76eead /crypto/bio | |
parent | 5658470ce7b4fabfd1fa2cdc69bee8d3a5e826f9 (diff) |
Fix instances of pointer addition with the NULL pointer
Addition using the NULL pointer (even when adding 0) is undefined
behaviour. Recent versions of ubsan are now complaining about this, so
we fix various instances.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13513)
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/bss_mem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/bio/bss_mem.c b/crypto/bio/bss_mem.c index 656c44b7af..ad7e8a6106 100644 --- a/crypto/bio/bss_mem.c +++ b/crypto/bio/bss_mem.c @@ -299,7 +299,7 @@ static long mem_ctrl(BIO *b, int cmd, long num, void *ptr) ret = (long)bm->length; if (ptr != NULL) { pptr = (char **)ptr; - *pptr = (char *)&(bm->data[0]); + *pptr = (char *)(bm->data); } break; case BIO_C_SET_BUF_MEM: |