Remove unnecessary length check before OPENSSL_memcpy
OPENSSL_memcpy already internally checks for empty lengths.
Change-Id: I0015758fd5410e036b532ae727341ae0c0edbdbf
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/63826
Reviewed-by: Bob Beck <bbe@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
diff --git a/crypto/fipsmodule/cipher/e_aes.c b/crypto/fipsmodule/cipher/e_aes.c
index 6d91cc4..edab46d 100644
--- a/crypto/fipsmodule/cipher/e_aes.c
+++ b/crypto/fipsmodule/cipher/e_aes.c
@@ -485,9 +485,7 @@
if (arg < 4 || (gctx->ivlen - arg) < 8) {
return 0;
}
- if (arg) {
- OPENSSL_memcpy(gctx->iv, ptr, arg);
- }
+ OPENSSL_memcpy(gctx->iv, ptr, arg);
if (c->encrypt) {
// |RAND_bytes| calls within the fipsmodule should be wrapped with state
// lock functions to avoid updating the service indicator with the DRBG