This fixes two possible situations where strncpy() produces a not null
terminated buffer.
Coverity IDs:
*
1412247 Buffer not null terminated
*
1412279 Buffer not null terminated
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Jo-Philipp Wich <jo@mein.io>
return false;
}
- strncpy(m->name, p, sizeof(m->name));
+ strncpy(m->name, p, sizeof(m->name) - 1);
for (i = 0, p = strtok(NULL, " \t,");
i < 3 && p != NULL;
if (!compare_addr(addr, &redir->ip_redir))
continue;
- strncpy(redir->dest.name, zone->name, sizeof(redir->dest.name));
+ strncpy(redir->dest.name, zone->name, sizeof(redir->dest.name) - 1);
redir->dest.set = true;
redir->_dest = zone;