diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2023-02-15 15:39:45 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2023-02-16 10:24:54 +0100 |
| commit | 38b317a74b84fb45acb8891e518dee0a87435505 (patch) | |
| tree | f7bf7160dd6e6dd9df7e581fcbe769027d0a1e2f /prog/encoding_test.go | |
| parent | 6be0f1f57faa36df4b215edbe2fcfdbbb6de9f6d (diff) | |
prog: reject escaping filenames during deserialization
We already try as hard as possible to not generate escaping (global) filenames.
However, it's possible we read them from the corpus if it happens to contain some.
Also check for escaping filenames during deserialization.
Fixes #3678
Diffstat (limited to 'prog/encoding_test.go')
| -rw-r--r-- | prog/encoding_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/prog/encoding_test.go b/prog/encoding_test.go index 73c2cabcc..e99663aa3 100644 --- a/prog/encoding_test.go +++ b/prog/encoding_test.go @@ -335,6 +335,13 @@ func TestDeserialize(t *testing.T) { In: `test$str2(&(0x7f0000000000)="$eJwqrqzKTszJSS0CBAAA//8TyQPi`, Err: `want ", got EOF`, }, + { + In: `mutate9(&(0x7f0000000000)='./local/filename\x00')`, + }, + { + In: `mutate9(&(0x7f0000000000)='/escaping/filename\x00')`, + Err: `escaping filename`, + }, }) } |
