commit | 4984e4a6325e9c6302f846c7bf2b75e8ea3fd9dd | [log] [tgz] |
---|---|---|
author | David Benjamin <davidben@google.com> | Thu Mar 24 17:57:57 2022 -0400 |
committer | Boringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Mar 24 22:32:05 2022 +0000 |
tree | 99a3cb1d1e3e3da3da343dea9abc5639b5de8f8f | |
parent | f94a7ce599ee6fdea624b36d3febf5d8f46bdcc1 [diff] |
Work around another C language bug with empty spans. This is another instance of https://boringssl-review.googlesource.com/c/boringssl/+/38584. We missed it because our UBSan bots only run on x86-64, which uses a different version of this function. See also https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=96307 Change-Id: Ib27eaca581c27fe9b7fd0e532d1a0e2850cb83d4 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/52125 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com>
diff --git a/crypto/poly1305/poly1305.c b/crypto/poly1305/poly1305.c index 2eb3974..e4e6298 100644 --- a/crypto/poly1305/poly1305.c +++ b/crypto/poly1305/poly1305.c
@@ -204,6 +204,11 @@ size_t in_len) { struct poly1305_state_st *state = poly1305_aligned_state(statep); + // Work around a C language bug. See https://crbug.com/1019588. + if (in_len == 0) { + return; + } + #if defined(OPENSSL_POLY1305_NEON) if (CRYPTO_is_NEON_capable()) { CRYPTO_poly1305_update_neon(statep, in, in_len);