Work around another NULL/0 C language bug. memchr should be OPENSSL_memchr to avoid tripping the memchr variant of the memcpy(NULL, NULL, 0) language flaw. Change-Id: I5c945fa6df026d56073f3c5839c0d19cecaf1aa0 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/39624 Commit-Queue: David Benjamin <davidben@google.com> Commit-Queue: Adam Langley <agl@google.com> Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/fipsmodule/rsa/rsa_impl.c b/crypto/fipsmodule/rsa/rsa_impl.c index caa2eb4..94fb75c 100644 --- a/crypto/fipsmodule/rsa/rsa_impl.c +++ b/crypto/fipsmodule/rsa/rsa_impl.c
@@ -368,7 +368,7 @@ CRYPTO_MUTEX_lock_write(&rsa->lock); uint8_t *const free_inuse_flag = - memchr(rsa->blindings_inuse, 0, rsa->num_blindings); + OPENSSL_memchr(rsa->blindings_inuse, 0, rsa->num_blindings); if (free_inuse_flag != NULL) { *free_inuse_flag = 1; *index_used = free_inuse_flag - rsa->blindings_inuse;