system/Error: truncate the snprintf() return value

snprintf() does not return the (truncated) length actually written,
but the length that would be needed if the buffer were large enough.
This API usage mistake in FormatLastError() can lead to overflow of
the stack buffer, crashing the process (Windows only).

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1676
This commit is contained in:
Max Kellermann
2022-11-28 09:27:53 +01:00
parent c2d0f35e7a
commit 73b5d0a9b9
2 changed files with 6 additions and 1 deletions

2
NEWS
View File

@@ -1,5 +1,7 @@
ver 0.23.11 (not yet released)
* macOS: fix build failure "no archive members specified"
* Windows
- fix crash bug (stack buffer overflow) after I/O errors
* Android/Windows
- update OpenSSL to 3.0.7