mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
net: leaseshelper: Don't crash if DNSMASQ doesn't provide lease expiry
The value is provided via environment and causes a crash if not defined.
This commit is contained in:
parent
5133b50372
commit
f1385e222e
@ -181,7 +181,8 @@ main(int argc, char **argv)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
/* Removed extraneous trailing space in DNSMASQ_LEASE_EXPIRES (dnsmasq < 2.52) */
|
/* 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';
|
exptime[strlen(exptime) - 1] = '\0';
|
||||||
|
|
||||||
/* Check if it is an IPv6 lease */
|
/* Check if it is an IPv6 lease */
|
||||||
|
Loading…
Reference in New Issue
Block a user