The direct cause of the bug in question was passing in the raw memory
buffer to sscanf. According to the standard[1], sscanf should be called
with a null-terminated buffer; which isn't guaranteed when blindly
trusting the file data.
When attempting to fuzz this code path, a variety of other crashes were
discovered and fixed.
[1] https://en.cppreference.com/w/c/io/fscanf
(see the Complexity section of that page for a related glibc issue)