qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/2] libcacard: fix soft=... parsing in vcard_em


From: Christophe Fergeau
Subject: Re: [Qemu-devel] [PATCH 1/2] libcacard: fix soft=... parsing in vcard_emul_options
Date: Mon, 27 Jun 2011 14:13:02 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Jun 24, 2011 at 06:51:51PM +0200, Alon Levy wrote:
> On Fri, Jun 24, 2011 at 04:37:39PM +0200, Christophe Fergeau wrote:
> > The previous parser had copy and paste errors when computing
> > vname_length and type_params_length, "name" was used instead
> > of respectively vname and type_params. This led to length that could
> > be bigger than the input string, and to access out of the array
> > bounds when trying to copy these strings. valgrind rightfully
> > complained about this. It also didn't handle empty fields correctly,
> > and there were some args = strip(args++); which also didn't do what
> > was expected.
> 
> Aren't there token parsing functions in libc that can be used if we
> want to fix the repetitiveness?

The only token parsing function I know of in libc is strtok{_r} which
modifies the input string, so it's not very well suited here. I'm not a
libc specialist though, so there might be some functions in libc (or qemu
helpers) that I don't know of. 

Christophe

Attachment: pgpkh5IECl5Lv.pgp
Description: PGP signature


reply via email to

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