diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2024-06-27 00:50:56 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-07-02 21:33:29 +0200 |
commit | 21ee1eb2de40c8377de22a9ff7e65663f245a61c (patch) | |
tree | 328d1e33c08f5fc1d95c0896ef258c5e2d973472 /conf.c | |
parent | 1ee2ecade3f41e2a3e51c1e580b08cba977a7c8d (diff) | |
download | passt-21ee1eb2de40c8377de22a9ff7e65663f245a61c.tar passt-21ee1eb2de40c8377de22a9ff7e65663f245a61c.tar.gz passt-21ee1eb2de40c8377de22a9ff7e65663f245a61c.tar.bz2 passt-21ee1eb2de40c8377de22a9ff7e65663f245a61c.tar.lz passt-21ee1eb2de40c8377de22a9ff7e65663f245a61c.tar.xz passt-21ee1eb2de40c8377de22a9ff7e65663f245a61c.tar.zst passt-21ee1eb2de40c8377de22a9ff7e65663f245a61c.zip |
conf: Copy up to MAXDNSRCH - 1 bytes, not MAXDNSRCH
Spotted by Coverity just recently. Not that it really matters as
MAXDNSRCH always appears to be defined as 1025, while a full domain
name can have up to 253 characters: it would be a bit pointless to
have a longer search domain.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -453,7 +453,7 @@ static void get_dns(struct ctx *c) while (s - c->dns_search < ARRAY_SIZE(c->dns_search) - 1 /* cppcheck-suppress strtokCalled */ && (p = strtok(NULL, " \t"))) { - strncpy(s->n, p, sizeof(c->dns_search[0])); + strncpy(s->n, p, sizeof(c->dns_search[0]) - 1); s++; *s->n = 0; } |