From: Fam Zheng <famz@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH] vmdk: Fix vmdk_parse_extents
Date: Fri, 11 Oct 2013 19:30:15 +0800 [thread overview]
Message-ID: <20131011113015.GA17449@T430s.nay.redhat.com> (raw)
In-Reply-To: <20131011112351.GG3112@dhcp-200-207.str.redhat.com>
On Fri, 10/11 13:23, Kevin Wolf wrote:
> Am 11.10.2013 um 08:04 hat Fam Zheng geschrieben:
> > An extra 'p++' after while loop when *p == '\n' will move p to unknown
> > data position, risking parsing junk data or memory access violation.
> >
> > Cc: qemu-stable@nongnu.org
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> > block/vmdk.c | 7 +++++--
> > 1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/block/vmdk.c b/block/vmdk.c
> > index 5d56e31..f2dda21 100644
> > --- a/block/vmdk.c
> > +++ b/block/vmdk.c
> > @@ -760,10 +760,13 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
> > }
> > next_line:
> > /* move to next line */
> > - while (*p && *p != '\n') {
> > + while (*p) {
> > p++;
>
> If the first not yet parsed character is \n, you're missing a line break
> now, aren't you?
>
Yes. This case it can miss a whole line following an empty line. Will fix. Thanks.
Fam
prev parent reply other threads:[~2013-10-11 11:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-11 6:04 [Qemu-devel] [PATCH] vmdk: Fix vmdk_parse_extents Fam Zheng
2013-10-11 11:23 ` Kevin Wolf
2013-10-11 11:30 ` Fam Zheng [this message]
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=20131011113015.GA17449@T430s.nay.redhat.com \
--to=famz@redhat.com \
--cc=kwolf@redhat.com \
--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 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).