Skip to content

Commit

Permalink
Address cppcheck warnings generated after addressing Sonarcloud sugge…
Browse files Browse the repository at this point in the history
…stions

- 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 #3231 (comment)
  • Loading branch information
eduar-hte authored and Eduardo Arias committed Oct 19, 2024
1 parent bbef22b commit 2fb446a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/sha1.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class DigestImpl {
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);

Expand Down

0 comments on commit 2fb446a

Please sign in to comment.