From: Connor Kuehl <ckuehl@redhat.com>
To: kwolf@redhat.com, mreitz@redhat.com
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [PATCH v3] block: Raise an error when backing file parameter is an empty string
Date: Tue, 25 Aug 2020 16:57:58 -0500 [thread overview]
Message-ID: <0977d901-c2fd-40b9-f694-914e1b895653@redhat.com> (raw)
In-Reply-To: <20200813134722.802180-1-ckuehl@redhat.com>
On 8/13/20 8:47 AM, Connor Kuehl wrote:
> Providing an empty string for the backing file parameter like so:
>
> qemu-img create -f qcow2 -b '' /tmp/foo
>
> allows the flow of control to reach and subsequently fail an assert
> statement because passing an empty string to
>
> bdrv_get_full_backing_filename_from_filename()
>
> simply results in NULL being returned without an error being raised.
>
> To fix this, let's check for an empty string when getting the value from
> the opts list.
>
> Reported-by: Attila Fazekas <afazekas@redhat.com>
> Fixes: https://bugzilla.redhat.com/1809553
> Signed-off-by: Connor Kuehl <ckuehl@redhat.com>
> ---
> v3:
> - Moved test case into 049 instead of taking up
> 298.
>
> v2:
> - Removed 4 spaces to resolve pylint warning
> - Updated format to be 'iotests.imgfmt' instead
> of hardcoding 'qcow2'
> - Use temporary file instead of '/tmp/foo'
> - Give a size parameter to qemu-img
> - Run test for qcow2, qcow, qed and *not* raw
Ping
next prev parent reply other threads:[~2020-08-25 21:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-13 13:47 [PATCH v3] block: Raise an error when backing file parameter is an empty string Connor Kuehl
2020-08-25 21:57 ` Connor Kuehl [this message]
2020-08-26 13:22 ` Kevin Wolf
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=0977d901-c2fd-40b9-f694-914e1b895653@redhat.com \
--to=ckuehl@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).