[v9_10] null terminate strings for coverity

This commit is contained in:
Evan Hunt
2014-06-16 15:30:29 -07:00
parent ccba3c9ffd
commit 44feb080fd
6 changed files with 39 additions and 4 deletions

View File

@@ -133,8 +133,14 @@ add_name(struct dlz_example_data *state, struct record *list,
return (ISC_R_NOSPACE);
strncpy(list[i].name, name, sizeof(list[i].name));
list[i].name[sizeof(list[i].name) - 1] = '\0';
strncpy(list[i].type, type, sizeof(list[i].type));
list[i].type[sizeof(list[i].type) - 1] = '\0';
strncpy(list[i].data, data, sizeof(list[i].data));
list[i].data[sizeof(list[i].data) - 1] = '\0';
list[i].ttl = ttl;
return (ISC_R_SUCCESS);