diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-01-28 20:44:28 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-01-29 16:27:48 +0300 |
commit | a431fe8a8dfbbe121a30c66df0424be6351ae9ff (patch) | |
tree | a608ce67f1677ea318481f0e31f0a1031b4fc223 /bdep/ci.cxx | |
parent | f93e1e81eac9bcce3d11379e4cdefed5cf6093fd (diff) |
Validate that values submitted to CI and submission services contain UTF-8 encoded graphic characters only
Diffstat (limited to 'bdep/ci.cxx')
-rw-r--r-- | bdep/ci.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/bdep/ci.cxx b/bdep/ci.cxx index 81db678..6c30b46 100644 --- a/bdep/ci.cxx +++ b/bdep/ci.cxx @@ -251,7 +251,15 @@ namespace bdep // Get the server and repository URLs. // const url& srv (o.server_specified () ? o.server () : default_server); - const repository_location rep (repository_url (o, prj)); + string rep (repository_url (o, prj).string ()); + + // Make sure that parameters we post to the CI service are UTF-8 encoded + // and contain only the graphic Unicode codepoints. + // + validate_utf8_graphic (rep, "repository URL", "--repository"); + + if (o.simulate_specified ()) + validate_utf8_graphic (o.simulate (), "--simulate option value"); // Print the plan and ask for confirmation. // @@ -291,7 +299,7 @@ namespace bdep using namespace http_service; - parameters params ({{parameter::text, "repository", rep.string ()}}); + parameters params ({{parameter::text, "repository", move (rep)}}); for (const package& p: pkgs) params.push_back ({parameter::text, |