* isc_parse_uint32(). isc_parse_uint32() requires
* null termination, so we must make a copy.
*/
- strlcpy(buffer, source->base,
- ISC_MIN(source->length + 1, sizeof(buffer)));
+ snprintf(buffer, sizeof(buffer), "%.*s",
+ (int)source->length, source->base);
INSIST(buffer[source->length] == '\0');
* source->base is not required to be NUL terminated.
* Copy up to remaining bytes and NUL terminate.
*/
- strlcpy(buf, source->base + 5,
- ISC_MIN(source->length - 5 + 1, sizeof(buf)));
+ snprintf(buf, sizeof(buf), "%.*s",
+ (int)(source->length - 5), source->base + 5);
val = strtoul(buf, &endp, 10);
if (*endp == '\0' && val <= 0xffff) {
*classp = (dns_rdataclass_t)val;
* source->base is not required to be NUL terminated.
* Copy up to remaining bytes and NUL terminate.
*/
- strlcpy(buf, source->base + 4,
- ISC_MIN(source->length - 4 + 1, sizeof(buf)));
+ snprintf(buf, sizeof(buf), "%.*s",
+ (int)(source->length - 4), source->base + 4);
val = strtoul(buf, &endp, 10);
if (*endp == '\0' && val <= 0xffff) {
*typep = (dns_rdatatype_t)val;
if (source->length > sizeof(buf) - 1)
return (DNS_R_SYNTAX);
/* Copy source->length bytes and NUL terminate. */
- strlcpy(buf, source->base, ISC_MIN(source->length + 1, sizeof(buf)));
+ snprintf(buf, sizeof(buf), "%.*s", (int)source->length, source->base);
s = buf;
do {