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
b67bbc92
Commit
b67bbc92
authored
Nov 16, 2008
by
Christian Costa
Committed by
Alexandre Julliard
Nov 17, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dxof: Fix data buffer limit check. Increase size of input and data buffers.
parent
630e2fff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
d3dxof.c
dlls/d3dxof/d3dxof.c
+10
-10
d3dxof_private.h
dlls/d3dxof/d3dxof_private.h
+1
-0
No files found.
dlls/d3dxof/d3dxof.c
View file @
b67bbc92
...
@@ -80,8 +80,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dxof);
...
@@ -80,8 +80,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dxof);
#define CLSIDFMT "<%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X>"
#define CLSIDFMT "<%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X>"
#define MAX_INPUT_SIZE
1
000000
#define MAX_INPUT_SIZE
2
000000
#define MAX_DATA_SIZE
1
00000
#define MAX_DATA_SIZE
2
00000
static
const
struct
IDirectXFileVtbl
IDirectXFile_Vtbl
;
static
const
struct
IDirectXFileVtbl
IDirectXFile_Vtbl
;
static
const
struct
IDirectXFileBinaryVtbl
IDirectXFileBinary_Vtbl
;
static
const
struct
IDirectXFileBinaryVtbl
IDirectXFileBinary_Vtbl
;
...
@@ -1858,9 +1858,9 @@ static BOOL parse_object_members_list(parse_buffer * buf)
...
@@ -1858,9 +1858,9 @@ static BOOL parse_object_members_list(parse_buffer * buf)
last_dword
=
*
(
DWORD
*
)
buf
->
value
;
last_dword
=
*
(
DWORD
*
)
buf
->
value
;
TRACE
(
"%s = %d
\n
"
,
pt
->
members
[
i
].
name
,
*
(
DWORD
*
)
buf
->
value
);
TRACE
(
"%s = %d
\n
"
,
pt
->
members
[
i
].
name
,
*
(
DWORD
*
)
buf
->
value
);
/* Assume larger size */
/* Assume larger size */
if
((
buf
->
cur_pdata
-
buf
->
p
xo
->
p
data
+
4
)
>
MAX_DATA_SIZE
)
if
((
buf
->
cur_pdata
-
buf
->
pdata
+
4
)
>
MAX_DATA_SIZE
)
{
{
WARN
(
"Buffer too small
\n
"
);
FIXME
(
"Buffer too small
\n
"
);
return
FALSE
;
return
FALSE
;
}
}
if
(
pt
->
members
[
i
].
type
==
TOKEN_WORD
)
if
(
pt
->
members
[
i
].
type
==
TOKEN_WORD
)
...
@@ -1884,9 +1884,9 @@ static BOOL parse_object_members_list(parse_buffer * buf)
...
@@ -1884,9 +1884,9 @@ static BOOL parse_object_members_list(parse_buffer * buf)
get_TOKEN
(
buf
);
get_TOKEN
(
buf
);
TRACE
(
"%s = %f
\n
"
,
pt
->
members
[
i
].
name
,
*
(
float
*
)
buf
->
value
);
TRACE
(
"%s = %f
\n
"
,
pt
->
members
[
i
].
name
,
*
(
float
*
)
buf
->
value
);
/* Assume larger size */
/* Assume larger size */
if
((
buf
->
cur_pdata
-
buf
->
p
xo
->
p
data
+
4
)
>
MAX_DATA_SIZE
)
if
((
buf
->
cur_pdata
-
buf
->
pdata
+
4
)
>
MAX_DATA_SIZE
)
{
{
WARN
(
"Buffer too small
\n
"
);
FIXME
(
"Buffer too small
\n
"
);
return
FALSE
;
return
FALSE
;
}
}
if
(
pt
->
members
[
i
].
type
==
TOKEN_FLOAT
)
if
(
pt
->
members
[
i
].
type
==
TOKEN_FLOAT
)
...
@@ -1905,9 +1905,9 @@ static BOOL parse_object_members_list(parse_buffer * buf)
...
@@ -1905,9 +1905,9 @@ static BOOL parse_object_members_list(parse_buffer * buf)
get_TOKEN
(
buf
);
get_TOKEN
(
buf
);
TRACE
(
"%s = %s
\n
"
,
pt
->
members
[
i
].
name
,
(
char
*
)
buf
->
value
);
TRACE
(
"%s = %s
\n
"
,
pt
->
members
[
i
].
name
,
(
char
*
)
buf
->
value
);
/* Assume larger size */
/* Assume larger size */
if
((
buf
->
cur_pdata
-
buf
->
p
xo
->
p
data
+
4
)
>
MAX_DATA_SIZE
)
if
((
buf
->
cur_pdata
-
buf
->
pdata
+
4
)
>
MAX_DATA_SIZE
)
{
{
WARN
(
"Buffer too small
\n
"
);
FIXME
(
"Buffer too small
\n
"
);
return
FALSE
;
return
FALSE
;
}
}
if
(
pt
->
members
[
i
].
type
==
TOKEN_LPSTR
)
if
(
pt
->
members
[
i
].
type
==
TOKEN_LPSTR
)
...
@@ -1915,7 +1915,7 @@ static BOOL parse_object_members_list(parse_buffer * buf)
...
@@ -1915,7 +1915,7 @@ static BOOL parse_object_members_list(parse_buffer * buf)
int
len
=
strlen
((
char
*
)
buf
->
value
)
+
1
;
int
len
=
strlen
((
char
*
)
buf
->
value
)
+
1
;
if
((
buf
->
cur_pstrings
-
buf
->
pstrings
+
len
)
>
MAX_STRINGS_BUFFER
)
if
((
buf
->
cur_pstrings
-
buf
->
pstrings
+
len
)
>
MAX_STRINGS_BUFFER
)
{
{
WARN
(
"Buffer too small %p %p %d
\n
"
,
buf
->
cur_pstrings
,
buf
->
pstrings
,
len
);
FIXME
(
"Buffer too small %p %p %d
\n
"
,
buf
->
cur_pstrings
,
buf
->
pstrings
,
len
);
return
FALSE
;
return
FALSE
;
}
}
strcpy
((
char
*
)
buf
->
cur_pstrings
,
(
char
*
)
buf
->
value
);
strcpy
((
char
*
)
buf
->
cur_pstrings
,
(
char
*
)
buf
->
value
);
...
@@ -2124,7 +2124,7 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE
...
@@ -2124,7 +2124,7 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE
WARN
(
"Out of memory
\n
"
);
WARN
(
"Out of memory
\n
"
);
return
DXFILEERR_BADALLOC
;
return
DXFILEERR_BADALLOC
;
}
}
This
->
buf
.
cur_pdata
=
pdata
;
This
->
buf
.
cur_pdata
=
This
->
buf
.
pdata
=
pdata
;
pstrings
=
HeapAlloc
(
GetProcessHeap
(),
0
,
MAX_STRINGS_BUFFER
);
pstrings
=
HeapAlloc
(
GetProcessHeap
(),
0
,
MAX_STRINGS_BUFFER
);
if
(
!
pstrings
)
if
(
!
pstrings
)
...
...
dlls/d3dxof/d3dxof_private.h
View file @
b67bbc92
...
@@ -135,6 +135,7 @@ typedef struct {
...
@@ -135,6 +135,7 @@ typedef struct {
xobject
*
pxo
;
xobject
*
pxo
;
xtemplate
*
pxt
[
MAX_SUBOBJECTS
];
xtemplate
*
pxt
[
MAX_SUBOBJECTS
];
ULONG
level
;
ULONG
level
;
LPBYTE
pdata
;
LPBYTE
pstrings
;
LPBYTE
pstrings
;
}
parse_buffer
;
}
parse_buffer
;
...
...
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