summaryrefslogtreecommitdiff
path: root/accel-pppd/extra/ippool.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd/extra/ippool.c')
-rw-r--r--accel-pppd/extra/ippool.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/accel-pppd/extra/ippool.c b/accel-pppd/extra/ippool.c
index 6ba2b5df..3ae48e95 100644
--- a/accel-pppd/extra/ippool.c
+++ b/accel-pppd/extra/ippool.c
@@ -108,6 +108,9 @@ static void parse_gw_ip_address(const char *val)
ptr = strchr(val, '/');
if (ptr) {
+ // safeguard, don't crash on oversized or undersized strings
+ if (ptr - val > 15 || ptr - val < 7)
+ return;
memcpy(addr, val, ptr - val);
addr[ptr - val] = 0;
conf_gw_ip_address = inet_addr(addr);