From 6d1038669a9a188015f7a19aed41084d8752891c Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sat, 20 Jan 2018 13:40:13 +0500 Subject: Fixed some UB detected by GCC UB-sanitizer --- src/Section.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Section.cpp') diff --git a/src/Section.cpp b/src/Section.cpp index 1083538..2f72411 100644 --- a/src/Section.cpp +++ b/src/Section.cpp @@ -4,6 +4,12 @@ #include void Section::CalculateHash() const { + if (block.empty()) { + hash = 0; + return; + } + + size_t offset = 0; std::vector rawData; -- cgit v1.2.3