summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--accel-pppd/ipv6/dhcpv6.c12
-rw-r--r--accel-pppd/ipv6/nd.c6
2 files changed, 12 insertions, 6 deletions
diff --git a/accel-pppd/ipv6/dhcpv6.c b/accel-pppd/ipv6/dhcpv6.c
index 92a6ed6c..b284df5f 100644
--- a/accel-pppd/ipv6/dhcpv6.c
+++ b/accel-pppd/ipv6/dhcpv6.c
@@ -870,13 +870,15 @@ static int dhcpv6_read(struct triton_md_handler_t *h)
static void add_aftr_gw(const char *val)
{
- int n = strlen(val);
+ int n;
const char *ptr;
uint8_t *buf;
- if (!val)
+ if (!val || !*val)
return;
+ n = strlen(val);
+
if (val[n - 1] == '.')
n++;
else
@@ -917,13 +919,15 @@ static void add_aftr_gw(const char *val)
static void add_dnssl(const char *val)
{
- int n = strlen(val);
+ int n;
const char *ptr;
uint8_t *buf;
- if (!val)
+ if (!val || !*val)
return;
+ n = strlen(val);
+
if (val[n - 1] == '.')
n++;
else
diff --git a/accel-pppd/ipv6/nd.c b/accel-pppd/ipv6/nd.c
index 297e4d63..6dd00ee2 100644
--- a/accel-pppd/ipv6/nd.c
+++ b/accel-pppd/ipv6/nd.c
@@ -412,13 +412,15 @@ static void ev_ses_finishing(struct ap_session *ses)
static void add_dnssl(const char *val)
{
- int n = strlen(val);
+ int n;
const char *ptr;
uint8_t *buf;
- if (!val)
+ if (!val || !*val)
return;
+ n = strlen(val);
+
if (val[n - 1] == '.')
n++;
else