mirror of
https://github.com/NixOS/nix
synced 2025-06-25 02:21:16 +02:00
Merge pull request #12024 from NaN-git/null-char
fromJSON/fromTOML: throw if string contains null byte
This commit is contained in:
commit
50ba85167c
12 changed files with 60 additions and 3 deletions
|
@ -0,0 +1,8 @@
|
|||
error:
|
||||
… while calling the 'fromJSON' builtin
|
||||
at /pwd/lang/eval-fail-fromJSON-keyWithNullByte.nix:1:1:
|
||||
1| builtins.fromJSON ''{"a\u0000b": 1}''
|
||||
| ^
|
||||
2|
|
||||
|
||||
error: input string 'a␀b' cannot be represented as Nix string because it contains null bytes
|
|
@ -0,0 +1 @@
|
|||
builtins.fromJSON ''{"a\u0000b": 1}''
|
|
@ -0,0 +1,8 @@
|
|||
error:
|
||||
… while calling the 'fromJSON' builtin
|
||||
at /pwd/lang/eval-fail-fromJSON-valueWithNullByte.nix:1:1:
|
||||
1| builtins.fromJSON ''"a\u0000b"''
|
||||
| ^
|
||||
2|
|
||||
|
||||
error: input string 'a␀b' cannot be represented as Nix string because it contains null bytes
|
|
@ -0,0 +1 @@
|
|||
builtins.fromJSON ''"a\u0000b"''
|
|
@ -0,0 +1,8 @@
|
|||
error:
|
||||
… while calling the 'fromTOML' builtin
|
||||
at /pwd/lang/eval-fail-fromTOML-keyWithNullByte.nix:1:1:
|
||||
1| builtins.fromTOML ''"a\u0000b" = 1''
|
||||
| ^
|
||||
2|
|
||||
|
||||
error: while parsing TOML: error: input string 'a␀b' cannot be represented as Nix string because it contains null bytes
|
|
@ -0,0 +1 @@
|
|||
builtins.fromTOML ''"a\u0000b" = 1''
|
|
@ -0,0 +1,8 @@
|
|||
error:
|
||||
… while calling the 'fromTOML' builtin
|
||||
at /pwd/lang/eval-fail-fromTOML-valueWithNullByte.nix:1:1:
|
||||
1| builtins.fromTOML ''k = "a\u0000b"''
|
||||
| ^
|
||||
2|
|
||||
|
||||
error: while parsing TOML: error: input string 'a␀b' cannot be represented as Nix string because it contains null bytes
|
|
@ -0,0 +1 @@
|
|||
builtins.fromTOML ''k = "a\u0000b"''
|
Loading…
Add table
Add a link
Reference in a new issue