From: Victor Julien Date: Thu, 9 Feb 2023 15:57:23 +0000 (+0100) Subject: stream: minor cleanups X-Git-Tag: suricata-7.0.0-rc2~584 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ad5e040afdf16d99ddea440e924fe26adcbf9dd;p=thirdparty%2Fsuricata.git stream: minor cleanups --- diff --git a/src/stream-tcp.c b/src/stream-tcp.c index 59b0155f69..e4c61dbd26 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -1282,12 +1282,11 @@ static int StreamTcp3whsQueueSynAck(TcpSession *ssn, Packet *p) return -1; } - TcpStateQueue *q = SCMalloc(sizeof(*q)); + TcpStateQueue *q = SCCalloc(1, sizeof(*q)); if (unlikely(q == NULL)) { SCLogDebug("ssn %p: =~ SYN/ACK queue failed: alloc failed", ssn); return -1; } - memset(q, 0x00, sizeof(*q)); StreamTcpIncrMemuse((uint64_t)sizeof(TcpStateQueue)); StreamTcp3whsSynAckToStateQueue(p, q); @@ -1431,7 +1430,7 @@ static inline bool StateSynSentValidateTimestamp(TcpSession *ssn, Packet *p) } TcpStream *receiver_stream = &ssn->client; - uint32_t ts_echo = TCP_GET_TSECR(p); + const uint32_t ts_echo = TCP_GET_TSECR(p); if ((receiver_stream->flags & STREAMTCP_STREAM_FLAG_TIMESTAMP) != 0) { if (receiver_stream->last_ts != 0 && ts_echo != 0 && ts_echo != receiver_stream->last_ts)