diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 2807f3559a..1493332841 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -1589,11 +1589,15 @@ int main(int argc, char *argv[]) false, false, false))) goto cleanup; - VIR_DEBUG("Security model %s type %s label %s imagelabel %s", - NULLSTR(ctrl->def->seclabels[0]->model), - virDomainSeclabelTypeToString(ctrl->def->seclabels[0]->type), - NULLSTR(ctrl->def->seclabels[0]->label), - NULLSTR(ctrl->def->seclabels[0]->imagelabel)); + if (ctrl->def->seclabels) { + VIR_DEBUG("Security model %s type %s label %s imagelabel %s", + NULLSTR(ctrl->def->seclabels[0]->model), + virDomainSeclabelTypeToString(ctrl->def->seclabels[0]->type), + NULLSTR(ctrl->def->seclabels[0]->label), + NULLSTR(ctrl->def->seclabels[0]->imagelabel)); + } else { + VIR_DEBUG("Security model not initialized"); + } ctrl->veths = veths; ctrl->nveths = nveths;