mirror of
https://github.com/build-cpp/cmkr
synced 2026-06-08 13:22:55 +00:00
Added check to make sure hash is valid hex (#153)
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user