mirror of
https://github.com/clearlinux/tallow.git
synced 2026-04-28 10:23:35 +00:00
Make sure we don't pass garbage to system().
This commit is contained in:
1
TODO
1
TODO
@@ -1,3 +1,2 @@
|
||||
- Add IPV6 support
|
||||
- Verify IP address is a valid IP address before using it in system() calls
|
||||
- Print usable log messages
|
||||
|
||||
8
tallow.c
8
tallow.c
@@ -92,6 +92,14 @@ static void find(char *ip)
|
||||
struct tallow_struct *n;
|
||||
struct tallow_struct *w = whitelist;
|
||||
|
||||
/*
|
||||
* not validating the IP address format here, just
|
||||
* making sure we're not passing special characters
|
||||
* to system().
|
||||
*/
|
||||
if (strspn(ip, "0123456789.") < l)
|
||||
continue;
|
||||
|
||||
/* whitelist */
|
||||
while (w) {
|
||||
if (!strcmp(w->ip, ip))
|
||||
|
||||
Reference in New Issue
Block a user