diff --git a/glorytun.c b/glorytun.c index 4f63552..e346542 100644 --- a/glorytun.c +++ b/glorytun.c @@ -626,15 +626,12 @@ int main (int argc, char **argv) ssize_t ip_size = get_ip_size(tunr.buf, sizeof(tunr.buf)); - if (ip_size<=0) + if (ip_size<=0 || r>ip_size) continue; if (rip_size) - continue; - encrypt_packet(&ctx, tunr.buf, r, &tun.recv); } }