mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
tools/xl: fix possible uninitialized usage in printf_info()
printf_info_one_json() won't initialize the passed jso_r parameter on
error, and hence the usage in printf_info() needs prior initialization,
otherwise an uninitialized pointer is passed to json_object_put() on
failure.
Reported by the internal XenServer Coverity instance.
Fixes: f6c6f2679d ("libxl: Convert libxl__object_to_json() to json-c")
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
This commit is contained in:
1 parent
d0193c6d67
commit
439ebb0808
1 file changed
+1
-1
+1
-1
@@ -154,7 +154,7 @@ void printf_info(enum output_format output_format,
|
||||
#ifdef HAVE_LIBJSONC
|
||||
int r;
|
||||
const char *buf;
|
||||
json_object *jso;
|
||||
json_object *jso = NULL;
|
||||
|
||||
r = printf_info_one_json(&jso, domid, d_config);
|
||||
if (r)
|
||||
|
||||