From 3a6950087e43ee0013a88890b372ee309ff07f2a Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 3 Mar 2021 19:47:52 +0100 Subject: [PATCH] TT#111150 Remove tautological check in stun() The ntohs() function returns uint16_t, which will always fit within an int (including in excess for the signed bit) on the platform we support. Thus the check for negative values is never going to hit. Change-Id: Ie9d5bcfe5709c50260098f91ff111755ded72921 Warned-by: lgtm --- daemon/stun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/stun.c b/daemon/stun.c index eef7bd8d8..b96af5551 100644 --- a/daemon/stun.c +++ b/daemon/stun.c @@ -565,7 +565,7 @@ int stun(const str *b, struct stream_fd *sfd, const endpoint_t *sin) { msglen = ntohs(req->msg_len); err = "message-length mismatch"; - if (msglen + 20 > b->len || msglen < 0) + if (msglen + 20 > b->len) goto ignore; class = method = ntohs(req->msg_type);