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
0d0b7a14
Commit
0d0b7a14
authored
Dec 04, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Always check for errors in UTF8 conversions.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b8284246
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
global.c
dlls/jscript/global.c
+6
-6
No files found.
dlls/jscript/global.c
View file @
0d0b7a14
...
...
@@ -629,7 +629,7 @@ static HRESULT JSGlobal_encodeURI(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
if
(
is_uri_unescaped
(
*
ptr
)
||
is_uri_reserved
(
*
ptr
)
||
*
ptr
==
'#'
)
{
len
++
;
}
else
{
i
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
ptr
,
1
,
NULL
,
0
,
NULL
,
NULL
)
*
3
;
i
=
WideCharToMultiByte
(
CP_UTF8
,
WC_ERR_INVALID_CHARS
,
ptr
,
1
,
NULL
,
0
,
NULL
,
NULL
)
*
3
;
if
(
!
i
)
{
jsstr_release
(
str
);
return
throw_uri_error
(
ctx
,
JS_E_INVALID_URI_CHAR
,
NULL
);
...
...
@@ -649,7 +649,7 @@ static HRESULT JSGlobal_encodeURI(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
if
(
is_uri_unescaped
(
*
ptr
)
||
is_uri_reserved
(
*
ptr
)
||
*
ptr
==
'#'
)
{
*
rptr
++
=
*
ptr
;
}
else
{
len
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
ptr
,
1
,
buf
,
sizeof
(
buf
),
NULL
,
NULL
);
len
=
WideCharToMultiByte
(
CP_UTF8
,
WC_ERR_INVALID_CHARS
,
ptr
,
1
,
buf
,
sizeof
(
buf
),
NULL
,
NULL
);
for
(
i
=
0
;
i
<
len
;
i
++
)
{
*
rptr
++
=
'%'
;
*
rptr
++
=
int_to_char
((
BYTE
)
buf
[
i
]
>>
4
);
...
...
@@ -703,7 +703,7 @@ static HRESULT JSGlobal_decodeURI(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
val
+=
hex_to_int
(
ptr
[
i
*
3
+
1
])
<<
4
;
buf
[
i
]
=
val
;
res
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
buf
,
i
+
1
,
&
out
,
1
);
res
=
MultiByteToWideChar
(
CP_UTF8
,
MB_ERR_INVALID_CHARS
,
buf
,
i
+
1
,
&
out
,
1
);
if
(
res
)
break
;
}
...
...
@@ -734,7 +734,7 @@ static HRESULT JSGlobal_decodeURI(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
val
+=
hex_to_int
(
ptr
[
i
*
3
+
1
])
<<
4
;
buf
[
i
]
=
val
;
res
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
buf
,
i
+
1
,
ret
,
1
);
res
=
MultiByteToWideChar
(
CP_UTF8
,
MB_ERR_INVALID_CHARS
,
buf
,
i
+
1
,
ret
,
1
);
if
(
res
)
break
;
}
...
...
@@ -780,7 +780,7 @@ static HRESULT JSGlobal_encodeURIComponent(script_ctx_t *ctx, vdisp_t *jsthis, W
if
(
is_uri_unescaped
(
*
ptr
))
len
++
;
else
{
size
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
ptr
,
1
,
NULL
,
0
,
NULL
,
NULL
);
size
=
WideCharToMultiByte
(
CP_UTF8
,
WC_ERR_INVALID_CHARS
,
ptr
,
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
!
size
)
{
jsstr_release
(
str
);
return
throw_uri_error
(
ctx
,
JS_E_INVALID_URI_CHAR
,
NULL
);
...
...
@@ -799,7 +799,7 @@ static HRESULT JSGlobal_encodeURIComponent(script_ctx_t *ctx, vdisp_t *jsthis, W
if
(
is_uri_unescaped
(
*
ptr
))
{
*
ret
++
=
*
ptr
;
}
else
{
size
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
ptr
,
1
,
buf
,
sizeof
(
buf
),
NULL
,
NULL
);
size
=
WideCharToMultiByte
(
CP_UTF8
,
WC_ERR_INVALID_CHARS
,
ptr
,
1
,
buf
,
sizeof
(
buf
),
NULL
,
NULL
);
for
(
i
=
0
;
i
<
size
;
i
++
)
{
*
ret
++
=
'%'
;
*
ret
++
=
int_to_char
((
BYTE
)
buf
[
i
]
>>
4
);
...
...
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