Open
Description
I'm not sure if this is intended behavior or not, but it seems that flatc can seg fault when converting a flatbuffer binary to JSON if the flatbuffer is malformed. This could be caused by a flatbuffer being from a different schema or accidentally using an unrelated file.
Steps to reproduce
- Modify a FlatBuffer binary file to change an offset to be well out of bounds, or use some random unrelated binary file (I used the annotated binary feature to identify the location of an offset to modify)
- Use
flatc --json
to convert the file to JSON (I specifically usedflatc --json --strict-json --defaults-json -o temp schema.fbs -- --raw-binary flatbuf_binary.bin
) - flatc will either parse the invalid flatbuffer anyways or seg fault. I got the standard
Segmentation fault (core dumped)
message on Linux.
Why this might be an issue
I understand that using flatc on invalid flatbuffers is not the way it was intended to be used, but I expected some sort of error handling. I'm making this issue in case this is unintended behavior and should be fixed.
Metadata
Metadata
Assignees
Labels
No labels