commit 98118c6d6e5219ebae7c239e9ca55fad38daef86
parent 7eec2a3e369947ad1f1b4f256b73b2977ea84726
Author: sin <sin@2f30.org>
Date: Tue, 29 Mar 2016 10:39:44 +0100
remove impossible conditions
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/stun.c b/stun.c
@@ -467,8 +467,7 @@ readnet(int fd, unsigned char *buf, int len)
paddedlen = padto(pktlen, AES_BLOCK_SIZE);
/* attempt to drain an invalid packet */
- if (pktlen < 0 || pktlen > len ||
- paddedlen < 0 || paddedlen > MTU + AES_BLOCK_SIZE) {
+ if (pktlen > len || paddedlen > MTU + AES_BLOCK_SIZE) {
while (paddedlen) {
if (paddedlen > MTU + AES_BLOCK_SIZE)
len = MTU + AES_BLOCK_SIZE;