To fix the problem, we need to ensure that the digest pointer is only used if the malloc call is successful. If malloc fails, we should avoid dereferencing digest and handle the error appropriately. This can be done by adding a check to ensure that digest is not used if malloc fails.
Suggested fixes powered by Copilot Autofix. Review carefully before merging.
Fixes https://github.com/cooljeanius/trousers-0.3.11.2/security/code-scanning/4
To fix the problem, we need to ensure that the
digest
pointer is only used if themalloc
call is successful. Ifmalloc
fails, we should avoid dereferencingdigest
and handle the error appropriately. This can be done by adding a check to ensure thatdigest
is not used ifmalloc
fails.Suggested fixes powered by Copilot Autofix. Review carefully before merging.