@ -101,6 +101,9 @@ static uint32_t SMB2ParseHeader(void *smb2_state, AppLayerParserState *pstate,
if ( input_len ) {
if ( input_len ) {
switch ( sstate - > bytesprocessed ) {
switch ( sstate - > bytesprocessed ) {
case 4 :
case 4 :
// fallthrough
/* above statement to prevent coverity FPs from the switch
* fall through */
if ( input_len > = SMB2_HDR_LEN ) {
if ( input_len > = SMB2_HDR_LEN ) {
if ( SCMemcmp ( p , " \xfe \x53 \x4d \x42 " , 4 ) ! = 0 ) {
if ( SCMemcmp ( p , " \xfe \x53 \x4d \x42 " , 4 ) ! = 0 ) {
//printf("SMB2 Header did not validate\n");
//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++);
//sstate->smb2.protocol[0] = *(p++);
if ( * ( p + + ) ! = 0xfe )
if ( * ( p + + ) ! = 0xfe )
return 0 ;
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 :
case 5 :
//sstate->smb2.protocol[1] = *(p++);
//sstate->smb2.protocol[1] = *(p++);