From: Li Qiang <liq3ea@gmail.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: "Vikram Garhwal" <fnu.vikram@xilinx.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Qemu Developers" <qemu-devel@nongnu.org>,
"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
"Cleber Rosa" <crosa@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Pavel Pisa" <pisa@cmp.felk.cvut.cz>
Subject: Re: [PATCH 1/3] authz-list-file: Fix crash when filename is not set
Date: Fri, 9 Oct 2020 23:06:23 +0800 [thread overview]
Message-ID: <CAKXe6SJMtw3rnHp8nCtUZMATSA39aqS2=G=ihHWav40UifXi4A@mail.gmail.com> (raw)
In-Reply-To: <20201008202713.1416823-2-ehabkost@redhat.com>
Eduardo Habkost <ehabkost@redhat.com> 于2020年10月9日周五 上午4:28写道:
>
> 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: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
> ---
> Cc: "Daniel P. Berrangé" <berrange@redhat.com>
> Cc: qemu-devel@nongnu.org
> ---
> authz/listfile.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/authz/listfile.c b/authz/listfile.c
> index cd6163aa40..aaf930453d 100644
> --- a/authz/listfile.c
> +++ b/authz/listfile.c
> @@ -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) {
> --
> 2.26.2
>
>
next prev parent reply other threads:[~2020-10-09 15:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-08 20:27 [PATCH 0/3] Fix some crashes when using -object Eduardo Habkost
2020-10-08 20:27 ` [PATCH 1/3] authz-list-file: Fix crash when filename is not set Eduardo Habkost
2020-10-08 21:17 ` Cleber Rosa
2020-10-09 8:37 ` Daniel P. Berrangé
2020-10-09 10:31 ` Philippe Mathieu-Daudé
2020-10-09 15:06 ` Li Qiang [this message]
2020-10-08 20:27 ` [PATCH 2/3] can-host-socketcan: Fix crash when 'if' option " Eduardo Habkost
2020-10-08 22:18 ` Pavel Pisa
2020-10-09 15:17 ` Li Qiang
2020-10-12 16:23 ` Vikram Garhwal
2020-10-08 20:27 ` [PATCH 3/3] tests/acceptance: Test case for detecting -object crashes Eduardo Habkost
2020-10-09 0:48 ` Cleber Rosa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAKXe6SJMtw3rnHp8nCtUZMATSA39aqS2=G=ihHWav40UifXi4A@mail.gmail.com' \
--to=liq3ea@gmail.com \
--cc=berrange@redhat.com \
--cc=crosa@redhat.com \
--cc=ehabkost@redhat.com \
--cc=fnu.vikram@xilinx.com \
--cc=jasowang@redhat.com \
--cc=philmd@redhat.com \
--cc=pisa@cmp.felk.cvut.cz \
--cc=qemu-devel@nongnu.org \
--cc=wainersm@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).