mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-10-23 11:54:39 +00:00
Fix buffer overflow when configured lease-change script name
is too long. Thanks to Daniel Rhea for finding this one.
This commit is contained in:
2 files changed
+8
No files matched your search
@@ -150,6 +150,10 @@ void lease_init(time_t now)
|
||||
#ifdef HAVE_SCRIPT
|
||||
if (daemon->lease_change_command)
|
||||
{
|
||||
/* 6 == strlen(" init") plus terminator */
|
||||
if (strlen(daemon->lease_change_command) + 6 > DHCP_BUFF_SZ)
|
||||
die(_("lease-change script name is too long"), NULL, EC_FILE);
|
||||
|
||||
strcpy(daemon->dhcp_buff, daemon->lease_change_command);
|
||||
strcat(daemon->dhcp_buff, " init");
|
||||
leasestream = popen(daemon->dhcp_buff, "r");
|
||||
|
||||
Reference in new issue
Block a user