From 3eb30ea7008d851b1e966d13afae8da4ca68221d Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 16 Mar 2019 17:44:47 +0000 Subject: [PATCH] Revert "Revert "Fixed queuing of extended segments"" This reverts commit 78b0559257f46a0cff7d1f8d923082598f6f4b17. --- app/src/main/jni/netguard/tcp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/jni/netguard/tcp.c b/app/src/main/jni/netguard/tcp.c index 08a894e6..102721e3 100644 --- a/app/src/main/jni/netguard/tcp.c +++ b/app/src/main/jni/netguard/tcp.c @@ -1002,11 +1002,16 @@ void queue_tcp(const struct arguments *args, s->len = datalen; s->data = malloc(datalen); memcpy(s->data, data, datalen); - } else + } else { log_android(ANDROID_LOG_ERROR, "%s segment larger %u..%u < %u", session, s->seq - cur->remote_start, s->seq + s->len - cur->remote_start, s->seq + datalen - cur->remote_start); + free(s->data); + s->len = datalen; + s->data = malloc(datalen); + memcpy(s->data, data, datalen); + } } } }