rainers / cv2pdb

converter of DMD CodeView/DWARF debug information to PDB files
Artistic License 2.0
472 stars 109 forks source link

cv2pdb crashes if mspdb*.dll cannot be loaded from path #41

Closed AlexWhiter closed 5 years ago

AlexWhiter commented 5 years ago

In the following conditions:

  1. Visual Studio 2013 or previous version is installed.
  2. mspdb.dll version cannot be loaded from %path%.
  3. One of mspdb.dll is available in MSVC installation directory. release version of cv2pdb crashes when trying to load mspdb140 via Studio SDK API. The exception occurs in https://github.com/rainers/cv2pdb/blob/master/src/mspdb.cpp#L99

Problem is ISetupConfiguration cannot be instantiated, result code is REGDB_E_CLASSNOTREG, so query is NULL, and query->EnumInstances leads to access violation.

rainers commented 5 years ago

Added the null check.