Skip to content

Commit

Permalink
Merge branch 'master' into coverity_scan
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Jan 21, 2016
2 parents 4a34916 + a0caa91 commit a145bbb
Show file tree
Hide file tree
Showing 96 changed files with 664 additions and 265 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
@@ -1,5 +1,7 @@
language: c
compiler: gcc
compiler:
- gcc
- clang
sudo: false
env:
global:
Expand Down
2 changes: 1 addition & 1 deletion INSTALL
Expand Up @@ -66,7 +66,7 @@ Requirements:
support (the db_unixodbc module)
- libexpat if you want the jabber gateway support (the jabber module) or the
XMPP gateway support
- libxml2 if you want to use the cpl-c (Call Processing Language) or
- libxml2 if you want to use the cpl_c (Call Processing Language) or
the presence modules (presence and pua*)
- libradius-ng -libs and devel headers- if you want to use functionalities
with radius support - authentication, accounting, group support, etc
Expand Down
4 changes: 2 additions & 2 deletions Makefile.conf.template
Expand Up @@ -7,7 +7,7 @@
#cachedb_redis= Implementation of a cache system designed to work with Redis servers | Redis client library, hiredis
#carrierroute= Provides routing, balancing and blacklisting capabilities. | libconfuse, a configuration file parser library
#compression= Implements SIP message compression/decompression and base64 encoding | zlib dev library, tipically zlib1g-dev
#cpl-c= Implements a CPL (Call Processing Language) interpreter | library for parsing XML files, tipically libxml2 and libxml2-devel
#cpl_c= Implements a CPL (Call Processing Language) interpreter | library for parsing XML files, tipically libxml2 and libxml2-devel
#db_berkeley= Integrates the Berkeley DB into OpenSIPS | Berkeley embedded database
#db_http= Provides access to a database that is implemented as a HTTP server. | CURL library - libcurl
#db_mysql= Provides MySQL connectivity for OpenSIPS | development libraries of mysql-client , tipically libmysqlclient-dev
Expand Down Expand Up @@ -53,7 +53,7 @@
#xcap_client= XCAP client for OpenSIPS.It fetches XCAP elements, either documents or part of them, by sending HTTP GET requests | libxml-dev and libcurl-dev
#xmpp= Gateway between OpenSIPS and a jabber server. It enables the exchange of IMs between SIP clients and XMPP(jabber) clients. | parsing/building XML files, tipically libexpat1-devel

exclude_modules?= aaa_radius b2b_logic cachedb_cassandra cachedb_couchbase cachedb_memcached cachedb_mongodb cachedb_redis carrierroute compression cpl-c db_berkeley db_http db_mysql db_oracle db_perlvdb db_postgres db_sqlite db_unixodbc dialplan emergency event_rabbitmq h350 regex identity jabber json ldap lua httpd mi_xmlrpc_ng mmgeoip osp perl pi_http presence presence_dialoginfo presence_mwi presence_xml proto_sctp proto_tls pua pua_bla pua_dialoginfo pua_mi pua_usrloc pua_xmpp python rest_client rls sngtc snmpstats tls_mgm xcap xcap_client xmpp
exclude_modules?= aaa_radius b2b_logic cachedb_cassandra cachedb_couchbase cachedb_memcached cachedb_mongodb cachedb_redis carrierroute compression cpl_c db_berkeley db_http db_mysql db_oracle db_perlvdb db_postgres db_sqlite db_unixodbc dialplan emergency event_rabbitmq h350 regex identity jabber json ldap lua httpd mi_xmlrpc_ng mmgeoip osp perl pi_http presence presence_dialoginfo presence_mwi presence_xml proto_sctp proto_tls pua pua_bla pua_dialoginfo pua_mi pua_usrloc pua_xmpp python rest_client rls sngtc snmpstats tls_mgm xcap xcap_client xmpp

include_modules?=

Expand Down
2 changes: 1 addition & 1 deletion README-MODULES
Expand Up @@ -108,7 +108,7 @@ Maturity: alpha
Depends on: db-module
Purpose: Group dialing (PBX like).

