Browse Source

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
pull/1218/head
Guillem Jover 5 years ago
parent
commit
3a6950087e
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      daemon/stun.c

+ 1
- 1
daemon/stun.c View File

@ -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);


Loading…
Cancel
Save