Re: [PATCH 3/5] net: leasehelper: Don't crash if DNSMASQ doesn't provide lease expiry

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

 



On 16.6.2014 17:21, Peter Krempa wrote:
> The value is provided via environment and causes a crash if not defined.
> ---
>  src/network/leaseshelper.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/network/leaseshelper.c b/src/network/leaseshelper.c
> index bf1842b..99c47a9 100644
> --- a/src/network/leaseshelper.c
> +++ b/src/network/leaseshelper.c
> @@ -181,7 +181,8 @@ main(int argc, char **argv)
>          goto cleanup;
> 
>      /* Removed extraneous trailing space in DNSMASQ_LEASE_EXPIRES (dnsmasq < 2.52) */
> -    if (exptime[strlen(exptime) - 1] == ' ')
> +    if (exptime &&
> +        exptime[strlen(exptime) - 1] == ' ')
>          exptime[strlen(exptime) - 1] = '\0';
> 
>      /* Check if it is an IPv6 lease */
> 

ACK

Pavel

--
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]