Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
10fbf5f5
Commit
10fbf5f5
authored
14 years ago
by
Dylan Smith
Committed by
Alexandre Julliard
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
d3dxof: Avoid overflowing temp buffers for large tokens.
parent
555fe787
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/d3dxof/parsing.c
+22
-14
22 additions, 14 deletions
dlls/d3dxof/parsing.c
with
22 additions
and
14 deletions
dlls/d3dxof/parsing.c
+
22
−
14
View file @
10fbf5f5
...
...
@@ -340,7 +340,7 @@ static BOOL is_guid(parse_buffer* buf)
if
(
buf
->
rem_bytes
<
38
||
*
buf
->
buffer
!=
'<'
)
return
FALSE
;
tmp
[
0
]
=
'<'
;
while
(
*
(
buf
->
buffer
+
pos
)
!=
'>'
)
while
(
pos
<
sizeof
(
tmp
)
-
2
&&
*
(
buf
->
buffer
+
pos
)
!=
'>'
)
{
tmp
[
pos
]
=
*
(
buf
->
buffer
+
pos
);
pos
++
;
...
...
@@ -381,7 +381,7 @@ static BOOL is_guid(parse_buffer* buf)
static
BOOL
is_name
(
parse_buffer
*
buf
)
{
char
tmp
[
5
0
];
char
tmp
[
5
12
];
DWORD
pos
=
0
;
char
c
;
BOOL
error
=
0
;
...
...
@@ -389,9 +389,11 @@ static BOOL is_name(parse_buffer* buf)
{
if
(
!
(((
c
>=
'a'
)
&&
(
c
<=
'z'
))
||
((
c
>=
'A'
)
&&
(
c
<=
'Z'
))
||
((
c
>=
'0'
)
&&
(
c
<=
'9'
))
||
(
c
==
'_'
)
||
(
c
==
'-'
)))
error
=
1
;
tmp
[
pos
++
]
=
c
;
if
(
pos
<
sizeof
(
tmp
))
tmp
[
pos
]
=
c
;
pos
++
;
}
tmp
[
pos
]
=
0
;
tmp
[
min
(
pos
,
sizeof
(
tmp
)
-
1
)
]
=
0
;
if
(
error
)
{
...
...
@@ -410,7 +412,7 @@ static BOOL is_name(parse_buffer* buf)
static
BOOL
is_float
(
parse_buffer
*
buf
)
{
char
tmp
[
5
0
];
char
tmp
[
5
12
];
DWORD
pos
=
0
;
char
c
;
float
decimal
;
...
...
@@ -422,9 +424,11 @@ static BOOL is_float(parse_buffer* buf)
return
FALSE
;
if
(
c
==
'.'
)
dot
=
TRUE
;
tmp
[
pos
++
]
=
c
;
if
(
pos
<
sizeof
(
tmp
))
tmp
[
pos
]
=
c
;
pos
++
;
}
tmp
[
pos
]
=
0
;
tmp
[
min
(
pos
,
sizeof
(
tmp
)
-
1
)
]
=
0
;
buf
->
buffer
+=
pos
;
buf
->
rem_bytes
-=
pos
;
...
...
@@ -440,7 +444,7 @@ static BOOL is_float(parse_buffer* buf)
static
BOOL
is_integer
(
parse_buffer
*
buf
)
{
char
tmp
[
5
0
];
char
tmp
[
5
12
];
DWORD
pos
=
0
;
char
c
;
DWORD
integer
;
...
...
@@ -449,9 +453,11 @@ static BOOL is_integer(parse_buffer* buf)
{
if
(
!
((
c
>=
'0'
)
&&
(
c
<=
'9'
)))
return
FALSE
;
tmp
[
pos
++
]
=
c
;
if
(
pos
<
sizeof
(
tmp
))
tmp
[
pos
]
=
c
;
pos
++
;
}
tmp
[
pos
]
=
0
;
tmp
[
min
(
pos
,
sizeof
(
tmp
)
-
1
)
]
=
0
;
buf
->
buffer
+=
pos
;
buf
->
rem_bytes
-=
pos
;
...
...
@@ -467,7 +473,7 @@ static BOOL is_integer(parse_buffer* buf)
static
BOOL
is_string
(
parse_buffer
*
buf
)
{
char
tmp
[
100
];
char
tmp
[
512
];
DWORD
pos
=
0
;
char
c
;
BOOL
ok
=
0
;
...
...
@@ -475,16 +481,18 @@ static BOOL is_string(parse_buffer* buf)
if
(
*
buf
->
buffer
!=
'"'
)
return
FALSE
;
while
(
pos
<
buf
->
rem_bytes
&&
!
is_operator
(
c
=
*
(
buf
->
buffer
+
pos
+
1
))
&&
(
pos
<
99
)
)
while
(
pos
<
buf
->
rem_bytes
&&
!
is_operator
(
c
=
*
(
buf
->
buffer
+
pos
+
1
)))
{
if
(
c
==
'"'
)
{
ok
=
1
;
break
;
}
tmp
[
pos
++
]
=
c
;
if
(
pos
<
sizeof
(
tmp
))
tmp
[
pos
]
=
c
;
pos
++
;
}
tmp
[
pos
]
=
0
;
tmp
[
min
(
pos
,
sizeof
(
tmp
)
-
1
)
]
=
0
;
if
(
!
ok
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment