qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 04/11] net: Real fix for check_params users


From: Mark McLoughlin
Subject: Re: [Qemu-devel] [PATCH 04/11] net: Real fix for check_params users
Date: Tue, 19 May 2009 10:57:19 +0100

On Tue, 2009-05-19 at 11:34 +0200, Jan Kiszka wrote:
> Mark McLoughlin wrote:
> > Hi Jan,
> > 
> > On Fri, 2009-05-08 at 12:34 +0200, Jan Kiszka wrote:
> >> OK, last try: ea053add70 broke -net socket, ffad4116b9 tried to fix it
> >> but broke error reporting of invalid parameters. So this patch widely
> >> reverts ffad4116b9 again and intead fixes those callers of check_params
> >> that originally suffered from overwritten buffers by using separate
> >> ones.
> >>
> >> Signed-off-by: Jan Kiszka <address@hidden>
> >> ---
> >>
> >>  net.c    |   23 ++++++++++++-----------
> >>  sysemu.h |    3 ++-
> >>  vl.c     |   39 ++++++++++++++-------------------------
> >>  3 files changed, 28 insertions(+), 37 deletions(-)
> >>
> >> diff --git a/net.c b/net.c
> >> index 6a5c698..cf00c9c 100644
> >> --- a/net.c
> >> +++ b/net.c
> >> @@ -1826,7 +1826,7 @@ int net_client_init(const char *device, const char 
> >> *p)
> >>          uint8_t *macaddr;
> >>          int idx = nic_get_free_idx();
> >>  
> >> -        if (check_params(nic_params, p) < 0) {
> >> +        if (check_params(buf, sizeof(buf), nic_params, p) < 0) {
> >>              fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n",
> >>                      buf, p);
> >>              return -1;
> > 
> > All callers used the scratch buffer to obtain the invalid parameter name
> > for error messages. Now, e.g. I get:
> > 
> >   $> qemu-system-x86_64 -drive foo=bar
> >   qemu: unknown parameter '' in 'foo=bar'
> > 
> 
> Works for me with that patch applied. Are you sure you ran the right
> (==patched) instance of qemu-system-x86_64? :->

Apologies, I was confused - I thought this patch had already been
applied and was causing the problem that it actually fixes :-)

Cheers,
Mark.





reply via email to

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