Commit 98934f20 authored by Alexandre Julliard's avatar Alexandre Julliard

dnsapi: Fix some potential infinite loops because of an unsigned loop counter.

parent 4688389d
......@@ -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;
}
}
......
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