libxl: Don't derefence null new_name pointer in libxl_domain_rename()
PATCH 1/1 libxl: Don't derefence null new_name pointer in libxl_domain_rename()
libxl__domain_rename() unconditionally dereferences its new_name
parameter, to check whether it is an empty string. Add a check to
avoid a segfault if new_name is null.
--- tools/libxl/libxl.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
tools/libxl/libxl.c +7 -0
@@ -385,6 +385,13 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid, } } +if (!new_name) { +LIBXL__LOG (ctx,LIBXL__LOG_ERROR , +"new domain name not specified" ); + rc =ERROR_INVAL ; + goto x_rc; + } +if (new_name[0 ]) {/* nonempty names must be unique */ uint32_t domid_e;
Signature · 1 line
1.7.1
Quoted 5 lines · Euan Harris
libxl__domain_rename()unconditionally dereferences itsnew_name
parameter, to check whether it is an empty string. Add a check to
avoid a segfault ifnew_nameis null.Signed-off-by Euan Harris <[email protected]>
I think this is a good fix to have for 4.5, Konrad CCd.
Quoted 22 lines
--- tools/libxl/libxl.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)tools/libxl/libxl.c +7
-0@@ -385,6 +385,13 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid, } } +if (!new_name) { +LIBXL__LOG (ctx,LIBXL__LOG_ERROR , +"new domain name not specified" ); + rc =ERROR_INVAL ; + goto x_rc; + } +if (new_name[0 ]) {/* nonempty names must be unique */ uint32_t domid_e;
Quoted 10 lines · Ian Campbell
Quoted 5 lines · Euan Harris
libxl__domain_rename()unconditionally dereferences itsnew_name
parameter, to check whether it is an empty string. Add a check to
avoid a segfault ifnew_nameis null.Signed-off-by Euan Harris <[email protected]>Acked-by Ian Campbell <[email protected]>I think this is a good fix to have for 4.5, Konrad CCd.
Quoted 25 lines
Quoted 23 lines
--- tools/libxl/libxl.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)tools/libxl/libxl.c +7
-0@@ -385,6 +385,13 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid, } } +if (!new_name) { +LIBXL__LOG (ctx,LIBXL__LOG_ERROR , +"new domain name not specified" ); + rc =ERROR_INVAL ; + goto x_rc; + } +if (new_name[0 ]) {/* nonempty names must be unique */ uint32_t domid_e;
Ian Campbell
AppliedQuoted 6 lines · Konrad Rzeszutek Wilk
Quoted 5 lines · Ian Campbell
Quoted 4 lines · Euan Harris
libxl__domain_rename()unconditionally dereferences itsnew_name
parameter, to check whether it is an empty string. Add a check to
avoid a segfault ifnew_nameis null.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Euan Harris <[email protected]>Acked-by Ian Campbell <[email protected]>I think this is a good fix to have for 4.5, Konrad CCd.
Release-Acked-by Konrad Rzeszutek Wilk <[email protected]>
Applied, fixing the typo in the subject as I went.