[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] build: remove compile warning
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] build: remove compile warning |
Date: |
Thu, 6 Jun 2013 10:16:59 +0100 |
On 6 June 2013 09:22, Stefan Hajnoczi <address@hidden> wrote:
> On Thu, Jun 06, 2013 at 11:55:36AM +0800, Wenchao Xia wrote:
>> This patch simply remove "variable may be used uninitialized" warning.
>> --- a/libcacard/vscclient.c
>> +++ b/libcacard/vscclient.c
>> @@ -641,7 +641,7 @@ main(
>> GIOChannel *channel_stdin;
>> char *qemu_host;
>> char *qemu_port;
>> - VSCMsgHeader mhHeader;
>> + VSCMsgHeader mhHeader = {0};
>>
>> VCardEmulOptions *command_line_options = NULL;
>
> The code looks broken to me:
>
> main() {
> VSCMsgHeader mhHeader;
> ...
> send_msg(VSC_Init, mhHeader.reader_id, &init, sizeof(init));
>
> This is really an uninitialized use of mhHeader.read_id.
See the patch already on list (and my review comments
on it):
http://patchwork.ozlabs.org/patch/248856/
thanks
-- PMM