提交 f1385e22 编写于 作者: P Peter Krempa

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.
上级 5133b503
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册