aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2024-06-10 08:24:16 +0000
committerOmar Polo <op@omarpolo.com>2024-06-10 08:24:16 +0000
commit09651629594e0b367414cf5bcb0c5820c3b904f8 (patch)
tree58d3a7c34101b79efe80d7c8c3f80f7296a3d691 /server.c
parent4a2e39c23b8b2980ed8409660f6f3106294e6acf (diff)
another range check
Diffstat (limited to 'server.c')
-rw-r--r--server.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/server.c b/server.c
index 7964a74..a29fdd8 100644
--- a/server.c
+++ b/server.c
@@ -119,8 +119,14 @@ match_host(struct vhost *v, struct client *c)
if (addr == NULL)
return 0;
- if (*c->domain == '\0')
- strlcpy(c->domain, addr->pp, sizeof(c->domain));
+ if (*c->domain == '\0') {
+ if (strlcpy(c->domain, addr->pp, sizeof(c->domain))
+ >= sizeof(c->domain)) {
+ log_warnx("%s: domain too long: %s", __func__,
+ addr->pp);
+ *c->domain = '\0';
+ }
+ }
if (matches(v->domain, c->domain))
return 1;