getsentry / pdb

A parser for Microsoft PDB (Program Database) debugging information
https://docs.rs/pdb/
Apache License 2.0
368 stars 68 forks source link

Return UnrecognizedFileFormat for files too small #76

Closed schultetwin1 closed 4 years ago

schultetwin1 commented 4 years ago

Previously pdb::PDB::open would return a std::io::Error with ErrorKind UnexpectedEof for files which were too small to be parsed into a PDB. This EOF may indeed be a proper EOF if the file is small and therefore we should return UnrecognizedFileFormat.

Adds a test to verify the behavior added here.

Fixes #75

willglynn commented 4 years ago

LGTM, thanks! Please address the CI cargo fmt nitpicks and we'll get this merged.

schultetwin1 commented 4 years ago

Thank you! I thought I ran cargo fmt before pushing but I guess not :). Formatting fixed.