2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

[master] null terminate strings for coverity

This commit is contained in:
Evan Hunt
2014-06-16 15:30:11 -07:00
parent e3468c9052
commit 56510cd031
6 changed files with 39 additions and 4 deletions

View File

@@ -1162,6 +1162,8 @@ plus_option(char *option, isc_boolean_t is_batchfile,
if (value != NULL) {
n = strlcpy(sitvalue, value,
sizeof(sitvalue));
sitvalue[sizeof(sitvalue) - 1] = '\0';
if (n >= sizeof(sitvalue))
fatal("SIT data too large");
lookup->sitvalue = sitvalue;
@@ -1601,6 +1603,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
ip6_int, ISC_FALSE) == ISC_R_SUCCESS) {
strncpy((*lookup)->textname, textname,
sizeof((*lookup)->textname));
(*lookup)->textname[sizeof((*lookup)->textname)-1] = 0;
debug("looking up %s", (*lookup)->textname);
(*lookup)->trace_root = ISC_TF((*lookup)->trace ||
(*lookup)->ns_search_only);