[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH v2] block/vvfat: Fix crash when rep
From: |
Thomas Huth |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH v2] block/vvfat: Fix crash when reporting error about too many files in directory |
Date: |
Thu, 4 Oct 2018 09:36:46 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 2018-07-24 13:52, Thomas Huth wrote:
> When using the vvfat driver with a directory that contains too many files,
> QEMU currently crashes. This can be triggered like this for example:
>
> mkdir /tmp/vvfattest
> cd /tmp/vvfattest
> for ((x=0;x<=513;x++)); do mkdir $x; done
> qemu-system-x86_64 -drive \
> file.driver=vvfat,file.dir=.,read-only=on,media=cdrom
>
> Seems like read_directory() is changing the mapping->path variable. Make
> sure we use the right pointer instead.
>
> Signed-off-by: Thomas Huth <address@hidden>
> ---
> block/vvfat.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/block/vvfat.c b/block/vvfat.c
> index fc41841..f2e7d50 100644
> --- a/block/vvfat.c
> +++ b/block/vvfat.c
> @@ -973,10 +973,10 @@ static int init_directories(BDRVVVFATState* s,
> mapping = array_get(&(s->mapping), i);
>
> if (mapping->mode & MODE_DIRECTORY) {
> + char *path = mapping->path;
> mapping->begin = cluster;
> if(read_directory(s, i)) {
> - error_setg(errp, "Could not read directory %s",
> - mapping->path);
> + error_setg(errp, "Could not read directory %s", path);
> return -1;
> }
> mapping = array_get(&(s->mapping), i);
>
Ping?
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-block] [Qemu-devel] [PATCH v2] block/vvfat: Fix crash when reporting error about too many files in directory,
Thomas Huth <=