getsentry / symbolic

Stack trace symbolication library written in Rust
https://github.com/getsentry/symbolic#readme
MIT License
436 stars 75 forks source link

symbolic-debuginfo assumes that PDB names in codeview debug information are as long as the array holding them #824

Closed gabrielesvelto closed 6 months ago

gabrielesvelto commented 6 months ago

When extracting the debug file name from a codeview debug information directory entry symbolic-debuginfo takes the contents of the array and throws away the last character, assuming that it's the string's NUL terminator, see here.

However we've found several recent Microsoft DLL files in the wild where this assumption doesn't hold. Here's a few examples:

In all the cases above the array holding the debug file name is 256 bytes in length, however the string takes only a portion of it and ends with the NUL character. The remaining characters are padded with the ASCII character '0'.