[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v2 1/3] dmg: fix binary search

From: Stefan Hajnoczi
Subject: Re: [Qemu-block] [PATCH v2 1/3] dmg: fix binary search
Date: Thu, 3 Jan 2019 10:09:23 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

On Wed, Jan 02, 2019 at 08:20:54PM +0800, 林育辰 wrote:
> This series is focus on fixing bug #1809304 (see:
> https://bugs.launchpad.net/qemu/+bug/1809304).
> There is an example dmg file in #1809304 which will trigger this bug.

Thanks.  It would be great to include a tiny dmg file in
tests/qemu-iotests/sample_images/ and add a test case for it.

The file should be small (kilobytes, not megabytes) and must be
redistributable (no proprietary content or even GPL software, which
requires distributing source code).

Do you have time to do that?

> About your case, I think we can simply check whether chunk3 is zero before
> we decrease it.
> if s->sectors[chunk3] > sector_num and chunk3 is zero (i.e. s->sectors[0] >
> sector_num), it means we cannot find the table contains sector_num.
> We can return s->n_chunks (error) directly.
> What do you think?

Sounds good.  We have to assume that the file contents are invalid and
handle all cases.

I'll review the next revision of your patch.  Thanks!


Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]