Name: cpl-c
Name: cpl_c
Use: regular
Maturity: stable
Depends on: tm, sl, usrloc
Expand Down
5 changes: 3 additions & 2 deletions action.c
Expand Up @@ -240,7 +240,7 @@ int do_assign(struct sip_msg* msg, struct action* a)
if(a->elem[1].type != NULLV_ST)
{
ret = eval_expr((struct expr*)a->elem[1].u.data, msg, &val);
if(!(val.flags & (PV_VAL_STR | PV_VAL_INT | PV_VAL_NULL)))
if(ret < 0 || !(val.flags & (PV_VAL_STR | PV_VAL_INT | PV_VAL_NULL)))
{
LM_WARN("no value in right expression at %s:%d\n",
a->file, a->line);
Expand Down Expand Up @@ -472,7 +472,8 @@ int do_action(struct action* a, struct sip_msg* msg)
break;
case DROP_T:
script_trace("core", "drop", msg, a->file, a->line) ;
action_flags |= ACT_FL_DROP;
action_flags |= ACT_FL_DROP|ACT_FL_EXIT;
break;
case EXIT_T:
script_trace("core", "exit", msg, a->file, a->line) ;
ret=0;
Expand Down
18 changes: 0 additions & 18 deletions context.c
Expand Up @@ -168,9 +168,6 @@ void context_put_int(enum osips_context type, context_p ctx,
}
#endif

if (!ctx)
LM_CRIT("NULL context given\n");

((int *)ctx)[pos] = data;
}

Expand All @@ -184,9 +181,6 @@ void context_put_str(enum osips_context type, context_p ctx,
}
#endif

if (!ctx)
LM_CRIT("NULL context given\n");

((str *)((char *)ctx + type_offsets[type][CONTEXT_STR_TYPE]))[pos] = *data;
}

Expand All @@ -200,9 +194,6 @@ void context_put_ptr(enum osips_context type, context_p ctx,
}
#endif

if (!ctx)
LM_CRIT("NULL context given\n");

((void **)((char *)ctx + type_offsets[type][CONTEXT_PTR_TYPE]))[pos] = data;
}

Expand All @@ -215,9 +206,6 @@ int context_get_int(enum osips_context type, context_p ctx, int pos)
}
#endif

if (!ctx)
LM_CRIT("NULL context given\n");

return ((int *)ctx)[pos];
}

Expand All @@ -230,9 +218,6 @@ str *context_get_str(enum osips_context type, context_p ctx, int pos)
}
#endif

if (!ctx)
LM_CRIT("NULL context given\n");

return &((str *)((char *)ctx + type_offsets[type][CONTEXT_STR_TYPE]))[pos];
}

Expand All @@ -245,8 +230,5 @@ void *context_get_ptr(enum osips_context type, context_p ctx, int pos)
}
#endif

if (!ctx)
LM_CRIT("NULL context given\n");

return ((void **)((char *)ctx + type_offsets[type][CONTEXT_PTR_TYPE]))[pos];
}
7 changes: 5 additions & 2 deletions daemonize.c
Expand Up @@ -307,12 +307,12 @@ int daemonize(char* name, int * own_pgid)
goto error;
}else{
r = fprintf(pid_stream, "%i\n", (int)pid);
fclose(pid_stream);
if (r<=0) {
LM_ERR("unable to write pid to file %s: %s\n",
pid_file, strerror(errno));
goto error;
}
fclose(pid_stream);
}
}

