diff --git a/src/project_parser.cpp b/src/project_parser.cpp index b1ceea6..a9be666 100644 --- a/src/project_parser.cpp +++ b/src/project_parser.cpp @@ -550,6 +550,14 @@ Project::Project(const Project *parent, const std::string &path, bool build) : p algo.push_back(ch); } key = "URL_HASH"; + if (value.empty()) { + throw_key_error("Empty hash value", argItr.first, argItr.second); + } + for (char c : value) { + if (!std::isxdigit(c)) { + throw_key_error("Hash value must be a hex string", argItr.first, argItr.second); + } + } value = algo + "=" + value; } else if (key == "hash") { key = "URL_HASH";