mirror of
https://github.com/NixOS/nix
synced 2025-06-30 19:57:59 +02:00
fromJSON/fromTOML: throw if string contains null byte
This commit is contained in:
parent
ab5a9cf2db
commit
3a9d64b8e3
12 changed files with 60 additions and 3 deletions
|
@ -50,6 +50,7 @@ class JSONSax : nlohmann::json_sax<json> {
|
|||
public:
|
||||
void key(string_t & name, EvalState & state)
|
||||
{
|
||||
forceNoNullByte(name);
|
||||
attrs.insert_or_assign(state.symbols.create(name), &value(state));
|
||||
}
|
||||
};
|
||||
|
@ -122,6 +123,7 @@ public:
|
|||
|
||||
bool string(string_t & val) override
|
||||
{
|
||||
forceNoNullByte(val);
|
||||
rs->value(state).mkString(val);
|
||||
rs->add();
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue