hydra-queue-runner: Fix potential UB
Removing two characters from a string when it starts with " can lead to a substring call with -1
This commit is contained in:
@@ -78,7 +78,7 @@ BuildOutput getBuildOutput(
|
|||||||
product.type = match[1];
|
product.type = match[1];
|
||||||
product.subtype = match[2];
|
product.subtype = match[2];
|
||||||
std::string s(match[3]);
|
std::string s(match[3]);
|
||||||
product.path = s[0] == '"' ? std::string(s, 1, s.size() - 2) : s;
|
product.path = s[0] == '"' && s.back() == '"' ? std::string(s, 1, s.size() - 2) : s;
|
||||||
product.defaultPath = match[5];
|
product.defaultPath = match[5];
|
||||||
|
|
||||||
/* Ensure that the path exists and points into the Nix
|
/* Ensure that the path exists and points into the Nix
|
||||||
|
Reference in New Issue
Block a user