Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
caa301a7
Commit
caa301a7
authored
Nov 24, 2006
by
Marcus Meissner
Committed by
Alexandre Julliard
Nov 24, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Protect against integer overflow in SysAllocStringLen.
parent
1a145bb5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
oleaut.c
dlls/oleaut32/oleaut.c
+6
-2
No files found.
dlls/oleaut32/oleaut.c
View file @
caa301a7
...
...
@@ -20,6 +20,7 @@
#include <stdarg.h>
#include <string.h>
#include <limits.h>
#define COBJMACROS
...
...
@@ -217,6 +218,9 @@ BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
DWORD
*
newBuffer
;
WCHAR
*
stringBuffer
;
/* Detect integer overflow. */
if
(
len
>=
((
UINT_MAX
-
sizeof
(
WCHAR
)
-
sizeof
(
DWORD
))
/
sizeof
(
WCHAR
)))
return
NULL
;
/*
* Find the length of the buffer passed-in, in bytes.
*/
...
...
@@ -234,8 +238,8 @@ BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
/*
* If the memory allocation failed, return a null pointer.
*/
if
(
newBuffer
==
0
)
return
0
;
if
(
!
newBuffer
)
return
NULL
;
/*
* Copy the length of the string in the placeholder.
...
...
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