authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-06-08 01:56:11 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-06-08 01:56:11 -07:00
log4d75ec97a4837fd6472b4dba1afcb2dd137e3622
tree3f0aec4d1a2737ba5237face6e22b50441002aec
parent74a41951e6b4957415868983ed24338256176457
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

when splitting lines group consecutive \r\n and fix another crash


3 files changed, 37 insertions(+), 0 deletions(-)

fuzz/crashes/id:000001,sig:06,src:000000,time:17906,execs:8822,op:arith8,pos:683,val:+3 created+30
...@@ -0,0 +1,30 @@
1id: g982zq6e8wsvnmduerpbf8787hu85brugmngn8wf
2name: yaml
3main: yaml.zig
4license: MIT
5description: A Yaml parser built on top of libyaml
6dependencies:
7 - src: git https://github.com/yaml/libyaml tag-0.2.5
8 id: 8mdbh0zuneb0i3hs5jby5je0heem1i6yxusl7c8y8qx68hqc
9 license: MIT
10 c_include_dirs:
11 - include
12 c_source_flags:
13 - -DYAML_VERSION_MAJOR=0
14 - -DYAML_VERSION_MINOR=2
15 - -DYAML_VERSION_PATCH=5
16 - -DYAML_VERSION_STRING="0.2.5"
17 - -DYAML_DECLARE_STATIC=1
18 c_source_files:
19 - src/api.c
20 - src/dumper.c
21 - src/emitter.c
22 - src/loader.c
23 - src/parser.c
24 - src/reader.c
25 - src/scanner.c
26 - src/writer.c
27 - src: git https://github.com/nektro/zig-extras
28
29root_dependencies:
30 - src: git https://github.com/nektro/zig-expect
test.zig+1
...@@ -25,6 +25,7 @@ test { fuzzCase(@embedFile("./fuzz/crashes/id:000000,sig:06,src:000000,time:1310...@@ -25,6 +25,7 @@ test { fuzzCase(@embedFile("./fuzz/crashes/id:000000,sig:06,src:000000,time:1310
25test { fuzzCase(@embedFile("./fuzz/crashes/id:000000,sig:06,src:000000,time:1399,execs:755,op:quick,pos:149")); }25test { fuzzCase(@embedFile("./fuzz/crashes/id:000000,sig:06,src:000000,time:1399,execs:755,op:quick,pos:149")); }
26test { fuzzCase(@embedFile("./fuzz/crashes/id:000002,sig:06,src:000000,time:12249,execs:9637,op:int8,pos:0,val:+32")); }26test { fuzzCase(@embedFile("./fuzz/crashes/id:000002,sig:06,src:000000,time:12249,execs:9637,op:int8,pos:0,val:+32")); }
27test { fuzzCase(@embedFile("./fuzz/crashes/id:000000,sig:06,src:000000,time:16058,execs:7921,op:arith8,pos:522,val:+10")); }27test { fuzzCase(@embedFile("./fuzz/crashes/id:000000,sig:06,src:000000,time:16058,execs:7921,op:arith8,pos:522,val:+10")); }
28test { fuzzCase(@embedFile("./fuzz/crashes/id:000001,sig:06,src:000000,time:17906,execs:8822,op:arith8,pos:683,val:+3")); }
28// zig fmt: on29// zig fmt: on
2930
30fn parseTest(comptime basename: [:0]const u8) !void {31fn parseTest(comptime basename: [:0]const u8) !void {
yaml.zig+6
...@@ -408,6 +408,12 @@ fn split(alloc: std.mem.Allocator, in: string) ![]string {...@@ -408,6 +408,12 @@ fn split(alloc: std.mem.Allocator, in: string) ![]string {
408408
409 var iter = std.mem.splitAny(u8, in, "\r\n");409 var iter = std.mem.splitAny(u8, in, "\r\n");
410 while (iter.next()) |str| {410 while (iter.next()) |str| {
411 if (str.len == 0) {
412 if ((str.ptr - 1)[0] == '\r' and str.ptr[0] == '\n') {
413 try list.append(iter.next() orelse break);
414 continue;
415 }
416 }
411 try list.append(str);417 try list.append(str);
412 }418 }
413 return try list.toOwnedSlice();419 return try list.toOwnedSlice();