Skip to content

Commit

Permalink
luajit: file null terminator: raw bits, validate
Browse files Browse the repository at this point in the history
  • Loading branch information
dlatchx committed Jul 25, 2023
1 parent d62bb59 commit 3af0462
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions format/luajit/luajit.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,9 @@ func LuaJITDecode(d *decode.D) any {
LuaJITDecodeProto(&di, d)
})
}

})

d.FieldU8("end")
d.FieldRawLen("end", 8, d.AssertBitBuf([]byte{0}))

return nil
}
2 changes: 1 addition & 1 deletion format/luajit/testdata/negative.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ $ fq dv negative.luac
| | | [3]{}: kgc 0x57-0x57.7 (1)
0x50| 00 | . | type: "child" (0) 0x57-0x57.7 (1)
| | | knum[0:0]: 0x58-NA (0)
0x50| 00| | .| | end: 0 0x58-0x58.7 (1)
0x50| 00| | .| | end: raw bits (valid) 0x58-0x58.7 (1)
2 changes: 1 addition & 1 deletion format/luajit/testdata/simple.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,4 @@ $ fq dv simple.luac
0x170| 01 08 66 31 00 | ..f1. | [3]: "\x01\bf1" value 0x17a-0x17e.7 (5)
0x170| 01| .| [4]: "\x01\a" value 0x17f-0x181.7 (3)
0x180|07 00 |.. |
0x180| 00| | .| | end: 0 0x182-0x182.7 (1)
0x180| 00| | .| | end: raw bits (valid) 0x182-0x182.7 (1)
2 changes: 1 addition & 1 deletion format/luajit/testdata/simple_stripped.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,4 @@ $ fq dv simple_stripped.luac
0x130| 02 | . | type: "true" (2) 0x132-0x132.7 (1)
| | | value: true 0x133-NA (0)
| | | knum[0:0]: 0x133-NA (0)
0x130| 00| | .| | end: 0 0x133-0x133.7 (1)
0x130| 00| | .| | end: raw bits (valid) 0x133-0x133.7 (1)

0 comments on commit 3af0462

Please sign in to comment.