diff --git a/src/app-layer-dcerpc-udp.c b/src/app-layer-dcerpc-udp.c index df6db890d0..5b65ca3611 100644 --- a/src/app-layer-dcerpc-udp.c +++ b/src/app-layer-dcerpc-udp.c @@ -118,6 +118,9 @@ static int DCERPCUDPParseHeader(Flow *f, void *dcerpcudp_state, if (input_len) { switch (sstate->bytesprocessed) { case 0: + // fallthrough + /* above statement to prevent coverity FPs from the switch + * fall through */ if (input_len >= DCERPC_UDP_HDR_LEN) { sstate->dcerpc.dcerpchdrudp.rpc_vers = *p; if (sstate->dcerpc.dcerpchdrudp.rpc_vers != 4) { @@ -257,6 +260,8 @@ static int DCERPCUDPParseHeader(Flow *f, void *dcerpcudp_state, } if (!(--input_len)) break; + /* We fall through to the next case if we still have input. + * Same applies for other cases as well */ } case 1: sstate->dcerpc.dcerpchdrudp.type = *(p++); diff --git a/src/app-layer-smb.c b/src/app-layer-smb.c index a9f7053850..29789f9bb2 100644 --- a/src/app-layer-smb.c +++ b/src/app-layer-smb.c @@ -835,6 +835,9 @@ static int SMBParseHeader(Flow *f, void *smb_state, if (input_len > 0) { switch (sstate->bytesprocessed) { case 4: + // fallthrough + /* above statement to prevent coverity FPs from the switch + * fall through */ if (input_len >= SMB_HDR_LEN) { if (SCMemcmp(p, "\xff\x53\x4d\x42", 4) != 0) { SCLogDebug("SMB Header did not validate"); @@ -876,6 +879,8 @@ static int SMBParseHeader(Flow *f, void *smb_state, } if (!(--input_len)) break; + /* We fall through to the next case if we still have input. + * Same applies for other cases as well */ } case 5: if (*(p++) != 'S') { diff --git a/src/app-layer-smb2.c b/src/app-layer-smb2.c index 3e12a63697..2c72a9f187 100644 --- a/src/app-layer-smb2.c +++ b/src/app-layer-smb2.c @@ -101,6 +101,9 @@ static uint32_t SMB2ParseHeader(void *smb2_state, AppLayerParserState *pstate, if (input_len) { switch (sstate->bytesprocessed) { case 4: + // fallthrough + /* above statement to prevent coverity FPs from the switch + * fall through */ if (input_len >= SMB2_HDR_LEN) { if (SCMemcmp(p, "\xfe\x53\x4d\x42", 4) != 0) { //printf("SMB2 Header did not validate\n"); @@ -173,7 +176,10 @@ static uint32_t SMB2ParseHeader(void *smb2_state, AppLayerParserState *pstate, //sstate->smb2.protocol[0] = *(p++); if (*(p++) != 0xfe) return 0; - if (!(--input_len)) break; + if (!(--input_len)) + break; + /* We fall through to the next case if we still have input. + * Same applies for other cases as well */ } case 5: //sstate->smb2.protocol[1] = *(p++);