Debian Codegraph @

testdata/fuzz_crashers.yaml

raw symbols SCIP
1 # Copyright 2025 The go-yaml Project Contributors
2 # SPDX-License-Identifier: Apache-2.0
3
4 # Fuzz crasher test cases for go-yaml
5 #
6 # Purpose: Tests malformed YAML inputs discovered through fuzzing that previously
7 # caused crashes or panics. Ensures the parser handles edge cases gracefully without
8 # crashing, even for invalid or pathological input.
9 #
10 # Format: Test cases use type-as-key format:
11 # - test-type:
12 # name: Test case name
13 # ...
14 #
15 # Test Types:
16 # fuzz-crasher - Verifies that unmarshaling malformed input doesn't crash
17 #
18 # Common Keys:
19 # name - Test case name (string)
20 # yaml - Malformed YAML input to test (string)
21 #
22 # Note:
23 # These tests verify the parser doesn't crash or panic when processing
24 # malformed input. They may produce errors, but should handle them gracefully.
25
26 - fuzz-crasher:
27 name: Runtime error index out of range (null escape)
28 yaml: "\"\\0\\\r\n"
29
30 - fuzz-crasher:
31 name: Should not happen - flow sequence in mapping
32 yaml: " 0: [\n] 0"
33
34 - fuzz-crasher:
35 name: Should not happen - double question marks
36 yaml: "? ? \"\n\" 0"
37
38 - fuzz-crasher:
39 name: Should not happen - flow mapping in list
40 yaml: " - {\n000}0"
41
42 - fuzz-crasher:
43 name: Should not happen - nested flow sequence
44 yaml: "0:\n 0: [0\n] 0"
45
46 - fuzz-crasher:
47 name: Should not happen - quoted value in list with trailing
48 yaml: " - \"\n000\"0"
49
50 - fuzz-crasher:
51 name: Should not happen - quoted value in list with trailing quotes
52 yaml: " - \"\n000\"\""
53
54 - fuzz-crasher:
55 name: Should not happen - nested flow mapping in list
56 yaml: "0:\n - {\n000}0"
57
58 - fuzz-crasher:
59 name: Should not happen - nested quoted value in list with trailing
60 yaml: "0:\n - \"\n000\"0"
61
62 - fuzz-crasher:
63 name: Should not happen - nested quoted value in list with trailing quotes
64 yaml: "0:\n - \"\n000\"\""
65
66 - fuzz-crasher:
67 name: Runtime error index out of range (BOM with space)
68 yaml: " \uFEFF\n"
69
70 - fuzz-crasher:
71 name: Runtime error index out of range (BOM with question)
72 yaml: "? \uFEFF\n"
73
74 - fuzz-crasher:
75 name: Runtime error index out of range (BOM in key)
76 yaml: "? \uFEFF:\n"
77
78 - fuzz-crasher:
79 name: Runtime error index out of range (BOM in value)
80 yaml: "0: \uFEFF\n"
81
82 - fuzz-crasher:
83 name: Runtime error index out of range (BOM in both)
84 yaml: "? \uFEFF: \uFEFF\n"