Skip to content

Commit

Permalink
comment fall through switches
Browse files Browse the repository at this point in the history
Fixes Coverity #40710, #211397, #40716, #40726, #40727, #40728, #40730,
    #40732, #58373, #58381, #199975, #200059, #200094, #211380, #211372,
    #211359
  • Loading branch information
razvancrainea committed Jul 20, 2020
1 parent 7732d20 commit fbdf77b
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/b2b_sca/sca_db_handler.c
Expand Up @@ -213,6 +213,7 @@ int update_sca_info_to_db(b2b_sca_record_t *record, unsigned int appearance_inde
call->call_info_apperance_uri.len, call->call_info_apperance_uri.s,
call->b2bl_key.len, call->b2bl_key.s);
n_q_vals += 3;
/* fall through */
default:
q_vals[app_shared_entity_col[i]].val.int_val = call->shared_entity;
q_vals[app_call_state_col[i]].val.int_val = call->call_state;
Expand Down
1 change: 1 addition & 0 deletions modules/proto_ws/proto_ws.c
Expand Up @@ -272,6 +272,7 @@ static void ws_conn_clean(struct tcp_connection* c)
break;
case WS_ERR_NONE:
WS_CODE(c) = WS_ERR_NORMAL;
/* fall through */
default:
ws_close(c);
break;
Expand Down
1 change: 1 addition & 0 deletions modules/speeddial/sdlookup.c
Expand Up @@ -174,6 +174,7 @@ int sd_lookup(struct sip_msg* _msg, str* table_s, str* uri_s)
RES_ROWS(db_res)[0].values[0].val.blob_val.len);
user_s.len = RES_ROWS(db_res)[0].values[0].val.blob_val.len;
user_s.s[user_s.len] = '\0';
break;
default:
LM_ERR("unknown type of DB new_uri column\n");
if (db_res != NULL && db_funcs.free_result(db_handle, db_res) < 0)
Expand Down
2 changes: 2 additions & 0 deletions modules/tm/sip_msg.c
Expand Up @@ -1000,6 +1000,8 @@ struct sip_msg* sip_msg_cloner( struct sip_msg *org_msg, int *sip_msg_len,
new_msg->reply_lump = 0;
CLONE_RPL_LUMP_LIST( p, &(new_msg->reply_lump), org_msg->reply_lump);

/* fall through */

case 1: /* updatable and cloning now */
new_msg->msg_flags |= FL_SHM_UPDATABLE|FL_SHM_UPDATED;
/* msg is updatable -> the fields that can be updated are allocated in
Expand Down
1 change: 1 addition & 0 deletions modules/tm/t_fifo.c
Expand Up @@ -392,6 +392,7 @@ static inline int write_to_fifo(char *fifo, int cnt )
switch(errno){
case ENXIO:
LM_ERR("nobody listening on [%s] fifo for reading!\n",fifo);
break;
default:
LM_ERR("failed to open [%s] fifo : %s\n", fifo,
strerror(errno));
Expand Down
3 changes: 3 additions & 0 deletions parser/parse_disposition.c
Expand Up @@ -170,6 +170,7 @@ int parse_disposition( str *s, struct disposition *disp)
break;
case TYPE:
disp->type.len = tmp - disp->type.s;
/* fall through */
case END_TYPE:
case END_VAL:
state = FIND_PARAM;
Expand All @@ -192,6 +193,7 @@ int parse_disposition( str *s, struct disposition *disp)
break;
case PARAM:
disp_p->name.len = tmp - disp_p->name.s;
/* fall through */
case END_PARAM:
state = FIND_VAL;
break;
Expand Down Expand Up @@ -390,6 +392,7 @@ int parse_content_disposition( struct sip_msg *msg )
set_err_info(OSER_EC_PARSER, OSER_EL_MEDIUM,
"error parsing DISPOSITION header");
set_err_reply(400, "bad headers");
/* fall through */
case -1:
/* error when parsing the body */
free_disposition( &disp );
Expand Down
1 change: 1 addition & 0 deletions parser/parse_hname2.c
Expand Up @@ -163,6 +163,7 @@ char* parse_hname2(char* begin, char* end, struct hdr_field* hdr)
switch(val) {

FIRST_QUATERNIONS;
/* fall through */

default:
switch(LOWER_BYTE(*p)) {
Expand Down
3 changes: 3 additions & 0 deletions parser/parse_to.c
Expand Up @@ -558,6 +558,7 @@ static inline char* _parse_to(char* buffer, char *end, struct to_body *to_b,
case URI_OR_TOKEN:
end_mark = tmp;
status = MAYBE_URI_END;
/* fall through */
case MAYBE_URI_END:
case DISPLAY_TOKEN:
case DISPLAY_TOKEN2:
Expand Down Expand Up @@ -651,6 +652,7 @@ static inline char* _parse_to(char* buffer, char *end, struct to_body *to_b,
case URI_OR_TOKEN:
case DISPLAY_TOKEN:
end_mark = tmp;
/* fall through */
case DISPLAY_TOKEN2:
case MAYBE_URI_END:
to_b->display.len=end_mark-to_b->display.s;
Expand All @@ -672,6 +674,7 @@ static inline char* _parse_to(char* buffer, char *end, struct to_body *to_b,
break;
case URI_ENCLOSED:
to_b->uri.len = tmp - to_b->uri.s;
/* fall through */
case E_URI_ENCLOSED:
status = END;
break;
Expand Down
1 change: 1 addition & 0 deletions parser/parse_via.c
Expand Up @@ -1864,6 +1864,7 @@ char* parse_via(char* buffer, char* end, struct via_body *vbody)
case P_PORT:
/*mark the end*/
vb->port_str.len=tmp-vb->port_str.s;
/* fall through */
case L_PORT:
case L_PARAM:
state=F_PARAM;
Expand Down
3 changes: 3 additions & 0 deletions ut.c
Expand Up @@ -438,11 +438,14 @@ void _base32encode(unsigned char *out, unsigned char *in, int inlen,
case 1:
*out++ = pad_char;
*out++ = pad_char;
/* fall through */
case 2:
*out++ = pad_char;
/* fall through */
case 3:
*out++ = pad_char;
*out++ = pad_char;
/* fall through */
case 4:
*out++ = pad_char;
}
Expand Down

0 comments on commit fbdf77b

Please sign in to comment.