From a30724304cda3fa7eff8077057aa5d255b42d5ce Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Mon, 1 Dec 2008 14:03:55 +0100 Subject: [PATCH] kernel32/tests: logfile can be NULL, avoid dereferencing it (Coverity). --- dlls/kernel32/tests/debugger.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/tests/debugger.c b/dlls/kernel32/tests/debugger.c index 0b943f29a0a..014f390be99 100644 --- a/dlls/kernel32/tests/debugger.c +++ b/dlls/kernel32/tests/debugger.c @@ -158,7 +158,11 @@ static void doDebugger(int argc, char** argv) else blackbox.debug_rc=TRUE; - get_events(logfile, &start_event, &done_event); + if (logfile) + { + get_events(logfile, &start_event, &done_event); + } + if (strstr(myARGV[2], "order")) { trace("debugger: waiting for the start signal...\n"); @@ -185,7 +189,10 @@ static void doDebugger(int argc, char** argv) else blackbox.detach_rc=TRUE; - save_blackbox(logfile, &blackbox, sizeof(blackbox)); + if (logfile) + { + save_blackbox(logfile, &blackbox, sizeof(blackbox)); + } trace("debugger: done debugging...\n"); SetEvent(done_event);