Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix panic on malformed xref stream width
If the xref stream specifies an entry width of 9, read_u64_from_stream() will try to bitshift the u64 by `<< 8 * 9` which is invalid. Don't accept width that don't fit into a u64. If the xref stream specifies a valid width, but data is exhausted, read_u64_from_stream() will cause an out of bound access and panic. Check if we have enough bytes before reading. Fix the function doc comment, the width is in bytes, not bits.
- Loading branch information