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
39e9ac03
Commit
39e9ac03
authored
Sep 11, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcp: Prevent overflows while operating on string sizes.
parent
5258b3a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
string.c
dlls/msvcp100/string.c
+6
-6
string.c
dlls/msvcp60/string.c
+10
-10
No files found.
dlls/msvcp100/string.c
View file @
39e9ac03
...
...
@@ -977,7 +977,7 @@ int __thiscall MSVCP_basic_string_char_compare_substr_cstr_len(
if
(
this
->
size
<
pos
)
MSVCP__String_base_Xran
();
if
(
pos
+
num
>
this
->
size
)
if
(
num
>
this
->
size
-
pos
)
num
=
this
->
size
-
pos
;
ans
=
MSVCP_char_traits_char_compare
(
basic_string_char_const_ptr
(
this
)
+
pos
,
...
...
@@ -1024,7 +1024,7 @@ int __thiscall MSVCP_basic_string_char_compare_substr_substr(
if
(
compare
->
size
<
off
)
MSVCP__String_base_Xran
();
if
(
off
+
count
>
compare
->
size
)
if
(
count
>
compare
->
size
-
off
)
count
=
compare
->
size
-
off
;
return
MSVCP_basic_string_char_compare_substr_cstr_len
(
this
,
pos
,
num
,
...
...
@@ -1512,7 +1512,7 @@ basic_string_char* __thiscall basic_string_char_replace_substr(basic_string_char
if
(
str
->
size
<
str_off
)
MSVCP__String_base_Xran
();
if
(
str_
off
+
str_len
>
str
->
size
)
if
(
str_
len
>
str
->
size
-
str_off
)
str_len
=
str
->
size
-
str_off
;
return
basic_string_char_replace_cstr_len
(
this
,
off
,
len
,
...
...
@@ -2690,7 +2690,7 @@ int __thiscall MSVCP_basic_string_wchar_compare_substr_cstr_len(
if
(
this
->
size
<
pos
)
MSVCP__String_base_Xran
();
if
(
pos
+
num
>
this
->
size
)
if
(
num
>
this
->
size
-
pos
)
num
=
this
->
size
-
pos
;
ans
=
MSVCP_char_traits_wchar_compare
(
basic_string_wchar_const_ptr
(
this
)
+
pos
,
...
...
@@ -2743,7 +2743,7 @@ int __thiscall MSVCP_basic_string_wchar_compare_substr_substr(
if
(
compare
->
size
<
off
)
MSVCP__String_base_Xran
();
if
(
off
+
count
>
compare
->
size
)
if
(
count
>
compare
->
size
-
off
)
count
=
compare
->
size
-
off
;
return
MSVCP_basic_string_wchar_compare_substr_cstr_len
(
this
,
pos
,
num
,
...
...
@@ -3218,7 +3218,7 @@ basic_string_wchar* __thiscall basic_string_wchar_replace_substr(basic_string_wc
if
(
str
->
size
<
str_off
)
MSVCP__String_base_Xran
();
if
(
str_
off
+
str_len
>
str
->
size
)
if
(
str_
len
>
str
->
size
-
str_off
)
str_len
=
str
->
size
-
str_off
;
return
basic_string_wchar_replace_cstr_len
(
this
,
off
,
len
,
...
...
dlls/msvcp60/string.c
View file @
39e9ac03
...
...
@@ -549,7 +549,7 @@ int __thiscall basic_string_char_compare_substr_cstr_len(
if
(
this
->
size
<
pos
)
_Xran
();
if
(
pos
+
num
>
this
->
size
)
if
(
num
>
this
->
size
-
pos
)
num
=
this
->
size
-
pos
;
ans
=
char_traits_char_compare
(
this
->
ptr
+
pos
,
...
...
@@ -586,7 +586,7 @@ int __thiscall basic_string_char_compare_substr_substr(
if
(
compare
->
size
<
off
)
_Xran
();
if
(
off
+
count
>
compare
->
size
)
if
(
count
>
compare
->
size
-
off
)
count
=
compare
->
size
-
off
;
return
basic_string_char_compare_substr_cstr_len
(
this
,
pos
,
num
,
...
...
@@ -1338,7 +1338,7 @@ basic_string_char* __thiscall basic_string_char_replace_cstr_len(basic_string_ch
if
(
this
->
size
<
off
)
_Xran
();
if
(
off
+
len
>
this
->
size
)
if
(
len
>
this
->
size
-
off
)
len
=
this
->
size
-
off
;
if
(
basic_string_char_npos
-
str_len
<=
this
->
size
-
len
)
...
...
@@ -1388,7 +1388,7 @@ basic_string_char* __thiscall basic_string_char_replace_substr(basic_string_char
if
(
str
->
size
<
str_off
)
_Xran
();
if
(
str_
off
+
str_len
>
str
->
size
)
if
(
str_
len
>
str
->
size
-
str_off
)
str_len
=
str
->
size
-
str_off
;
return
basic_string_char_replace_cstr_len
(
this
,
off
,
len
,
...
...
@@ -1418,7 +1418,7 @@ basic_string_char* __thiscall basic_string_char_replace_ch(basic_string_char *th
if
(
this
->
size
<
off
)
_Xran
();
if
(
off
+
len
>
this
->
size
)
if
(
len
>
this
->
size
-
off
)
len
=
this
->
size
-
off
;
if
(
basic_string_char_npos
-
count
<=
this
->
size
-
len
)
...
...
@@ -2239,7 +2239,7 @@ int __thiscall basic_string_wchar_compare_substr_cstr_len(
if
(
this
->
size
<
pos
)
_Xran
();
if
(
pos
+
num
>
this
->
size
)
if
(
num
>
this
->
size
-
pos
)
num
=
this
->
size
-
pos
;
ans
=
char_traits_wchar_compare
(
this
->
ptr
+
pos
,
...
...
@@ -2276,7 +2276,7 @@ int __thiscall basic_string_wchar_compare_substr_substr(
if
(
compare
->
size
<
off
)
_Xran
();
if
(
off
+
count
>
compare
->
size
)
if
(
count
>
compare
->
size
-
off
)
count
=
compare
->
size
-
off
;
return
basic_string_wchar_compare_substr_cstr_len
(
this
,
pos
,
num
,
...
...
@@ -3028,7 +3028,7 @@ basic_string_wchar* __thiscall basic_string_wchar_replace_cstr_len(basic_string_
if
(
this
->
size
<
off
)
_Xran
();
if
(
off
+
len
>
this
->
size
)
if
(
len
>
this
->
size
-
off
)
len
=
this
->
size
-
off
;
if
(
basic_string_wchar_npos
-
str_len
<=
this
->
size
-
len
)
...
...
@@ -3078,7 +3078,7 @@ basic_string_wchar* __thiscall basic_string_wchar_replace_substr(basic_string_wc
if
(
str
->
size
<
str_off
)
_Xran
();
if
(
str_
off
+
str_len
>
str
->
size
)
if
(
str_
len
>
str
->
size
-
str_off
)
str_len
=
str
->
size
-
str_off
;
return
basic_string_wchar_replace_cstr_len
(
this
,
off
,
len
,
...
...
@@ -3108,7 +3108,7 @@ basic_string_wchar* __thiscall basic_string_wchar_replace_ch(basic_string_wchar
if
(
this
->
size
<
off
)
_Xran
();
if
(
off
+
len
>
this
->
size
)
if
(
len
>
this
->
size
-
off
)
len
=
this
->
size
-
off
;
if
(
basic_string_wchar_npos
-
count
<=
this
->
size
-
len
)
...
...
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