app-layer: fix coverity warnings

pull/1564/merge
Victor Julien 10 years ago
parent 6c792cb4cc
commit f4f53924bb

@ -716,6 +716,8 @@ static int DCERPCUDPParse(Flow *f, void *dcerpc_state,
if (input == NULL && AppLayerParserStateIssetFlag(pstate, APP_LAYER_PARSER_EOF)) {
SCReturnInt(1);
} else if (input == NULL || input_len == 0) {
SCReturnInt(-1);
}
DCERPCUDPState *sstate = (DCERPCUDPState *) dcerpc_state;

@ -1913,6 +1913,8 @@ static int DCERPCParse(Flow *f, void *dcerpc_state,
if (input == NULL && AppLayerParserStateIssetFlag(pstate, APP_LAYER_PARSER_EOF)) {
SCReturnInt(1);
} else if (input == NULL || input_len == 0) {
SCReturnInt(-1);
}
if (sstate->dcerpc.bytesprocessed != 0 && sstate->data_needed_for_dir != dir) {

@ -503,7 +503,7 @@ static int DNSTCPResponseParse(Flow *f, void *dstate,
SCReturnInt(-1);
/* probably a rst/fin sending an eof */
if (input_len == 0) {
if (input == NULL || input_len == 0) {
goto insufficient_data;
}

@ -221,6 +221,8 @@ static int FTPParseRequest(Flow *f, void *ftp_state,
if (input == NULL && AppLayerParserStateIssetFlag(pstate, APP_LAYER_PARSER_EOF)) {
SCReturnInt(1);
} else if (input == NULL || input_len == 0) {
SCReturnInt(-1);
}
state->input = input;

@ -1229,6 +1229,8 @@ static int ModbusParseRequest(Flow *f,
if (input == NULL && AppLayerParserStateIssetFlag(pstate, APP_LAYER_PARSER_EOF)) {
SCReturnInt(1);
} else if (input == NULL || input_len == 0) {
SCReturnInt(-1);
}
while (input_len > 0) {
@ -1290,6 +1292,8 @@ static int ModbusParseResponse(Flow *f,
if (input == NULL && AppLayerParserStateIssetFlag(pstate, APP_LAYER_PARSER_EOF)) {
SCReturnInt(1);
} else if (input == NULL || input_len == 0) {
SCReturnInt(-1);
}
while (input_len > 0) {

@ -534,6 +534,8 @@ static int SMB2Parse(Flow *f, void *smb2_state, AppLayerParserState *pstate,
if (input == NULL && AppLayerParserStateIssetFlag(pstate, APP_LAYER_PARSER_EOF)) {
SCReturnInt(1);
} else if (input == NULL || input_len == 0) {
SCReturnInt(-1);
}
while (sstate->bytesprocessed < NBSS_HDR_LEN && input_len) {

@ -1067,6 +1067,8 @@ static int SMTPParse(int direction, Flow *f, SMTPState *state,
if (input == NULL && AppLayerParserStateIssetFlag(pstate, APP_LAYER_PARSER_EOF)) {
SCReturnInt(1);
} else if (input == NULL || input_len == 0) {
SCReturnInt(-1);
}
state->input = input;

@ -424,6 +424,8 @@ static int SSHParseRequest(Flow *f, void *state, AppLayerParserState *pstate,
if (input == NULL && AppLayerParserStateIssetFlag(pstate, APP_LAYER_PARSER_EOF)) {
SCReturnInt(1);
} else if (input == NULL || input_len == 0) {
SCReturnInt(-1);
}
int r = SSHParseData(ssh_state, ssh_header, input, input_len);
@ -446,6 +448,8 @@ static int SSHParseResponse(Flow *f, void *state, AppLayerParserState *pstate,
if (input == NULL && AppLayerParserStateIssetFlag(pstate, APP_LAYER_PARSER_EOF)) {
SCReturnInt(1);
} else if (input == NULL || input_len == 0) {
SCReturnInt(-1);
}
int r = SSHParseData(ssh_state, ssh_header, input, input_len);

@ -976,6 +976,8 @@ static int SSLDecode(Flow *f, uint8_t direction, void *alstate, AppLayerParserSt
if (input == NULL && AppLayerParserStateIssetFlag(pstate, APP_LAYER_PARSER_EOF)) {
SCReturnInt(1);
} else if (input == NULL || input_len == 0) {
SCReturnInt(-1);
}
if (direction == 0)

Loading…
Cancel
Save