Skip to content

Commit

Permalink
fix more switch fall through
Browse files Browse the repository at this point in the history
Coverity CID #199932, #199927, #164020, #164013, #150486, #58380,
    #58379, #58375, #58374, #40705, #40700, #40701
  • Loading branch information
razvancrainea committed Jul 10, 2020
1 parent 710b80a commit e56706a
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/compression/gz_helpers.c
Expand Up @@ -167,6 +167,7 @@ int gzip_uncompress(unsigned char* in, unsigned long ilen, str* out, unsigned lo
switch (rc) {
case Z_NEED_DICT:
rc = Z_DATA_ERROR;
/* fall through */
case Z_DATA_ERROR:
case Z_MEM_ERROR:
case Z_BUF_ERROR:
Expand Down
2 changes: 2 additions & 0 deletions modules/cpl_c/cpl_parser.c
Expand Up @@ -217,6 +217,7 @@ static inline char *decode_mail_url(char *p, char *p_end, char *url,
case EMAIL_KNOWN_HDR_BODY:
if (((*len)&0x0001)==1) p++;
*len = htons(*len);
/* fall through */
case EMAIL_UNKNOWN_HDR_BODY:
hdr_len = 0;
status = EMAIL_HDR_NAME;
Expand All @@ -232,6 +233,7 @@ static inline char *decode_mail_url(char *p, char *p_end, char *url,
"address found in MAIL node!\n");
goto error;
}
/* fall through */
case EMAIL_KNOWN_HDR_BODY:
if (((*len)&0x0001)==1) p++;
*len = htons(*len);
Expand Down
1 change: 1 addition & 0 deletions modules/db_berkeley/bdb_lib.c
Expand Up @@ -1325,6 +1325,7 @@ int bdblib_recover(table_p _tp, int _rc)
{
case DB_LOCK_DEADLOCK:
LM_ERR("DB_LOCK_DEADLOCK detected !!\n");
/* fall through */

case DB_RUNRECOVERY:
LM_ERR("DB_RUNRECOVERY detected !! \n");
Expand Down
1 change: 1 addition & 0 deletions modules/h350/h350_exp_fn.c
Expand Up @@ -279,6 +279,7 @@ int h350_call_preferences(struct sip_msg* _msg, str* avp_name_prefix)
continue;
case REG_ESPACE:
LM_ERR("regexec returned REG_ESPACE - out of memory\n");
/* fall through */
default:
LM_ERR("regexec failed\n");
ldap_api.ldap_value_free_len(attr_vals);
Expand Down
1 change: 1 addition & 0 deletions modules/jabber/jabber.c
Expand Up @@ -622,6 +622,7 @@ int xjab_manage_sipmsg(struct sip_msg *msg, int type)
case XJ_GO_OFFLINE:
dst.len = 0;
dst.s = 0;
/* fall through */
case XJ_JOIN_JCONF:
case XJ_EXIT_JCONF:
jsmsg->msg.len = 0;
Expand Down
3 changes: 3 additions & 0 deletions modules/rabbitmq/rmq_servers.c
Expand Up @@ -229,6 +229,7 @@ int rmq_reconnect(struct rmq_server *srv)
amqp_set_sockfd(srv->conn, socket);
#endif
srv->state = RMQS_INIT;
/* fall through */
case RMQS_INIT:
if (rmq_error("Logging in", amqp_login(
srv->conn,
Expand All @@ -242,13 +243,15 @@ int rmq_reconnect(struct rmq_server *srv)
goto clean_rmq_server;
/* all good - return success */
srv->state = RMQS_CONN;
/* fall through */
case RMQS_CONN:
/* don't use more than 1 channel */
amqp_channel_open(srv->conn, 1);
if (rmq_error("Opening channel", amqp_get_rpc_reply(srv->conn)))
goto clean_rmq_server;
LM_DBG("[%.*s] successfully connected!\n", srv->cid.len, srv->cid.s);
srv->state = RMQS_ON;
/* fall through */
case RMQS_ON:
return 0;
default:
Expand Down
3 changes: 3 additions & 0 deletions modules/rabbitmq_consumer/rmq_connection.c
Expand Up @@ -356,6 +356,7 @@ static int rmq_connect(struct rmq_connection *conn)
}

conn->state = RMQ_CONN_SOCK;
/* fall through */
case RMQ_CONN_SOCK:
if (rmq_rpc_error(conn, "Logging in", amqp_login(
conn->amqp_conn,
Expand All @@ -369,6 +370,7 @@ static int rmq_connect(struct rmq_connection *conn)
goto err_close_rmq_conn;

conn->state = RMQ_CONN_LOGIN;
/* fall through */
case RMQ_CONN_LOGIN:
/* use only 1 channel */
amqp_channel_open(conn->amqp_conn, 1);
Expand All @@ -378,6 +380,7 @@ static int rmq_connect(struct rmq_connection *conn)

LM_DBG("successfully connected to: %s:%u\n", conn->uri.host, conn->uri.port);
conn->state = RMQ_CONN_CHAN;
/* fall through */
case RMQ_CONN_CHAN:
return 0;
default:
Expand Down
2 changes: 2 additions & 0 deletions modules/tls_mgm/tls_conn_ops.h
Expand Up @@ -90,6 +90,7 @@ static int tls_conn_shutdown(struct tcp_connection *c)

default:
LM_ERR("something wrong in SSL: %d, %d, %s\n",err,errno,strerror(errno));
/* fall through */

case SSL_ERROR_SYSCALL:
c->state = S_CONN_BAD;
Expand Down Expand Up @@ -240,6 +241,7 @@ static int _tls_read(struct tcp_connection *c, void *buf, size_t len)

case SSL_ERROR_SYSCALL:
LM_ERR("SYSCALL error -> (%d) <%s>\n",errno,strerror(errno));
/* fall through */
default:
LM_ERR("TLS connection to %s:%d read failed\n",
ip_addr2a(&c->rcv.src_ip), c->rcv.src_port);
Expand Down
1 change: 1 addition & 0 deletions modules/tls_mgm/tls_conn_server.h
Expand Up @@ -472,6 +472,7 @@ static int tls_connect(struct tcp_connection *c, short *poll_events, trace_dest
case SSL_ERROR_SYSCALL:
LM_ERR("SSL_ERROR_SYSCALL err=%s(%d)\n",
strerror(errno), errno);
/* fall through */
default:
LM_ERR("New TLS connection to %s:%d failed\n",
ip_addr2a(&c->rcv.src_ip), c->rcv.src_port);
Expand Down

0 comments on commit e56706a

Please sign in to comment.