From: Jelmer Vernooij Date: Mon, 22 Dec 2008 17:53:19 +0000 (+0100) Subject: Fix segfault when there are no tests registered. X-Git-Tag: samba-4.0.0alpha6~419 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91f245ab5b39d377366934cdc1b57ebd89f3d33d;p=thirdparty%2Fsamba.git Fix segfault when there are no tests registered. --- diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c index 0c2c8c0f6bb..635990354ca 100644 --- a/source4/torture/smbtorture.c +++ b/source4/torture/smbtorture.c @@ -49,7 +49,7 @@ static bool run_matching(struct torture_context *torture, if (suite == NULL) { struct torture_suite *o; - for (o = torture_root->children; o; o = o->next) { + for (o = (torture_root == NULL?NULL:torture_root->children); o; o = o->next) { if (gen_fnmatch(expr, o->name) == 0) { *matched = true; reload_charcnv(torture->lp_ctx);