Andrew Nguyen : ddraw: Reserve extra space in the reference device description buffer.
Module: wine Branch: master Commit: 2c8d4f5abd264f68565bd393bf7c9355ecfd762a URL: https://gitlab.winehq.org/wine/wine/-/commit/2c8d4f5abd264f68565bd393bf7c935... Author: Andrew Nguyen <arethusa26(a)gmail.com> Date: Sun Mar 10 21:38:51 2024 -0500 ddraw: Reserve extra space in the reference device description buffer. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56367 --- dlls/ddraw/ddraw.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 5887854556b..efbe01f3b8b 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -3868,7 +3868,10 @@ static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBA * never have POW2 unset in d3d7 on windows. */ if (ddraw->d3dversion != 1) { - static CHAR reference_description[] = "RGB Direct3D emulation"; + /* Tomb Raider 3 overwrites the reference device description buffer + * with its own custom string. Reserve some extra space in the array + * to avoid a buffer overrun. */ + static CHAR reference_description[64] = "RGB Direct3D emulation"; TRACE("Enumerating WineD3D D3DDevice interface.\n"); hal_desc = device_desc1;
participants (1)
-
Alexandre Julliard