dnsapi: Fix some potential infinite loops because of an unsigned loop counter.
This commit is contained in:
parent
4688389d74
commit
98934f20d8
|
@ -418,8 +418,7 @@ static DNS_STATUS dns_copy_rdata( ns_msg msg, const ns_rr *rr, DNS_RECORDA *r, W
|
|||
r->Data.TXT.pStringArray[i] = dns_str_from_rdata( pos );
|
||||
if (!r->Data.TXT.pStringArray[i])
|
||||
{
|
||||
for (--i; i >= 0; i--)
|
||||
dns_free( r->Data.TXT.pStringArray[i] );
|
||||
while (i > 0) dns_free( r->Data.TXT.pStringArray[--i] );
|
||||
return ERROR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
i++;
|
||||
|
|
|
@ -443,8 +443,7 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
|
|||
|
||||
if (!dst->Data.TXT.pStringArray[i])
|
||||
{
|
||||
for (--i; i >= 0; i--)
|
||||
dns_free( dst->Data.TXT.pStringArray[i] );
|
||||
while (i > 0) dns_free( dst->Data.TXT.pStringArray[--i] );
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue