From 4c15e402de56ebc4ce12ece6faff33b9f2f80075 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 17 Oct 2024 17:26:46 -0400 Subject: [PATCH] Check nullptr in file path --- include/boost/crypt/hash/sha1.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/boost/crypt/hash/sha1.hpp b/include/boost/crypt/hash/sha1.hpp index ca35724..c1118ab 100644 --- a/include/boost/crypt/hash/sha1.hpp +++ b/include/boost/crypt/hash/sha1.hpp @@ -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); }