tools/xenstore: fix use after free bug in xenstore_control
PATCH 1/1 tools/xenstore: fix use after free bug in xenstore_control
There is a very unlikely use after free bug and a memory leak in live_update_start() of xenstore_control. Fix those.
Coverity-Id: 1472399
Fixes 7f97193e6aa858 ("tools/xenstore: add live update command to xenstore-control")
Signed-off-by Juergen Gross <[email protected]>
--- tools/xenstore/xenstore_control.c | 5 +++++ 1 file changed, 5 insertions(+)
tools/xenstore/xenstore_control.c +5 -0
@@ -43,7 +43,12 @@ static int live_update_start(struct xs_handle *xsh, bool force, unsigned int to)if (len <0 )return 1 ; + ret =strdup ("BUSY" ); +if (!ret) +return 1 ; +for (time_start =time (NULL );time (NULL ) - time_start < to;) { +free (ret); ret =xs_control_command (xsh,"live-update" , buf, len);if (!ret) goto err;
Signature · 1 line
2.26.2
Quoted 6 lines · Juergen Gross
There is a very unlikely use after free bug and a memory leak in
live_update_start()ofxenstore_control. Fix those.Coverity-Id: 1472399
Fixes 7f97193e6aa858 ("tools/xenstore: add live update command to xenstore-control")Signed-off-by Juergen Gross <[email protected]>
Acked-by Andrew Cooper <[email protected]>