Crash in GetLastErrorString(): FormatMessageA may set out-param lpBuffer to NULL
jheydebrand opened this issue · comments
jheydebrand commented
The call to
Line 533 in ab510c7
msg_buf
to nullptr. This leads to an access violation and subsequent crash when that char pointer is assigned to the std::string (because it's constructor will try to perform strlen on that nullptr).
This happend to me on one of my machines. However, I did not bother to try to find out which Windows component is (presumably) missing that would restore the expected FormatMessageA behaviour.
If FormatMessageA
was unable to provide a usable message, ninja should probably just format the DWORD err
into a string.
I will create a pull request with this proposed fix.