microsoft / xlang

MIT License
877 stars 103 forks source link

Fix a bug where the filename variable can get clobbered due to XmlReader invalidating the buffe #767

Closed ocalvo closed 2 years ago

ocalvo commented 2 years ago

Applying feedback over this PR

The buffer returned by IXmlReader::GetValue gets invalidated after the XmlReader is used more in the future. The fileName buffer was getting re-used in a scenario where there were lots of nodes to read. The fix is simply to save it off to a local wstring.

BenJKuhn commented 2 years ago

fixes #767