All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yu-Chen Lin <npes87184@gmail.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 1/3] dmg: fix binary search
Date: Thu, 3 Jan 2019 19:40:10 +0800	[thread overview]
Message-ID: <CAPTqjH1x+ZJ9HnsaZ61KQGv-qksHuSm6KDy0P0-zW633tT8ttQ@mail.gmail.com> (raw)
In-Reply-To: <20190103100923.GC7733@stefanha-x1.localdomain>

Stefan Hajnoczi <stefanha@redhat.com> 於 2019年1月3日 週四 下午6:09寫道:

> 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?
>

Sure!


>
> > 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!
>

Thanks!

Yu-Chen Lin


> Stefan
>

  reply	other threads:[~2019-01-03 11:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-23  2:59 [Qemu-devel] [PATCH v2 0/3] dmg: fixing reading in dmg yuchenlin
2018-12-23  2:59 ` [Qemu-devel] [PATCH v2 1/3] dmg: fix binary search yuchenlin
2018-12-24 15:27   ` Julio Faracco
2019-01-02 11:49   ` Stefan Hajnoczi
2019-01-02 12:20     ` 林育辰
2019-01-03 10:09       ` Stefan Hajnoczi
2019-01-03 11:40         ` Yu-Chen Lin [this message]
2018-12-23  2:59 ` [Qemu-devel] [PATCH v2 2/3] dmg: use enumeration type instead of hard coding number yuchenlin
2018-12-24 15:28   ` Julio Faracco
2019-01-02 11:49   ` Stefan Hajnoczi
2018-12-23  2:59 ` [Qemu-devel] [PATCH v2 3/3] dmg: don't skip zero chunk yuchenlin
2018-12-24 15:28   ` Julio Faracco
2019-01-02 12:40   ` Stefan Hajnoczi
2018-12-24 15:26 ` [Qemu-devel] [Qemu-block] [PATCH v2 0/3] dmg: fixing reading in dmg Julio Faracco

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=CAPTqjH1x+ZJ9HnsaZ61KQGv-qksHuSm6KDy0P0-zW633tT8ttQ@mail.gmail.com \
    --to=npes87184@gmail.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.