Alexandre Julliard : shell32: Silence buffer overflow compiler warnings.
Module: wine Branch: master Commit: 6624cabbb7cfe33c179a02238b4c9b91d3c3297e URL: https://source.winehq.org/git/wine.git/?a=commit;h=6624cabbb7cfe33c179a02238... Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Nov 26 17:31:53 2020 +0100 shell32: Silence buffer overflow compiler warnings. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/cpanelfolder.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/shell32/cpanelfolder.c b/dlls/shell32/cpanelfolder.c index ea5e9e2c3b6..114eb6babd3 100644 --- a/dlls/shell32/cpanelfolder.c +++ b/dlls/shell32/cpanelfolder.c @@ -259,9 +259,9 @@ static LPITEMIDLIST _ILCreateCPanelApplet(LPCSTR name, LPCSTR displayName, memcpy(pidl->mkid.abID, &tmp, 2+size0); p = &((PIDLDATA*)pidl->mkid.abID)->u.cpanel; - strcpy(p->szName, name); - strcpy(p->szName+tmp.u.cpanel.offsDispName, displayName); - strcpy(p->szName+tmp.u.cpanel.offsComment, comment); + memcpy(p->szName, name, strlen(name) + 1); + memcpy(p->szName+tmp.u.cpanel.offsDispName, displayName, strlen(displayName) + 1); + memcpy(p->szName+tmp.u.cpanel.offsComment, comment, strlen(comment) + 1); *(WORD*)((char*)pidl+(size+2)) = 0; @@ -1077,7 +1077,7 @@ static HRESULT WINAPI IShellExecuteHookA_fnExecute(IShellExecuteHookA *iface, return E_INVALIDARG; path[0] = '\"'; - lstrcpyA(path+1, pcpanel->szName); + memcpy(path+1, pcpanel->szName, strlen(pcpanel->szName) + 1); /* pass applet name to Control_RunDLL to distinguish between applets in one .cpl file */ lstrcatA(path, "\" ");
participants (1)
-
Alexandre Julliard