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
28184600
Commit
28184600
authored
Nov 30, 2011
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Dec 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Add validity checks for _mbstrlen_l.
parent
13aff6dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
mbcs.c
dlls/msvcrt/mbcs.c
+7
-8
No files found.
dlls/msvcrt/mbcs.c
View file @
28184600
...
...
@@ -1858,15 +1858,14 @@ MSVCRT_size_t CDECL _mbstrlen_l(const char* str, MSVCRT__locale_t locale)
locinfo
=
locale
->
locinfo
;
if
(
locinfo
->
mb_cur_max
>
1
)
{
MSVCRT_size_t
len
=
0
;
while
(
*
str
)
{
/* FIXME: According to the documentation we are supposed to test for
* multi-byte character validity. Whatever that means
*/
str
+=
MSVCRT_isleadbyte
(
*
str
)
?
2
:
1
;
len
++
;
MSVCRT_size_t
len
;
len
=
MultiByteToWideChar
(
locinfo
->
lc_codepage
,
MB_ERR_INVALID_CHARS
,
str
,
-
1
,
NULL
,
0
);
if
(
!
len
)
{
*
MSVCRT__errno
()
=
MSVCRT_EILSEQ
;
return
-
1
;
}
return
len
;
return
len
-
1
;
}
return
strlen
(
str
);
...
...
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