aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/acl/acl_test.c5
-rw-r--r--src/plugins/dns/dns_test.c6
-rw-r--r--src/plugins/http_static/static_server.c2
3 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/acl/acl_test.c b/src/plugins/acl/acl_test.c
index ec951ad7057..d6a6d582702 100644
--- a/src/plugins/acl/acl_test.c
+++ b/src/plugins/acl/acl_test.c
@@ -669,10 +669,13 @@ api_acl_add_replace_from_file (vat_main_t * vam)
break;
}
+ if (file_name == NULL)
+ goto done;
+
fd = open(file_name, O_RDONLY);
if (fd < 0)
{
- clib_warning("Could not open file '%s'");
+ clib_warning("Could not open file '%s'", file_name);
goto done;
}
diff --git a/src/plugins/dns/dns_test.c b/src/plugins/dns/dns_test.c
index 6b0b371dca1..ada9c0b7aa1 100644
--- a/src/plugins/dns/dns_test.c
+++ b/src/plugins/dns/dns_test.c
@@ -186,6 +186,12 @@ api_dns_resolve_name (vat_main_t * vam)
break;
}
+ if (name == 0)
+ {
+ errmsg ("missing name to resolve");
+ return -99;
+ }
+
if (vec_len (name) > 127)
{
errmsg ("name too long");
diff --git a/src/plugins/http_static/static_server.c b/src/plugins/http_static/static_server.c
index ef9d3d77e41..73ea8895de3 100644
--- a/src/plugins/http_static/static_server.c
+++ b/src/plugins/http_static/static_server.c
@@ -933,7 +933,7 @@ state_sent_ok (session_t * s, http_session_t * hs,
/* What kind of dog food are we serving? */
suffix = (char *) (hs->path + vec_len (hs->path) - 1);
- while (*suffix != '.')
+ while ((u8 *) suffix >= hs->path && *suffix != '.')
suffix--;
suffix++;
http_type = "text/html";