diff --git a/nfq2/protocol.c b/nfq2/protocol.c index 44248c6..14a4871 100644 --- a/nfq2/protocol.c +++ b/nfq2/protocol.c @@ -1294,28 +1294,27 @@ bool QUICDefragCrypto(const uint8_t *clean,size_t clean_len, uint8_t *defrag,siz if ((pos+sz)>clean_len) return false; if ((offset+sz)>defrag_data_len) return false; // defrag buf overflow + + // remove exact duplicates early to save cpu + for(i=0;i zeropos) zeropos=offset+sz; - memcpy(defrag_data+offset,clean+pos,sz); - if ((offset+sz) > szmax) szmax = offset+sz; - found=true; - pos+=sz; - - // remove exact duplicates early to save cpu - for(i=0;i szmax) szmax = offset+sz; + memcpy(defrag_data+offset,clean+pos,sz); ranges[range].offset = offset; ranges[range].len = sz; range++; +skip_range: + pos+=sz; } -endloop: } if (found) {