inet_ntop result should always protect against empty string accepted
without an error. Make additional check to satisfy coverity scans.
* parsing, so append 0 in that case.
*/
if (af == AF_INET6 && (flags & DNS_STYLEFLAG_YAML) != 0) {
- isc_textregion_t tr;
- isc_buffer_usedregion(target, (isc_region_t *)&tr);
- if (tr.base[tr.length - 1] == ':') {
+ isc_region_t r;
+ isc_buffer_usedregion(target, &r);
+ if (r.length > 0 && r.base[r.length - 1] == ':') {
if (isc_buffer_availablelength(target) == 0) {
return (ISC_R_NOSPACE);
}