Re: [PATCH] virsh-network: Avoid possible NULL deref in cmdNetworkDHCPLeases

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

 



On Wed, Jun 08, 2016 at 13:53:05 +0200, Michal Privoznik wrote:
> Problem is, localtime_r() returns a pointer to converted time or
> NULL in case of an error. But checking the glibc sources, error
> will occur iff a NULL has been passed as an either of arguments
> the function takes. But GCC fails to see that:
> 
> ../../tools/virsh-network.c: In function 'cmdNetworkDHCPLeases':
> ../../tools/virsh-network.c:1370:12: error: potential null pointer dereference [-Werror=null-dereference]
>          ts = *localtime_r(&expirytime_tmp, &ts);
>          ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  tools/virsh-network.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

ACK

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]