Commit 7a4fa93
authored
Improve fuzz targets (#318)
* Stop not dealing with newlines for most fuzzing
Update most fuzz targets so that they now try out arguments containing
newlines. The exceptions to this are the fuzz targets with interpolation
set to true, these still ignore newlines (this is because in this
scenario newlines are not handled well yet, further work required); and
whenever fuzzing with cmd.exe (this is because cmd.exe does not handle
newlines well even when arguments are quoted, further work required) (a
item, "ec246439...", was added to the fuzz corpus for this).
* Align exec fuzz target with exec/execSync recipes
Expand the fuzz target for child_process.exec to include a check for
usage without having a shell specified (both with and without the
interpolation option set). Also, be more methodical about the checks,
following the "design" of the other fuzz targets.
* Fix incorrect argument preparation and expected output
Update the `prepareArg` and `getExpectedOutput` to take more inputs to
better understand how to respond. In particular, the inclusion of the
`shell` value ensures the correct return value is provided when a shell
**is** configured for fuzzing, but the particular fuzz check intents to
test without specifying a shell.
* Stop not dealing with (most) whitespace for most fuzzing interpolation
Update the fuzz checks that set interpolation to true to mostly start
fuzzing with whitespace, except for newline (see first paragraph). This
required some changes to the implementation (fixed in other branches
merged prior to this one). Multiple fuzz targets where added as a result
of this, namely:
- Related to whitespace between arguments
- "377f0b03272b8e006a7ba3fb993328a87e7914075caae18209c7c8c1be205e14"
- "38af29e913078ad07fc8d4156c2dfa3942e159bfcebe18e7e562ea3d82fce781"
- "cb41f974ee87bf382bc82a4e275bea2ffb99d9bb8d502826f5b6d231250e20b7"
- Related to (shell-dependent) special characters after whitespace
- "74cd192a0b85f46497a85e0b229630c55c306ce8904ca3d7e362c0ad81fa1088"
- "ec246439c059f17f708aa39f76f88ec8d8eaee7ccca2f07d4c09ef57ae6503d8"
- Related to trimming whitespace at the start and end of the argumens
- "bb9310963784ca202fd80f96f12a3cd13ee11f96a226d7cff5a921902a6b6324"
- "f5520c691959b1105525b46c01e6055916ea029f439a5ccefd17b03742adef64"1 parent 994af92 commit 7a4fa93
File tree
12 files changed
+141
-62
lines changed- test/fuzz
- corpus
12 files changed
+141
-62
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
23 | 53 | | |
24 | 54 | | |
25 | 55 | | |
26 | 56 | | |
27 | 57 | | |
28 | 58 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
36 | 65 | | |
37 | | - | |
38 | 66 | | |
39 | 67 | | |
40 | | - | |
| 68 | + | |
41 | 69 | | |
42 | 70 | | |
43 | 71 | | |
44 | 72 | | |
45 | | - | |
| 73 | + | |
46 | 74 | | |
47 | 75 | | |
48 | | - | |
| 76 | + | |
49 | 77 | | |
50 | 78 | | |
51 | | - | |
| 79 | + | |
52 | 80 | | |
53 | | - | |
| 81 | + | |
54 | 82 | | |
55 | 83 | | |
56 | | - | |
| 84 | + | |
57 | 85 | | |
58 | 86 | | |
59 | | - | |
| 87 | + | |
60 | 88 | | |
61 | 89 | | |
62 | 90 | | |
63 | | - | |
| 91 | + | |
64 | 92 | | |
65 | 93 | | |
66 | 94 | | |
67 | 95 | | |
68 | | - | |
| 96 | + | |
69 | 97 | | |
70 | 98 | | |
71 | 99 | | |
72 | | - | |
| 100 | + | |
73 | 101 | | |
74 | 102 | | |
75 | 103 | | |
76 | 104 | | |
77 | | - | |
| 105 | + | |
78 | 106 | | |
79 | 107 | | |
80 | 108 | | |
81 | 109 | | |
82 | | - | |
83 | 110 | | |
84 | 111 | | |
85 | 112 | | |
| |||
Binary file not shown.
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Binary file not shown.
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
18 | 51 | | |
19 | | - | |
20 | 52 | | |
21 | 53 | | |
22 | 54 | | |
23 | | - | |
| 55 | + | |
24 | 56 | | |
25 | 57 | | |
26 | | - | |
| 58 | + | |
27 | 59 | | |
28 | 60 | | |
29 | 61 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
34 | 73 | | |
35 | 74 | | |
36 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
37 | 79 | | |
38 | 80 | | |
39 | | - | |
| 81 | + | |
40 | 82 | | |
41 | 83 | | |
42 | 84 | | |
43 | 85 | | |
44 | 86 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 87 | | |
49 | | - | |
50 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
51 | 92 | | |
52 | 93 | | |
53 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | | - | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | | - | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | | - | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
0 commit comments