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
d580d2c2
Commit
d580d2c2
authored
Feb 06, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Fix hex digit check in SetupGetBinaryField.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bf95bccf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
parser.c
dlls/setupapi/parser.c
+12
-3
No files found.
dlls/setupapi/parser.c
View file @
d580d2c2
...
...
@@ -1803,6 +1803,15 @@ BOOL WINAPI SetupGetIntField( PINFCONTEXT context, DWORD index, PINT result )
}
static
int
xdigit_to_int
(
WCHAR
c
)
{
if
(
'0'
<=
c
&&
c
<=
'9'
)
return
c
-
'0'
;
if
(
'a'
<=
c
&&
c
<=
'f'
)
return
c
-
'a'
+
10
;
if
(
'A'
<=
c
&&
c
<=
'F'
)
return
c
-
'A'
+
10
;
return
-
1
;
}
/***********************************************************************
* SetupGetBinaryField (SETUPAPI.@)
*/
...
...
@@ -1837,15 +1846,15 @@ BOOL WINAPI SetupGetBinaryField( PINFCONTEXT context, DWORD index, BYTE *buffer,
{
const
WCHAR
*
p
;
DWORD
value
=
0
;
for
(
p
=
field
->
text
;
*
p
&&
iswxdigit
(
*
p
);
p
++
)
int
d
;
for
(
p
=
field
->
text
;
*
p
&&
(
d
=
xdigit_to_int
(
*
p
))
!=
-
1
;
p
++
)
{
if
((
value
<<=
4
)
>
255
)
{
SetLastError
(
ERROR_INVALID_DATA
);
return
FALSE
;
}
if
(
*
p
<=
'9'
)
value
|=
(
*
p
-
'0'
);
else
value
|=
(
towlower
(
*
p
)
-
'a'
+
10
);
value
|=
d
;
}
buffer
[
i
-
index
]
=
value
;
}
...
...
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