From: Andrew Cooper Date: Thu, 13 Mar 2014 11:09:07 +0000 (+0000) Subject: tools/mfndump: Avoid unintentional NULL dereference X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e927d4be842cf44e8f0c92fb8c077a0e0f0383bb;p=people%2Fliuw%2Flibxenctrl-split%2Fxen.git tools/mfndump: Avoid unintentional NULL dereference If we failed to open an xc interface, using xch to log an error will end in tears. Print to stderr instead, as we are bailing immediately later. Signed-off-by: Andrew Cooper Coverity-id: 1191885 Acked-by: Ian Campbell CC: Ian Jackson Acked-by: Dario Faggioli --- diff --git a/tools/misc/xen-mfndump.c b/tools/misc/xen-mfndump.c index 8064527ecf..e1ea536754 100644 --- a/tools/misc/xen-mfndump.c +++ b/tools/misc/xen-mfndump.c @@ -400,7 +400,7 @@ int main(int argc, char *argv[]) xch = xc_interface_open(0, 0, 0); if ( !xch ) { - ERROR("Failed to open an xc handler"); + fprintf(stderr, "Failed to open an xc handler"); return 1; }