Skip to content
Snippets Groups Projects
Commit 14b39485 authored by Eduardo Habkost's avatar Eduardo Habkost
Browse files

authz-list-file: Fix crash when filename is not set


Fix the following crash:

  $ qemu-system-x86_64 -object authz-list-file,id=obj0
  qemu-system-x86_64: -object authz-list-file,id=obj0: GLib: g_file_get_contents: assertion 'filename != NULL' failed
  Segmentation fault (core dumped)

Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: default avatarLi Qiang <liq3ea@gmail.com>
Message-Id: <20201008202713.1416823-2-ehabkost@redhat.com>
Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
parent abb93698
No related branches found
No related tags found
No related merge requests found
......@@ -122,6 +122,11 @@ qauthz_list_file_complete(UserCreatable *uc, Error **errp)
QAuthZListFile *fauthz = QAUTHZ_LIST_FILE(uc);
gchar *dir = NULL, *file = NULL;
if (!fauthz->filename) {
error_setg(errp, "filename not provided");
return;
}
fauthz->list = qauthz_list_file_load(fauthz, errp);
if (!fauthz->refresh) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment