From: Wei Liu Date: Wed, 20 Jul 2016 14:13:42 +0000 (+0100) Subject: xenstore: add assertion in database dumping code X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~716 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=368574c0b79b1e67b211fe7ad5d1bc1601b0c24b;p=xen.git xenstore: add assertion in database dumping code If memfile is NULL, the signal handler won't be installed, hence fopen won't dereference NULL. Coverity is not smart enough to figure that out unfortunately. Add an assertion to prevent coverity from complaining. Signed-off-by: Wei Liu Acked-by: Ian Jackson --- diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c index 5b2a49bd84..693d47d4d1 100644 --- a/tools/xenstore/xenstored_core.c +++ b/tools/xenstore/xenstored_core.c @@ -2135,6 +2135,7 @@ int main(int argc, char *argv[]) if (trigger_talloc_report) { FILE *out; + assert(memfile); trigger_talloc_report = false; out = fopen(memfile, "a"); if (out) {