From a7c3870f551834c364bd46b748c02d68d37fb3f1 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 2 Apr 2019 16:14:48 +0200 Subject: [PATCH] smb/c: fix undefined behavior MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported-by: Sirko Höer -- Code Intelligence for DCSO. --- src/app-layer-smb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app-layer-smb.c b/src/app-layer-smb.c index 994d7a25e737..5a86ec730b25 100644 --- a/src/app-layer-smb.c +++ b/src/app-layer-smb.c @@ -1028,17 +1028,17 @@ static int SMBParseHeader(Flow *f, void *smb_state, break; /* fall through */ case 9: - sstate->smb.status = *(p++) << 24; + sstate->smb.status = (uint32_t)*(p++) << 24; if (!(--input_len)) break; /* fall through */ case 10: - sstate->smb.status |= *(p++) << 16; + sstate->smb.status |= (uint32_t)*(p++) << 16; if (!(--input_len)) break; /* fall through */ case 11: - sstate->smb.status |= *(p++) << 8; + sstate->smb.status |= (uint32_t)*(p++) << 8; if (!(--input_len)) break; /* fall through */