mirror of
https://github.com/reactos/reactos.git
synced 2025-08-08 16:23:20 +00:00
fixed buffer size management in _ShgetPathFromIDListA()
svn path=/trunk/; revision=7473
This commit is contained in:
parent
4562169f04
commit
80f7dc3e34
1 changed files with 3 additions and 3 deletions
|
@ -1269,7 +1269,7 @@ HRESULT _SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath, UINT uOutSize)
|
||||||
LPSTR pstr;
|
LPSTR pstr;
|
||||||
LPSTR end = pszPath + uOutSize;
|
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);
|
LPCITEMIDLIST p = ILGetNext(pidl);
|
||||||
LPSTR txt;
|
LPSTR txt;
|
||||||
|
|
||||||
|
@ -1319,7 +1319,7 @@ HRESULT _SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath, UINT uOutSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SUCCEEDED(hr)) {
|
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}" */
|
/* don't allow to return displaynames of the form "::{guid}" */
|
||||||
if (pstr[0]==':' && pstr[1]==':') {
|
if (pstr[0]==':' && pstr[1]==':') {
|
||||||
|
@ -1373,7 +1373,7 @@ HRESULT _SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath, UINT uOutSize)
|
||||||
LPWSTR pstr;
|
LPWSTR pstr;
|
||||||
LPWSTR end = pszPath + uOutSize;
|
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);
|
LPCITEMIDLIST p = ILGetNext(pidl);
|
||||||
LPSTR txt;
|
LPSTR txt;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue