]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
packet: set length of 0 for too big copy
authorPhilippe Antoine <contact@catenacyber.fr>
Thu, 19 Nov 2020 13:10:58 +0000 (14:10 +0100)
committerShivani Bhardwaj <shivanib134@gmail.com>
Thu, 3 Dec 2020 22:39:55 +0000 (04:09 +0530)
(cherry picked from commit d5ac77ee8b2008e3e401fff6cbe28ced3bdf69ba)

src/decode.c

index 09c4c61e26c55abf2c172c20473af28b83c8a131..22ad5e52f1f02df1f7c6ca9e473f3181fbef0c48 100644 (file)
@@ -222,6 +222,7 @@ inline int PacketCopyDataOffset(Packet *p, uint32_t offset, const uint8_t *data,
 {
     if (unlikely(offset + datalen > MAX_PAYLOAD_SIZE)) {
         /* too big */
+        SET_PKT_LEN(p, 0);
         return -1;
     }