if (!type) {
goto memerror;
}
- strncpy(type, ttl, strlen(ttl) + 1);
+ strlcpy(type, ttl, strlen(ttl) + 1);
}
} else {
if (-1 == ldns_bget_token(
if (!type) {
goto memerror;
}
- strncpy(type, clas, strlen(clas) + 1);
+ strlcpy(type, clas, strlen(clas) + 1);
}
}
/* the rest should still be waiting for us */
while(cur_hex_data_size < 2 * hex_data_size) {
c = ldns_bget_token(rd_buf, rd,
delimiters, LDNS_MAX_RDFLEN);
- if (c != -1) {
- rd_strlen = strlen(rd);
- }
if (c == -1 ||
(size_t)cur_hex_data_size + rd_strlen >
2 * (size_t)hex_data_size) {
status = LDNS_STATUS_SYNTAX_RDATA_ERR;
goto error;
}
- strncpy(hex_data_str + cur_hex_data_size, rd,
+ rd_strlen = strlen(rd);
+ strlcpy(hex_data_str + cur_hex_data_size, rd,
rd_strlen);
cur_hex_data_size += rd_strlen;