Re: [PATCH 3/3] Fix uninitialized variables warnings

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

 



Hi Luiz,

On Tue, Mar 29, 2011 at 7:36 AM,  <luiz.dentz@xxxxxxxxx> wrote:
> From: Luiz Augusto von Dentz <luiz.dentz-von@xxxxxxxxx>
>
> src/attrib-server.c: In function ‘channel_handler’:
> src/attrib-server.c:297:21: error: ‘cur’ may be used uninitialized in this function
> src/attrib-server.c:502:10: error: ‘format’ may be used uninitialized in this function
> src/attrib-server.c:503:11: error: ‘length’ may be used uninitialized in this function
> make[1]: *** [src/attrib-server.o] Error 1

Can you mention which compiler are you using ? Is it the just released
4.6.1 ? Or clang ? I'd like to use it as well.

Also I think that at least for this attrib-server.c patch, it is
hiding some real bugs (missing checks). I can't talk for the other
files though :)

E.g., if the attribute database is empty (highly unlikely, as it will
contain at least the GAP attributes), this will dereference a NULL
pointer:

    if (l == NULL)
        cur->end = a->handle;
    else
        cur->end = last_handle;


Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux