mirror of
https://frontier.innolan.net/rainlance/c-ares.git
synced 2025-10-05 16:29:42 +00:00
protocol parsing: check input data stricter
... so that bad length fields aren't blindly accepted Bug: http://c-ares.haxx.se/mail/c-ares-archive-2013-04/0016.shtml
This commit is contained in:
committed by
Daniel Stenberg
parent
2004a7a111
commit
148c8e0353
@ -105,6 +105,12 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
|
||||
rr_class = DNS_RR_CLASS( aptr );
|
||||
rr_len = DNS_RR_LEN( aptr );
|
||||
aptr += RRFIXEDSZ;
|
||||
if (aptr + rr_len > abuf + alen)
|
||||
{
|
||||
free(rr_name);
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( rr_class == C_IN && rr_type == T_NS )
|
||||
{
|
||||
|
Reference in New Issue
Block a user