Commit edcb3788 authored by Mark Andrews's avatar Mark Andrews
Browse files

replace strncpy + setting end of array to NUL with strlcpy

parent 7eb17b96
Pipeline #7064 passed with stages
in 13 minutes and 36 seconds
......@@ -128,14 +128,11 @@ add_name(struct dlz_example_data *state, struct record *list,
strlen(data) >= sizeof(list[i].data))
return (ISC_R_NOSPACE);
strncpy(list[i].name, name, sizeof(list[i].name));
list[i].name[sizeof(list[i].name) - 1] = '\0';
strlcpy(list[i].name, name, sizeof(list[i].name));
strncpy(list[i].type, type, sizeof(list[i].type));
list[i].type[sizeof(list[i].type) - 1] = '\0';
strlcpy(list[i].type, type, sizeof(list[i].type));
strncpy(list[i].data, data, sizeof(list[i].data));
list[i].data[sizeof(list[i].data) - 1] = '\0';
strlcpy(list[i].data, data, sizeof(list[i].data));
list[i].ttl = ttl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment