Address cppcheck warnings generated after addressing Sonarcloud suggestions

- The following two warnings were generated after introducing the change
  to instantiate the DigestImpl template with the address of mbedtls_md5
  or mbedtls_sha1:
  - warning: src/utils/sha1.h,62,error,danglingTemporaryLifetime,Using
    pointer that is a temporary.
  - warning: src/utils/sha1.h,60,style,constVariablePointer,Variable
    'ret' can be declared as pointer to const
- See https://github.com/owasp-modsecurity/ModSecurity/pull/3231#issuecomment-2312511500
This commit is contained in:
Eduardo Arias 2024-08-28 12:19:58 -03:00 committed by Eduardo Arias
parent bbef22b3b5
commit 2fb446ab2d

View File

@ -57,7 +57,7 @@ private:
ConvertOp convertOp) -> auto {
char digest[DigestSize];
auto ret = digestOp(reinterpret_cast<const unsigned char *>(input.c_str()),
const auto ret = (*digestOp)(reinterpret_cast<const unsigned char *>(input.c_str()),
input.size(), reinterpret_cast<unsigned char *>(digest));
assert(ret == 0);