Commit bf3295e
authored
js-yaml: fix driver (#13412)
There were three issues with the fuzz driver for js-yaml:
1. With `catch (YAMLException)` I believe the intent was to ignore
instances of `YAMLException` only. However, catch statements like these
would ignore _all_ exceptions in JavaScript. Added an explicit
`instanceof` check.
2. `getSchema` does not have the intended `options` object in scope.
Instead, it sets `schema` on the _global_ options object that Jazzer.js
[defines](https://github.com/CodeIntelligenceTesting/jazzer.js/blob/592be5c6d7f453e96822be41fe3f2a1351b8fd96/packages/core/core.ts#L129).
Return a schema from `getSchema` instead.
3. Schemas are supposed to be instances of the `Schema` class, not
strings. Replace string values with the constants this library
[exports](https://github.com/nodeca/js-yaml/blob/0d3ca7a27b03a6c974790a30a89e456007d62976/index.js#L21).1 parent fac9e51 commit bf3295e
1 file changed
+8
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
59 | | - | |
60 | 62 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
73 | 67 | | |
74 | 68 | | |
0 commit comments