xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools/mfndump: Avoid deliberate NULL dereference
@ 2014-03-12 21:04 Andrew Cooper
  2014-03-13 11:06 ` Ian Campbell
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cooper @ 2014-03-12 21:04 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Dario Faggioli, Ian Jackson, Ian Campbell

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 <andrew.cooper3@citrix.com>
Coverity-id: 1191885
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Dario Faggioli <dario.faggioli@citrix.com>

---

This is why macros depending on variables in scope, particularly ones named
as simily as "ERROR", are evil.
---
 tools/misc/xen-mfndump.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/misc/xen-mfndump.c b/tools/misc/xen-mfndump.c
index 8064527..e1ea536 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;
     }
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-03-13 18:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-12 21:04 [PATCH] tools/mfndump: Avoid deliberate NULL dereference Andrew Cooper
2014-03-13 11:06 ` Ian Campbell
2014-03-13 11:09   ` [PATCH v2] tools/mfndump: Avoid unintentional " Andrew Cooper
2014-03-13 12:53     ` Dario Faggioli
2014-03-13 18:04       ` Ian Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).