[Dnsmasq-discuss] [PATCH] fix segfault when using tftp_no_fail
Stefan Tomanek
stefan.tomanek+dnsmasq at wertarbyte.de
Tue Apr 14 14:40:02 BST 2015
This change prevents dnsmasq from calling closedir() on an invalid pointer
(which happens if the TFTP directory cannot be opened). The 'else' was probably
accidently dropped while applying and refactoring patch
30d0879ed55cb67b1b735beab3d93f3bb3ef1dd2.
Signed-off-by: Stefan Tomanek <stefan.tomanek+dnsmasq at wertarbyte.de>
---
src/dnsmasq.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/dnsmasq.c b/src/dnsmasq.c
index a7c5da8..20b15c0 100644
--- a/src/dnsmasq.c
+++ b/src/dnsmasq.c
@@ -655,7 +655,8 @@ int main (int argc, char **argv)
_exit(0);
}
}
- closedir(dir);
+ else
+ closedir(dir);
}
for (p = daemon->if_prefix; p; p = p->next)
@@ -670,7 +671,8 @@ int main (int argc, char **argv)
_exit(0);
}
}
- closedir(dir);
+ else
+ closedir(dir);
}
}
#endif
--
2.1.4
More information about the Dnsmasq-discuss
mailing list