summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorVladislav Grishenko <themiron@mail.ru>2021-03-20 18:25:15 +0500
committerVladislav Grishenko <themiron@mail.ru>2021-03-20 18:25:15 +0500
commit5c6cf3e627b95a76ccdd21b956a9e77f05f250d9 (patch)
treeeaea5e00f4bbe70dc2f426404fba970c40487f53 /accel-pppd
parent21830c460aaccef7fee6fbfb1795bb34b53bb01d (diff)
downloadaccel-ppp-5c6cf3e627b95a76ccdd21b956a9e77f05f250d9.tar.gz
accel-ppp-5c6cf3e627b95a76ccdd21b956a9e77f05f250d9.zip
ipv6, shaper: fix possible NULL-pointer dereference
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/ipv6/dhcpv6.c3
-rw-r--r--accel-pppd/ipv6/nd.c6
-rw-r--r--accel-pppd/shaper/shaper.c3
3 files changed, 11 insertions, 1 deletions
diff --git a/accel-pppd/ipv6/dhcpv6.c b/accel-pppd/ipv6/dhcpv6.c
index a48d7a1..471e0a0 100644
--- a/accel-pppd/ipv6/dhcpv6.c
+++ b/accel-pppd/ipv6/dhcpv6.c
@@ -826,6 +826,9 @@ static void add_dnssl(const char *val)
const char *ptr;
uint8_t *buf;
+ if (!val)
+ return;
+
if (val[n - 1] == '.')
n++;
else
diff --git a/accel-pppd/ipv6/nd.c b/accel-pppd/ipv6/nd.c
index 4dd9d5a..a4233b5 100644
--- a/accel-pppd/ipv6/nd.c
+++ b/accel-pppd/ipv6/nd.c
@@ -414,6 +414,9 @@ static void add_dnssl(const char *val)
const char *ptr;
uint8_t *buf;
+ if (!val)
+ return;
+
if (val[n - 1] == '.')
n++;
else
@@ -474,7 +477,8 @@ static void load_dns(void)
}
if (!strcmp(opt->name, "lifetime")) {
- conf_rdnss_lifetime = atoi(opt->val);
+ if (opt->val)
+ conf_rdnss_lifetime = atoi(opt->val);
continue;
}
diff --git a/accel-pppd/shaper/shaper.c b/accel-pppd/shaper/shaper.c
index 351a7ee..6955531 100644
--- a/accel-pppd/shaper/shaper.c
+++ b/accel-pppd/shaper/shaper.c
@@ -903,6 +903,9 @@ static struct time_range_t *parse_range(time_t t, const char *val)
struct tm begin_tm, end_tm;
struct time_range_t *r;
+ if (!val)
+ return NULL;
+
id = strtol(val, &endptr, 10);
if (*endptr != ',')
return NULL;