From: Daniel Salzman Date: Tue, 20 Mar 2018 08:15:03 +0000 (+0100) Subject: mod-whoami: remove redundant check (lgtm.com) X-Git-Tag: v2.7.0~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=429d8cb83cb711bfec9ab5fa3298941b7d9c9b1e;p=thirdparty%2Fknot-dns.git mod-whoami: remove redundant check (lgtm.com) --- diff --git a/src/knot/modules/whoami/whoami.c b/src/knot/modules/whoami/whoami.c index 1a43e12e62..ea80fc963e 100644 --- a/src/knot/modules/whoami/whoami.c +++ b/src/knot/modules/whoami/whoami.c @@ -59,7 +59,7 @@ static knotd_in_state_t whoami_query(knotd_in_state_t state, knot_pkt_t *pkt, * length into 'rdata' and 'len_rdata'. */ const void *rdata = NULL; - size_t len_rdata = 0; + uint16_t len_rdata = 0; if (query_source->ss_family == AF_INET && qtype == KNOT_RRTYPE_A) { const struct sockaddr_in *sai = (struct sockaddr_in *)query_source; rdata = &sai->sin_addr.s_addr; @@ -73,13 +73,6 @@ static knotd_in_state_t whoami_query(knotd_in_state_t state, knot_pkt_t *pkt, return state; } - /* Sanity check, since knot_rrset_add_rdata() takes a uint16_t length - * parameter. - */ - if (len_rdata > UINT16_MAX) { - return state; - } - /* Synthesize the response RRset. */ /* TTL is taken from the TTL of the SOA record. */