From: Gaurav Singh Date: Sat, 13 Jun 2020 23:15:50 +0000 (-0400) Subject: containertests: fix null pointer defereference X-Git-Tag: lxc-5.0.0~418^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3815ebccdb1e83cb2f3c8d5f94607fbffcc2f5c1;p=thirdparty%2Flxc.git containertests: fix null pointer defereference Signed-off-by: Gaurav Singh --- diff --git a/src/tests/containertests.c b/src/tests/containertests.c index b28bcd56d..0fb6fbdfb 100644 --- a/src/tests/containertests.c +++ b/src/tests/containertests.c @@ -135,7 +135,7 @@ int main(int argc, char *argv[]) str = c->config_file_name(c); #define CONFIGFNAM LXCPATH "/" MYNAME "/config" - if (!str || strcmp(str, CONFIGFNAM)) { + if (str && strcmp(str, CONFIGFNAM)) { fprintf(stderr, "%d: got wrong config file name (%s, not %s)\n", __LINE__, str, CONFIGFNAM); goto out; }