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
964a0303
Commit
964a0303
authored
Dec 14, 2007
by
Marcus Meissner
Committed by
Alexandre Julliard
Dec 17, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Fixed buffer overflow in number parsing.
parent
0e7ca586
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
dialog.c
dlls/msi/dialog.c
+10
-2
No files found.
dlls/msi/dialog.c
View file @
964a0303
...
@@ -2464,7 +2464,7 @@ static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control
...
@@ -2464,7 +2464,7 @@ static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control
{
{
LPCWSTR
text
=
MSI_RecordGetString
(
rec
,
10
);
LPCWSTR
text
=
MSI_RecordGetString
(
rec
,
10
);
LPCWSTR
begin
=
text
,
end
;
LPCWSTR
begin
=
text
,
end
;
WCHAR
num
[
10
]
;
WCHAR
*
num
;
LVCOLUMNW
lvc
;
LVCOLUMNW
lvc
;
DWORD
count
=
0
;
DWORD
count
=
0
;
...
@@ -2478,6 +2478,10 @@ static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control
...
@@ -2478,6 +2478,10 @@ static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control
if
(
!
(
end
=
strchrW
(
begin
,
'}'
)))
if
(
!
(
end
=
strchrW
(
begin
,
'}'
)))
return
;
return
;
num
=
msi_alloc
(
(
end
-
begin
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
!
num
)
return
;
lstrcpynW
(
num
,
begin
+
1
,
end
-
begin
);
lstrcpynW
(
num
,
begin
+
1
,
end
-
begin
);
begin
+=
end
-
begin
+
1
;
begin
+=
end
-
begin
+
1
;
...
@@ -2485,14 +2489,17 @@ static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control
...
@@ -2485,14 +2489,17 @@ static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control
if
(
!
num
[
0
]
||
!
lstrcmpW
(
num
,
zero
)
)
if
(
!
num
[
0
]
||
!
lstrcmpW
(
num
,
zero
)
)
{
{
count
++
;
count
++
;
msi_free
(
num
);
continue
;
continue
;
}
}
/* the width must be a positive number
/* the width must be a positive number
* if a width is invalid, all remaining columns are hidden
* if a width is invalid, all remaining columns are hidden
*/
*/
if
(
!
strncmpW
(
num
,
negative
,
1
)
||
!
str_is_number
(
num
)
)
if
(
!
strncmpW
(
num
,
negative
,
1
)
||
!
str_is_number
(
num
)
)
{
msi_free
(
num
);
return
;
return
;
}
ZeroMemory
(
&
lvc
,
sizeof
(
lvc
)
);
ZeroMemory
(
&
lvc
,
sizeof
(
lvc
)
);
lvc
.
mask
=
LVCF_TEXT
|
LVCF_WIDTH
|
LVCF_SUBITEM
;
lvc
.
mask
=
LVCF_TEXT
|
LVCF_WIDTH
|
LVCF_SUBITEM
;
...
@@ -2501,6 +2508,7 @@ static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control
...
@@ -2501,6 +2508,7 @@ static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control
SendMessageW
(
control
->
hwnd
,
LVM_INSERTCOLUMNW
,
count
++
,
(
LPARAM
)
&
lvc
);
SendMessageW
(
control
->
hwnd
,
LVM_INSERTCOLUMNW
,
count
++
,
(
LPARAM
)
&
lvc
);
msi_free
(
lvc
.
pszText
);
msi_free
(
lvc
.
pszText
);
msi_free
(
num
);
}
}
}
}
...
...
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