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
8f82586f
Commit
8f82586f
authored
Nov 03, 2023
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Nov 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Fix value arg leak in transform_json_object.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
aa18bbed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
json.c
dlls/jscript/json.c
+8
-6
No files found.
dlls/jscript/json.c
View file @
8f82586f
...
@@ -295,7 +295,7 @@ static jsval_t transform_json_object(struct transform_json_object_ctx *proc_ctx,
...
@@ -295,7 +295,7 @@ static jsval_t transform_json_object(struct transform_json_object_ctx *proc_ctx,
if
(
!
obj
)
{
if
(
!
obj
)
{
FIXME
(
"non-JS obj in JSON object: %p
\n
"
,
get_object
(
args
[
1
]));
FIXME
(
"non-JS obj in JSON object: %p
\n
"
,
get_object
(
args
[
1
]));
proc_ctx
->
hres
=
E_NOTIMPL
;
proc_ctx
->
hres
=
E_NOTIMPL
;
return
jsval_undefined
()
;
goto
ret
;
}
else
if
(
is_class
(
obj
,
JSCLASS_ARRAY
))
{
}
else
if
(
is_class
(
obj
,
JSCLASS_ARRAY
))
{
unsigned
i
,
length
=
array_get_length
(
obj
);
unsigned
i
,
length
=
array_get_length
(
obj
);
WCHAR
buf
[
14
],
*
buf_end
;
WCHAR
buf
[
14
],
*
buf_end
;
...
@@ -306,13 +306,13 @@ static jsval_t transform_json_object(struct transform_json_object_ctx *proc_ctx,
...
@@ -306,13 +306,13 @@ static jsval_t transform_json_object(struct transform_json_object_ctx *proc_ctx,
str
=
idx_to_str
(
i
,
buf_end
);
str
=
idx_to_str
(
i
,
buf_end
);
if
(
!
(
jsstr
=
jsstr_alloc
(
str
)))
{
if
(
!
(
jsstr
=
jsstr_alloc
(
str
)))
{
proc_ctx
->
hres
=
E_OUTOFMEMORY
;
proc_ctx
->
hres
=
E_OUTOFMEMORY
;
return
jsval_undefined
()
;
goto
ret
;
}
}
res
=
transform_json_object
(
proc_ctx
,
obj
,
jsstr
);
res
=
transform_json_object
(
proc_ctx
,
obj
,
jsstr
);
jsstr_release
(
jsstr
);
jsstr_release
(
jsstr
);
if
(
is_undefined
(
res
))
{
if
(
is_undefined
(
res
))
{
if
(
FAILED
(
proc_ctx
->
hres
))
if
(
FAILED
(
proc_ctx
->
hres
))
return
jsval_undefined
()
;
goto
ret
;
if
(
FAILED
(
jsdisp_get_id
(
obj
,
str
,
0
,
&
id
)))
if
(
FAILED
(
jsdisp_get_id
(
obj
,
str
,
0
,
&
id
)))
continue
;
continue
;
proc_ctx
->
hres
=
disp_delete
((
IDispatch
*
)
&
obj
->
IDispatchEx_iface
,
id
,
&
b
);
proc_ctx
->
hres
=
disp_delete
((
IDispatch
*
)
&
obj
->
IDispatchEx_iface
,
id
,
&
b
);
...
@@ -321,7 +321,7 @@ static jsval_t transform_json_object(struct transform_json_object_ctx *proc_ctx,
...
@@ -321,7 +321,7 @@ static jsval_t transform_json_object(struct transform_json_object_ctx *proc_ctx,
jsval_release
(
res
);
jsval_release
(
res
);
}
}
if
(
FAILED
(
proc_ctx
->
hres
))
if
(
FAILED
(
proc_ctx
->
hres
))
return
jsval_undefined
()
;
goto
ret
;
}
}
}
else
{
}
else
{
id
=
DISPID_STARTENUM
;
id
=
DISPID_STARTENUM
;
...
@@ -330,7 +330,7 @@ static jsval_t transform_json_object(struct transform_json_object_ctx *proc_ctx,
...
@@ -330,7 +330,7 @@ static jsval_t transform_json_object(struct transform_json_object_ctx *proc_ctx,
if
(
proc_ctx
->
hres
==
S_FALSE
)
if
(
proc_ctx
->
hres
==
S_FALSE
)
break
;
break
;
if
(
FAILED
(
proc_ctx
->
hres
)
||
FAILED
(
proc_ctx
->
hres
=
jsdisp_get_prop_name
(
obj
,
id
,
&
jsstr
)))
if
(
FAILED
(
proc_ctx
->
hres
)
||
FAILED
(
proc_ctx
->
hres
=
jsdisp_get_prop_name
(
obj
,
id
,
&
jsstr
)))
return
jsval_undefined
()
;
goto
ret
;
res
=
transform_json_object
(
proc_ctx
,
obj
,
jsstr
);
res
=
transform_json_object
(
proc_ctx
,
obj
,
jsstr
);
if
(
is_undefined
(
res
))
{
if
(
is_undefined
(
res
))
{
if
(
SUCCEEDED
(
proc_ctx
->
hres
))
if
(
SUCCEEDED
(
proc_ctx
->
hres
))
...
@@ -344,7 +344,7 @@ static jsval_t transform_json_object(struct transform_json_object_ctx *proc_ctx,
...
@@ -344,7 +344,7 @@ static jsval_t transform_json_object(struct transform_json_object_ctx *proc_ctx,
}
}
jsstr_release
(
jsstr
);
jsstr_release
(
jsstr
);
if
(
FAILED
(
proc_ctx
->
hres
))
if
(
FAILED
(
proc_ctx
->
hres
))
return
jsval_undefined
()
;
goto
ret
;
}
}
}
}
}
}
...
@@ -352,6 +352,8 @@ static jsval_t transform_json_object(struct transform_json_object_ctx *proc_ctx,
...
@@ -352,6 +352,8 @@ static jsval_t transform_json_object(struct transform_json_object_ctx *proc_ctx,
args
[
0
]
=
jsval_string
(
name
);
args
[
0
]
=
jsval_string
(
name
);
proc_ctx
->
hres
=
disp_call_value
(
proc_ctx
->
ctx
,
proc_ctx
->
reviver
,
jsval_obj
(
holder
),
proc_ctx
->
hres
=
disp_call_value
(
proc_ctx
->
ctx
,
proc_ctx
->
reviver
,
jsval_obj
(
holder
),
DISPATCH_METHOD
,
ARRAY_SIZE
(
args
),
args
,
&
res
);
DISPATCH_METHOD
,
ARRAY_SIZE
(
args
),
args
,
&
res
);
ret:
jsval_release
(
args
[
1
]);
return
FAILED
(
proc_ctx
->
hres
)
?
jsval_undefined
()
:
res
;
return
FAILED
(
proc_ctx
->
hres
)
?
jsval_undefined
()
:
res
;
}
}
...
...
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