From 80f7dc3e343af5221f25275eee36c52f16d91e8f Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Tue, 6 Jan 2004 11:11:14 +0000 Subject: [PATCH] fixed buffer size management in _ShgetPathFromIDListA() svn path=/trunk/; revision=7473 --- reactos/lib/shell32/pidl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/lib/shell32/pidl.c b/reactos/lib/shell32/pidl.c index 1c7aa6884ed..06117f0d647 100644 --- a/reactos/lib/shell32/pidl.c +++ b/reactos/lib/shell32/pidl.c @@ -1269,7 +1269,7 @@ HRESULT _SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath, UINT uOutSize) LPSTR pstr; LPSTR end = pszPath + uOutSize; - if (_ILIsMyComputer(pidl)) { /* optimized loop to retreive file system paths */ + if (_ILIsMyComputer(pidl)) { /* optimized loop to retrieve file system paths */ LPCITEMIDLIST p = ILGetNext(pidl); LPSTR txt; @@ -1319,7 +1319,7 @@ HRESULT _SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath, UINT uOutSize) } if (SUCCEEDED(hr)) { - hr = StrRetToStrNA(pstr, pszPath+MAX_PATH-pstr, &str, pidl); + hr = StrRetToStrNA(pstr, end-pstr, &str, pidl); /* don't allow to return displaynames of the form "::{guid}" */ if (pstr[0]==':' && pstr[1]==':') { @@ -1373,7 +1373,7 @@ HRESULT _SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath, UINT uOutSize) LPWSTR pstr; LPWSTR end = pszPath + uOutSize; - if (_ILIsMyComputer(pidl)) { /* optimized loop to retreive file system paths */ + if (_ILIsMyComputer(pidl)) { /* optimized loop to retrieve file system paths */ LPCITEMIDLIST p = ILGetNext(pidl); LPSTR txt;