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: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH 04/11] net: Real fix for check_params users
Date: Tue, 19 May 2009 11:34:37 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

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

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux




reply via email to

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