Module: wine Branch: master Commit: 29700766ea4e95082342bc536efc955646df054d URL: http://source.winehq.org/git/wine.git/?a=commit;h=29700766ea4e95082342bc536e...
Author: Marcus Meissner marcus@jet.franken.de Date: Fri May 11 20:09:29 2007 +0100
shell32: Avoid potential 1 byte overflow.
---
dlls/shell32/shlexec.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index 6e38dbd..5b2ee4e 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -654,6 +654,8 @@ UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation, &filetypelen) == ERROR_SUCCESS) { filetypelen /= sizeof(WCHAR); + if (filetypelen == sizeof(filetype)/sizeof(WCHAR)) + filetypelen--; filetype[filetypelen] = '\0'; TRACE("File type: %s\n", debugstr_w(filetype)); }