Module: wine Branch: master Commit: cf78df3612d0731f1254d03e381401655b508433 URL: https://gitlab.winehq.org/wine/wine/-/commit/cf78df3612d0731f1254d03e3814016...
Author: Piotr Caban piotr@codeweavers.com Date: Sat Oct 15 20:12:00 2022 +0200
winedump: Fix buffer overflow in debugstr_wn helper.
---
tools/winedump/emf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/winedump/emf.c b/tools/winedump/emf.c index 48a67141ace..8c74702ecff 100644 --- a/tools/winedump/emf.c +++ b/tools/winedump/emf.c @@ -49,7 +49,7 @@ static const char *debugstr_wn(const WCHAR *wstr, unsigned int n) i = 0; p = buf; *p++ = '"'; - while (i < n && i < sizeof(buf) - 2 && wstr[i]) + while (i < n && i < sizeof(buf) - 3 && wstr[i]) { if (wstr[i] < 127) *p++ = wstr[i]; else *p++ = '.';