Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
c2fdea60
Commit
c2fdea60
authored
Jun 07, 2007
by
Ulrich Czekalla
Committed by
Alexandre Julliard
Jun 07, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Remove stack-based string buffer inFileMonikerImpl_DecomposePath.
parent
1d6d8310
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
6 deletions
+34
-6
filemoniker.c
dlls/ole32/filemoniker.c
+34
-6
No files found.
dlls/ole32/filemoniker.c
View file @
c2fdea60
...
...
@@ -1011,19 +1011,27 @@ FileMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** p
int
FileMonikerImpl_DecomposePath
(
LPCOLESTR
str
,
LPOLESTR
**
stringTable
)
{
static
const
WCHAR
bSlash
[]
=
{
'\\'
,
0
};
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
(
LPOLEST
R
));
strgtable
=
CoTaskMemAlloc
(
len
*
sizeof
(
WCHA
R
));
if
(
strgtable
==
NULL
)
return
E_OUTOFMEMORY
;
word
=
CoTaskMemAlloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
word
==
NULL
)
{
ret
=
E_OUTOFMEMORY
;
goto
lend
;
}
while
(
str
[
i
]
!=
0
){
if
(
str
[
i
]
==
bSlash
[
0
]){
...
...
@@ -1031,7 +1039,10 @@ int FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable)
strgtable
[
tabIndex
]
=
CoTaskMemAlloc
(
2
*
sizeof
(
WCHAR
));
if
(
strgtable
[
tabIndex
]
==
NULL
)
return
E_OUTOFMEMORY
;
{
ret
=
E_OUTOFMEMORY
;
goto
lend
;
}
strcpyW
(
strgtable
[
tabIndex
++
],
bSlash
);
...
...
@@ -1048,7 +1059,10 @@ int FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable)
strgtable
[
tabIndex
]
=
CoTaskMemAlloc
(
sizeof
(
WCHAR
)
*
(
j
+
1
));
if
(
strgtable
[
tabIndex
]
==
NULL
)
return
E_OUTOFMEMORY
;
{
ret
=
E_OUTOFMEMORY
;
goto
lend
;
}
strcpyW
(
strgtable
[
tabIndex
++
],
word
);
}
...
...
@@ -1057,7 +1071,21 @@ int FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable)
*
stringTable
=
strgtable
;
return
tabIndex
;
ret
=
tabIndex
;
lend:
if
(
ret
<
0
)
{
for
(
i
=
0
;
i
<
tabIndex
;
i
++
)
CoTaskMemFree
(
strgtable
[
i
]);
CoTaskMemFree
(
strgtable
);
}
if
(
word
)
CoTaskMemFree
(
word
);
return
ret
;
}
/******************************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment