diff options
author | Omar Polo <op@omarpolo.com> | 2024-06-10 08:24:16 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2024-06-10 08:24:16 +0000 |
commit | 09651629594e0b367414cf5bcb0c5820c3b904f8 (patch) | |
tree | 58d3a7c34101b79efe80d7c8c3f80f7296a3d691 /server.c | |
parent | 4a2e39c23b8b2980ed8409660f6f3106294e6acf (diff) |
another range check
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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; |