|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen staging] tools/libxl: avoid freeing stack rubble in libxl__json_object_to_json()
commit 3539308d8206e64526f66726f5514330f2ff10d5
Author: Roger Pau Monne <roger.pau@xxxxxxxxxx>
AuthorDate: Wed Oct 15 14:02:17 2025 +0200
Commit: Roger Pau Monne <roger.pau@xxxxxxxxxx>
CommitDate: Thu Oct 16 17:20:18 2025 +0200
tools/libxl: avoid freeing stack rubble in libxl__json_object_to_json()
It's possible for libxl__json_object_to_json_object() to not set the passed
jso_out parameter, hence initialize it in libxl__json_object_to_json() to
avoid freeing an uninitialized pointer in case of failure.
Reported by XenServer internal Coverity instance.
Fixes: 75fa670e582c ("libxl: Convert libxl__json_object_to_json() to
json_object")
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
---
tools/libs/light/libxl_json.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/libs/light/libxl_json.c b/tools/libs/light/libxl_json.c
index e895cca4cf..68f36901c2 100644
--- a/tools/libs/light/libxl_json.c
+++ b/tools/libs/light/libxl_json.c
@@ -1531,7 +1531,7 @@ char *libxl__json_object_to_json(libxl__gc *gc,
{
#ifdef HAVE_LIBJSONC
const char *buf;
- json_object *root;
+ json_object *root = NULL;
char *ret = NULL;
int rc;
--
generated by git-patchbot for /home/xen/git/xen.git#staging
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |