mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
util, nb_dns: fix off-by-one bugs in strncpy() calls
Fortunately, these bugs had no effect because the following lines overwrote the last character with a null byte.
This commit is contained in:
parent
aacf84e552
commit
32bb019e3a
3 changed files with 3 additions and 3 deletions
|
@ -411,7 +411,7 @@ _nb_dns_mkquery(register struct nb_dns_info *nd, register const char *name,
|
|||
return (-1);
|
||||
}
|
||||
memset(ne, 0, sizeof(*ne));
|
||||
strncpy(ne->name, name, sizeof(ne->name));
|
||||
strncpy(ne->name, name, sizeof(ne->name) - 1);
|
||||
ne->name[sizeof(ne->name) - 1] = '\0';
|
||||
ne->qtype = qtype;
|
||||
ne->atype = atype;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue