[Top][All Lists]
[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
pgpkh5IECl5Lv.pgp
Description: PGP signature
- [Qemu-devel] [PATCH 1/2] libcacard: fix soft=... parsing in vcard_emul_options, Christophe Fergeau, 2011/06/24
- [Qemu-devel] [PATCH 2/2] libcacard: replace copy_string with strndup, Christophe Fergeau, 2011/06/24
- Re: [Qemu-devel] [PATCH 1/2] libcacard: fix soft=... parsing in vcard_emul_options, Alon Levy, 2011/06/24
- Re: [Qemu-devel] [PATCH 1/2] libcacard: fix soft=... parsing in vcard_emul_options,
Christophe Fergeau <=
- [Qemu-devel] [PATCHv2 0/4] libcacard fixes, Christophe Fergeau, 2011/06/27
- [Qemu-devel] [PATCHv2 1/4] libcacard: s/strip(args++)/strip(args+1), Christophe Fergeau, 2011/06/27
- [Qemu-devel] [PATCHv2 3/4] libcacard: introduce NEXT_TOKEN macro, Christophe Fergeau, 2011/06/27
- [Qemu-devel] [PATCHv2 2/4] libcacard: fix soft=... parsing in vcard_emul_options, Christophe Fergeau, 2011/06/27
- [Qemu-devel] [PATCHv2 4/4] libcacard: replace copy_string with strndup, Christophe Fergeau, 2011/06/27
- Re: [Qemu-devel] [PATCHv2 0/4] libcacard fixes, Alon Levy, 2011/06/27