Skip to content

Commit

Permalink
smb/c: fix undefined behavior
Browse files Browse the repository at this point in the history
Reported-by: Sirko Höer -- Code Intelligence for DCSO.
  • Loading branch information
victorjulien committed Apr 30, 2019
1 parent 22643ae commit a7c3870
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app-layer-smb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit a7c3870

Please sign in to comment.