diff options
| author | louist103 <louist103@gmail.com> | 2022-10-31 14:15:36 -0400 |
|---|---|---|
| committer | louist103 <louist103@gmail.com> | 2022-10-31 14:15:36 -0400 |
| commit | 622804013f9fb039266788c43d677724af596d8c (patch) | |
| tree | 8c887d1657b7ab0234eb9908d531836869dbb87d /ZAPD/ZFile.cpp | |
| parent | 78fdac56498f674eba2692e075d415a12cb4a31f (diff) | |
Check for non hex in offset.
Diffstat (limited to 'ZAPD/ZFile.cpp')
| -rw-r--r-- | ZAPD/ZFile.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ZAPD/ZFile.cpp b/ZAPD/ZFile.cpp index 6f22c88..60382f6 100644 --- a/ZAPD/ZFile.cpp +++ b/ZAPD/ZFile.cpp @@ -213,7 +213,12 @@ void ZFile::ParseXML(tinyxml2::XMLElement* reader, const std::string& filename) // Check for repeated attributes. if (offsetXml != nullptr) { - rawDataIndex = strtol(StringHelper::Split(offsetXml, "0x")[1].c_str(), NULL, 16); + std::string offsetStr = StringHelper::Split(offsetXml, "0x")[1]; + if (!StringHelper::HasOnlyHexDigits(offsetStr)) + { + HANDLE_ERROR(WarningType::InvalidXML, StringHelper::Sprintf("Invalid offset %s entered", offsetStr.c_str()), ""); + } + rawDataIndex = strtol(offsetStr.c_str(), NULL, 16); if (offsetSet.find(offsetXml) != offsetSet.end()) { |
