diff --git a/TODO b/TODO index 8ec4d9f..d6a0bab 100644 --- a/TODO +++ b/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 diff --git a/tallow.c b/tallow.c index cc7a7b4..beada4f 100644 --- a/tallow.c +++ b/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))