Skip to content

Commit

Permalink
Check nullptr in file path
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland committed Oct 17, 2024
1 parent 27cd8c2 commit 4c15e40
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/boost/crypt/hash/sha1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,11 @@ inline auto sha1_file(const char* filepath) noexcept -> sha1_hasher::return_type
{
try
{
if (filepath == nullptr)
{
return sha1_hasher::return_type{};
}

utility::file_reader<64U> reader(filepath);
return detail::sha1_file_impl(reader);
}
Expand Down

0 comments on commit 4c15e40

Please sign in to comment.