From a0545235dd358cdcc480215cebe233274453729e Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 28 Apr 2020 10:27:41 +0000 Subject: [PATCH] fixed wrong conditions in lib/dns.c --- mio/lib/dns.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mio/lib/dns.c b/mio/lib/dns.c index 90f9bf9..b54b74d 100644 --- a/mio/lib/dns.c +++ b/mio/lib/dns.c @@ -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; 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); soa->serial = mio_ntoh32(soa->serial); 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 (MIO_UNLIKELY(pi->_end - pi->_ptr) < 20) goto oops; + if (MIO_UNLIKELY(pi->_end - pi->_ptr < 20)) goto oops; } pi->_ptr += 20;