mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-17 16:26:59 +00:00
getdata: certain input files caused SIGSEGV
When dhcpd.conf file got to be parsed such way that IP version could not be determined the dhcpd.lease file parsing resulted to SIGSEGV. Reported-by: Joey D. <jobewan@gmail.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
5966360f12
commit
805d353584
2 changed files with 5 additions and 0 deletions
|
|
@ -160,6 +160,10 @@ int
|
|||
xstrstr(const char *restrict a, const char *restrict b, const int len)
|
||||
{
|
||||
int i;
|
||||
/* Skip when config.dhcp_version == VERSION_UNKNOWN -> len is zero. */
|
||||
if (len == 0) {
|
||||
return false;
|
||||
}
|
||||
/* two spaces are very common in lease file, after them
|
||||
* nearly everything differs */
|
||||
if (likely(a[2] != b[2])) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue