Re: ole32: Remove stack-based string buffer inFileMonikerImpl_DecomposePath
"Ulrich Czekalla" <ulrich.czekalla(a)utoronto.ca> wrote:
- WCHAR word[MAX_PATH]; - int i=0,j,tabIndex=0; + LPOLESTR word; + int i=0,j,tabIndex=0, ret=0; LPOLESTR *strgtable ;
int len=lstrlenW(str);
TRACE("%s, %p\n", debugstr_w(str), *stringTable);
- strgtable =CoTaskMemAlloc(len*sizeof(LPOLESTR)); + strgtable = CoTaskMemAlloc(len*sizeof(LPOLESTR));
if (strgtable==NULL) return E_OUTOFMEMORY;
+ word = CoTaskMemAlloc((len + 1)*sizeof(LPOLESTR));
Shouldn't it be *sizeof(WCHAR) or *sizeof(OLECHAR)? -- Dmitry.
Silly me that's what I get for copying and pasting what was already there. Attached is a revised patch. Thanks, /Ulrich On Fri, Jun 08, 2007 at 01:11:03AM +0900, Dmitry Timoshkov wrote:
"Ulrich Czekalla" <ulrich.czekalla(a)utoronto.ca> wrote:
- WCHAR word[MAX_PATH]; - int i=0,j,tabIndex=0; + LPOLESTR word; + int i=0,j,tabIndex=0, ret=0; LPOLESTR *strgtable ;
int len=lstrlenW(str);
TRACE("%s, %p\n", debugstr_w(str), *stringTable);
- strgtable =CoTaskMemAlloc(len*sizeof(LPOLESTR)); + strgtable = CoTaskMemAlloc(len*sizeof(LPOLESTR));
if (strgtable==NULL) return E_OUTOFMEMORY;
+ word = CoTaskMemAlloc((len + 1)*sizeof(LPOLESTR));
Shouldn't it be *sizeof(WCHAR) or *sizeof(OLECHAR)?
-- Dmitry.
participants (2)
-
Dmitry Timoshkov -
Ulrich Czekalla