getsentry / pdb

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

Integer truncation following `parse_unsigned` in src/tpi/data.rs #114

Closed DrChat closed 2 years ago

DrChat commented 2 years ago

There are a few calls to parse_unsigned to parse variable-sized integers from the PDB file, but in a few cases immediately afterwards the u64 result is truncated. This results in pdb using and returning erroneous data.

For example, here: https://github.com/willglynn/pdb/blob/7c35c3c82fe42a0aa505c0715d57f68ee93196fb/src/tpi/data.rs#L120

The offset member of that structure should be 64-bits to avoid truncation.

Edit: This is fixed in PR #103

jan-auer commented 2 years ago

Closing this as the PR is merged. It will be released as soon as the remaining open PRs are merged 👍

DrChat commented 2 years ago

@jan-auer Thanks for maintaining this crate! I also wanted to ping you and see what your plans are for cutting a new release on crates.io?

jan-auer commented 2 years ago

👍 I'm still planning two breaking changes to the public API by addressing https://github.com/willglynn/pdb/issues/120 and https://github.com/willglynn/pdb/issues/124 in the next few days, will then cut a release.