diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2024-02-02 19:33:42 +0100 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2024-02-02 20:25:38 +0100 |
commit | fb3ef957bbb6d674f7482572443a678e6b4a612e (patch) | |
tree | dfc5a8c071884b37f6e917269d48e0ad5ab3484d /src/common | |
parent | Merge pull request #12857 from liamwhite/const (diff) | |
download | yuzu-fb3ef957bbb6d674f7482572443a678e6b4a612e.tar yuzu-fb3ef957bbb6d674f7482572443a678e6b4a612e.tar.gz yuzu-fb3ef957bbb6d674f7482572443a678e6b4a612e.tar.bz2 yuzu-fb3ef957bbb6d674f7482572443a678e6b4a612e.tar.lz yuzu-fb3ef957bbb6d674f7482572443a678e6b4a612e.tar.xz yuzu-fb3ef957bbb6d674f7482572443a678e6b4a612e.tar.zst yuzu-fb3ef957bbb6d674f7482572443a678e6b4a612e.zip |
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/hex_util.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common/hex_util.h b/src/common/hex_util.h index a00904939..618f53152 100644 --- a/src/common/hex_util.h +++ b/src/common/hex_util.h @@ -9,6 +9,7 @@ #include <string> #include <vector> #include <fmt/format.h> +#include "common/assert.h" #include "common/common_types.h" namespace Common { @@ -29,6 +30,8 @@ namespace Common { template <std::size_t Size, bool le = false> [[nodiscard]] constexpr std::array<u8, Size> HexStringToArray(std::string_view str) { + ASSERT_MSG(Size * 2 <= str.size(), "Invalid string size"); + std::array<u8, Size> out{}; if constexpr (le) { for (std::size_t i = 2 * Size - 2; i <= 2 * Size; i -= 2) { |