From: Victor Julien Date: Mon, 23 Nov 2020 20:59:18 +0000 (+0100) Subject: decode/null: fix type parsing X-Git-Tag: suricata-6.0.1~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14aacbd067c483c72578a86c78d16253b7dc3e93;p=thirdparty%2Fsuricata.git decode/null: fix type parsing --- diff --git a/src/decode-null.c b/src/decode-null.c index 4712f1a643..b4420f89aa 100644 --- a/src/decode-null.c +++ b/src/decode-null.c @@ -58,8 +58,11 @@ int DecodeNull(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, if (unlikely(GET_PKT_LEN(p) > HDR_SIZE + USHRT_MAX)) { return TM_ECODE_FAILED; } - +#if __BYTE_ORDER__ == __BIG_ENDIAN + uint32_t type = pkt[0] | pkt[1] << 8 | pkt[2] << 16 | pkt[3] << 24; +#else uint32_t type = *((uint32_t *)pkt); +#endif switch(type) { case AF_INET: SCLogDebug("IPV4 Packet");