Commit 9b729a06 authored by Evan Hunt's avatar Evan Hunt

[master] clean up bufsize errors

parent e3bd90ee
......@@ -1657,7 +1657,7 @@ dns_name_tofilenametext(const dns_name_t *name, isc_boolean_t omit_final_dot,
trem--;
nlen--;
} else {
if (trem < 3)
if (trem < 4)
return (ISC_R_NOSPACE);
snprintf(tdata, trem, "%%%02X", c);
tdata += 3;
......
......@@ -1383,12 +1383,14 @@ dns_zone_getdbtype(dns_zone_t *zone, char ***argv, isc_mem_t *mctx) {
size += strlen(zone->db_argv[i]) + 1;
mem = isc_mem_allocate(mctx, size);
if (mem != NULL) {
size_t remaining;
tmp = mem;
tmp2 = mem;
tmp2 += (zone->db_argc + 1) * sizeof(char *);
for (i = 0; i < zone->db_argc; i++) {
remaining = (size_t)(mem - tmp2);
*tmp++ = tmp2;
strlcpy(tmp2, zone->db_argv[i], size);
strlcpy(tmp2, zone->db_argv[i], remaining);
tmp2 += strlen(tmp2) + 1;
}
*tmp = NULL;
......
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