fixed wrong conditions in lib/dns.c

This commit is contained in:
hyung-hwan 2020-04-28 10:27:41 +00:00
parent b1c205626a
commit a0545235dd

View File

@ -324,7 +324,7 @@ static int parse_answer_rr (mio_t* mio, mio_dns_rr_part_t rr_part, mio_oow_t pos
soa->rname = (mio_bch_t*)pi->_rrdptr; soa->rname = (mio_bch_t*)pi->_rrdptr;
if (parse_domain_name(mio, pi) <= -1) goto oops; if (parse_domain_name(mio, pi) <= -1) goto oops;
if (MIO_UNLIKELY(pi->_end - pi->_ptr) < 20) goto oops; if (MIO_UNLIKELY(pi->_end - pi->_ptr < 20)) goto oops;
MIO_MEMCPY (&soa->serial, pi->_ptr, 20); MIO_MEMCPY (&soa->serial, pi->_ptr, 20);
soa->serial = mio_ntoh32(soa->serial); soa->serial = mio_ntoh32(soa->serial);
soa->refresh = mio_ntoh32(soa->refresh); soa->refresh = mio_ntoh32(soa->refresh);
@ -336,7 +336,7 @@ static int parse_answer_rr (mio_t* mio, mio_dns_rr_part_t rr_part, mio_oow_t pos
{ {
if (parse_domain_name(mio, pi) <= -1) goto oops; if (parse_domain_name(mio, pi) <= -1) goto oops;
if (parse_domain_name(mio, pi) <= -1) goto oops; if (parse_domain_name(mio, pi) <= -1) goto oops;
if (MIO_UNLIKELY(pi->_end - pi->_ptr) < 20) goto oops; if (MIO_UNLIKELY(pi->_end - pi->_ptr < 20)) goto oops;
} }
pi->_ptr += 20; pi->_ptr += 20;