From 6040b0c23372958a4e58d250753f996b2942a0ac Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Tue, 19 Sep 2023 11:03:55 +0200 Subject: [PATCH] decode: fix -Wshorten-64-to-32 warnings Ticket: #6186 --- src/decode-teredo.c | 2 +- src/decode.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/decode-teredo.c b/src/decode-teredo.c index bbeda3efa398..9fd46f0118cc 100644 --- a/src/decode-teredo.c +++ b/src/decode-teredo.c @@ -182,7 +182,7 @@ int DecodeTeredo(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, if (len == IPV6_HEADER_LEN + IPV6_GET_RAW_PLEN(thdr) + (start - pkt)) { - int blen = len - (start - pkt); + uint32_t blen = len - (uint32_t)(start - pkt); /* spawn off tunnel packet */ Packet *tp = PacketTunnelPktSetup(tv, dtv, p, start, blen, DECODE_TUNNEL_IPV6_TEREDO); diff --git a/src/decode.c b/src/decode.c index 452344205290..927791b08b98 100644 --- a/src/decode.c +++ b/src/decode.c @@ -350,7 +350,7 @@ inline int PacketCopyDataOffset(Packet *p, uint32_t offset, const uint8_t *data, */ inline int PacketCopyData(Packet *p, const uint8_t *pktdata, uint32_t pktlen) { - SET_PKT_LEN(p, (size_t)pktlen); + SET_PKT_LEN(p, pktlen); return PacketCopyDataOffset(p, 0, pktdata, pktlen); } @@ -810,7 +810,7 @@ void DecodeThreadVarsFree(ThreadVars *tv, DecodeThreadVars *dtv) */ inline int PacketSetData(Packet *p, const uint8_t *pktdata, uint32_t pktlen) { - SET_PKT_LEN(p, (size_t)pktlen); + SET_PKT_LEN(p, pktlen); if (unlikely(!pktdata)) { return -1; }