Expand All @@ -333,13 +333,13 @@ int daemonize(char* name, int * own_pgid)
goto error;
}else{
r = fprintf(pid_stream, "%i\n", (int)pid);
fclose(pid_stream);
if (r<=0) {
LM_ERR("unable to write pgid to file %s: %s\n",
pid_file, strerror(errno));
fclose(pid_stream);
goto error;
}
fclose(pid_stream);
}
}else{
LM_WARN("we don't have our own process so we won't save"
Expand Down Expand Up @@ -543,6 +543,9 @@ int set_core_dump(int enable, unsigned int size)
(unsigned long)lim.rlim_max);
}
goto error; /* it's an error we haven't got the size we wanted*/
} else {
/* using the same limit as before - disable uninitialized warning */
newlim.rlim_cur = lim.rlim_cur;
}
goto done; /*nothing to do */
}else{
Expand Down
5 changes: 5 additions & 0 deletions db/db_insertq.c
Expand Up @@ -578,6 +578,11 @@ void ql_timer_routine(unsigned int ticks,void *param)

if (it->conn[process_no] == NULL)
{
if (!it->dbf.init) {
LM_ERR("DB engine does not have init function\n");
lock_release(it->lock);
continue;
}
it->conn[process_no] = it->dbf.init(&it->url);
if (it->conn[process_no] == 0)
{
Expand Down
2 changes: 1 addition & 1 deletion db/schema/cpl.xml
Expand Up @@ -12,7 +12,7 @@
<version>2</version>
<type db="mysql">&MYSQL_TABLE_TYPE;</type>
<description>
<db:para>Table for the call processing language "cpl" module. More information is available at: &OPENSIPS_MOD_DOC;cpl-c.html</db:para>
<db:para>Table for the call processing language "cpl" module. More information is available at: &OPENSIPS_MOD_DOC;cpl_c.html</db:para>
</description>

<column id="id">
Expand Down
2 changes: 1 addition & 1 deletion doc/doxygen/opensips-doxygen
Expand Up @@ -491,7 +491,7 @@ INPUT = ./ \
modules/avp_radius \
modules/benchmark \
modules/cfgutils \
modules/cpl-c \
modules/cpl_c \
modules/carrierroute \
modules/db_berkeley \
modules/db_text \
Expand Down
8 changes: 5 additions & 3 deletions evi/event_interface.c
Expand Up @@ -509,18 +509,20 @@ struct mi_root * mi_events_list(struct mi_root *cmd_tree, void *param)

static int evi_print_subscriber(struct mi_node *rpl, evi_subs_p subs)
{
evi_reply_sock *sock = subs != NULL ? subs->reply_sock : NULL;
struct mi_node *node = NULL;
evi_reply_sock *sock;
struct mi_node *node;
str socket;

if (!subs->trans_mod || !subs->trans_mod->print) {
if (!subs || !subs->trans_mod || !subs->trans_mod->print) {
LM_ERR("subscriber does not have a print method exported\n");
return -1;
}

node = add_mi_node_child(rpl, 0, "Subscriber", 10, 0, 0);
if(node == NULL)
return -1;

sock = subs->reply_sock;
if (!sock) {
LM_DBG("no socket specified\n");
if (!add_mi_attr(node, 0, "protocol", 8,
Expand Down
4 changes: 3 additions & 1 deletion modules/aaa_radius/aaa_radius.c
Expand Up @@ -209,6 +209,7 @@ int parse_set_content(str content, rad_set_elem *elem) {
s->len = strlen(p);

p = pv_parse_spec(s, mp->pv);
CHECK_COND(p != NULL);

for (; isspace(*p); p++);
if (*p != '\0') {
Expand Down Expand Up @@ -289,7 +290,8 @@ int make_send_message(struct sip_msg* msg, int index, VALUE_PAIR **send) {
map_list *mp = sets[index]->parsed;

for (; mp; mp = mp->next) {
pv_get_spec_value(msg, mp->pv, &pt);
if (pv_get_spec_value(msg, mp->pv, &pt) < 0)
return -1;

if (pt.flags & PV_VAL_INT) {
//LM_DBG("%.*s---->%d---->%d---->%d\n",mp->name.len, mp->name.s,
Expand Down
1 change: 1 addition & 0 deletions modules/acc/acc_extra.c
Expand Up @@ -276,6 +276,7 @@ int extra2strar( struct acc_extra *extra, struct sip_msg *rq,
}
return n;
}
memset(&value, 0, sizeof(pv_value_t));

for( n=0,r=0 ; extra ; extra=extra->next,n++) {
/* get the value */
Expand Down
2 changes: 1 addition & 1 deletion modules/avpops/avpops.c
Expand Up @@ -1286,7 +1286,7 @@ static int fixup_insert_avp(void** param, int param_no)
{
unsigned int* index;

index = (unsigned int*)pkg_malloc(sizeof(unsigned int*));
index = (unsigned int*)pkg_malloc(sizeof(unsigned int));
if(index == NULL)
{
LM_ERR("No more memory\n");
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit a145bbb

Please sign in to comment.