diff --git a/nfq/protocol.c b/nfq/protocol.c index 74659ea9..b6122f9f 100644 --- a/nfq/protocol.c +++ b/nfq/protocol.c @@ -888,28 +888,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) {