mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-05 20:53:12 +02:00
Merge pull request #10 from Adam-/master+cidr
Fix core from parse_v4_netmask parsing invalid cidrs
This commit is contained in:
+1
-1
@@ -211,7 +211,7 @@ static int parse_v4_netmask(const char *text, struct IN_ADDR *addr, short int *b
|
||||
{
|
||||
char *after;
|
||||
bits = strtoul(p + 1, &after, 10);
|
||||
if (!bits || *after) /* Error: Invalid number or not end */
|
||||
if (bits < 0 || *after) /* Error: Invalid number or not end */
|
||||
return HM_HOST;
|
||||
if (bits > n * 8) /* Error: More than the bits given */
|
||||
return HM_HOST;
|
||||
|
||||
Reference in New Issue
Block a user