diff --git a/modules/app_java/java_msgobj.c b/modules/app_java/java_msgobj.c index 0a43786feaa..fc32849684f 100644 --- a/modules/app_java/java_msgobj.c +++ b/modules/app_java/java_msgobj.c @@ -230,7 +230,7 @@ jobject *fill_sipmsg_object(JNIEnv *env, struct sip_msg *msg) LM_ERR("%s: Can't find symbol org.siprouter.SipMsg.add_to_branch_s\n", APP_NAME); return NULL; } - jStrParam = (*env)->NewStringUTF(env, (msg->add_to_branch_len <= 0 || msg->add_to_branch_s == NULL) ? "" : strdup(msg->add_to_branch_s)); + jStrParam = (*env)->NewStringUTF(env, (msg->add_to_branch_len <= 0) ? "" : strdup(msg->add_to_branch_s)); (*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam); if ((*env)->ExceptionCheck(env)) { diff --git a/modules/auth_radius/authorize.c b/modules/auth_radius/authorize.c index 18dff11597f..36c74ebc8d7 100644 --- a/modules/auth_radius/authorize.c +++ b/modules/auth_radius/authorize.c @@ -74,7 +74,7 @@ static inline int authorize(struct sip_msg* _msg, pv_elem_t* _realm, pv_spec_t * _uri_user, hdr_types_t _hftype) { int res; - auth_result_t ret; + auth_cfg_result_t ret; struct hdr_field* h; auth_body_t* cred; str *uri_user; diff --git a/modules/cdp/diameter_api.h b/modules/cdp/diameter_api.h index c0d049578bb..f9ba4181484 100644 --- a/modules/cdp/diameter_api.h +++ b/modules/cdp/diameter_api.h @@ -76,7 +76,7 @@ typedef AAAReturnCode (*AAAFreeAVPList_f)(AAA_AVP_LIST *avpList); -AAAResultCode AAASetMessageResultCode(AAAMessage *message,AAAResultCode resultCode); +AAAReturnCode AAASetMessageResultCode(AAAMessage *message,AAAResultCode resultCode); void AAAPrintMessage(AAAMessage *msg); diff --git a/modules/cdp/diameter_msg.c b/modules/cdp/diameter_msg.c index 0814a9323a2..3630d40f1f0 100644 --- a/modules/cdp/diameter_msg.c +++ b/modules/cdp/diameter_msg.c @@ -434,7 +434,7 @@ AAAReturnCode AAAFreeMessage(AAAMessage **msg) * @param resultCode - code to set as result * \note This function is taken from DISC http://developer.berlios.de/projects/disc/ */ -AAAResultCode AAASetMessageResultCode( +AAAReturnCode AAASetMessageResultCode( AAAMessage *message, AAAResultCode resultCode) { diff --git a/modules/cdp/peerstatemachine.c b/modules/cdp/peerstatemachine.c index b5e6dd7ae7c..c69cc9972a7 100644 --- a/modules/cdp/peerstatemachine.c +++ b/modules/cdp/peerstatemachine.c @@ -519,7 +519,7 @@ int sm_process(peer *p,peer_event_t event,AAAMessage *msg,int peer_locked,int so * @param p - peer to send to * @returns the new state for the peer */ -peer_state_t I_Snd_Conn_Req(peer *p) +peer_event_t I_Snd_Conn_Req(peer *p) { LM_INFO("I_Snd_Conn_Req(): Peer %.*s \n", p->fqdn.len,p->fqdn.s); diff --git a/modules/cdp/peerstatemachine.h b/modules/cdp/peerstatemachine.h index 47d93f8433c..4b9ef8a3c36 100644 --- a/modules/cdp/peerstatemachine.h +++ b/modules/cdp/peerstatemachine.h @@ -50,7 +50,7 @@ int sm_process(peer *p,peer_event_t event,AAAMessage *msg,int peer_locked,int sock); -peer_state_t I_Snd_Conn_Req(peer *p); +peer_event_t I_Snd_Conn_Req(peer *p); void Cleanup(peer *p,int sock); void Error(peer *p, int sock); void I_Snd_CER(peer *p); diff --git a/modules/cdp/session.c b/modules/cdp/session.c index f418204fe62..3c904c3e9bf 100644 --- a/modules/cdp/session.c +++ b/modules/cdp/session.c @@ -73,7 +73,7 @@ unsigned int *session_id2; /**< counter for second part of the session id */ inline void AAASessionsLock(unsigned int hash) { if(destroy_modules_phase()) return; - if ( hash >=0 && hash < sessions_hash_size ){ + if ( hash < sessions_hash_size ){ lock_get(sessions[hash].lock); } else { @@ -88,7 +88,7 @@ inline void AAASessionsUnlock(unsigned int hash) { if(destroy_modules_phase()) return; - if ( hash >=0 && hash < sessions_hash_size ){ + if ( hash < sessions_hash_size ){ lock_release(sessions[hash].lock); } else { @@ -330,7 +330,7 @@ void del_session(cdp_session_t *x) if (!x) return; hash = x->hash; - if (hash < 0 || hash >= sessions_hash_size) { + if (hash >= sessions_hash_size) { LM_ERR("del_session: x->hash :%d out of range of sessions_hash_size: %d !\n",hash, sessions_hash_size); return; } diff --git a/modules/db_berkeley/km_db_berkeley.c b/modules/db_berkeley/km_db_berkeley.c index 9b0806ef3e3..e7e05f5fd68 100644 --- a/modules/db_berkeley/km_db_berkeley.c +++ b/modules/db_berkeley/km_db_berkeley.c @@ -362,9 +362,10 @@ int km_bdb_query(db1_con_t* _con, db_key_t* _k, db_op_t* _op, db_val_t* _v, table_p _tp = NULL; char kbuf[MAX_ROW_SIZE]; char dbuf[MAX_ROW_SIZE]; - u_int32_t i, len, ret; + u_int32_t i, len; int klen=MAX_ROW_SIZE; int *lkey=NULL, *lres=NULL; + int ret; DBT key, data; DB *db; DBC *dbcp; diff --git a/modules/ims_auth/cxdx_avp.c b/modules/ims_auth/cxdx_avp.c index a09e6b24b22..bd4031c8406 100644 --- a/modules/ims_auth/cxdx_avp.c +++ b/modules/ims_auth/cxdx_avp.c @@ -658,7 +658,7 @@ int cxdx_get_auth_data_item_answer(AAAMessage *msg, AAA_AVP **auth_data, avp = cdpb.AAAFindMatchingAVPList(list,0,AVP_IMS_SIP_Item_Number, IMS_vendor_id_3GPP,0); - if (!avp||!avp->data.len==4) *item_number=0; + if (!avp||avp->data.len!=4) *item_number=0; else *item_number = get_4bytes(avp->data.s); avp = cdpb.AAAFindMatchingAVPList(list,0,AVP_IMS_SIP_Authentication_Scheme, diff --git a/modules/ims_auth/cxdx_mar.c b/modules/ims_auth/cxdx_mar.c index 1f81d0c340b..a949edd5e25 100644 --- a/modules/ims_auth/cxdx_mar.c +++ b/modules/ims_auth/cxdx_mar.c @@ -373,7 +373,7 @@ void async_cdp_callback(int is_timeout, void *param, AAAMessage *maa, long elaps &scscf_name_str, 0, result_hex); pkg_free(etsi_nonce.s); - if (!tmp->response_auth.len == 32 + if (tmp->response_auth.len != 32 || strncasecmp(tmp->response_auth.s, result_hex, 32)) { LM_ERR("The HSS' Response-Auth is different from what we compute locally!\n" " BUT! If you sent an MAR with auth scheme unknown (HSS-Selected Authentication), this is normal.\n" diff --git a/modules/ims_dialog/dlg_handlers.c b/modules/ims_dialog/dlg_handlers.c index 394c7798dd0..faf76787095 100644 --- a/modules/ims_dialog/dlg_handlers.c +++ b/modules/ims_dialog/dlg_handlers.c @@ -1342,7 +1342,7 @@ void dlg_onreply(struct cell* t, int type, struct tmcb_params *param) { if (!dlg_out) { if (rpl->first_line.u.reply.statuscode < 299) { /*we don't care about failure responses to dialog - not necessary to create dialog out...*/ - if (rpl->via1->branch && (&rpl->via1->branch->value) && (rpl->via1->branch->value.len > 0)) { + if (rpl->via1->branch && (rpl->via1->branch->value.len > 0)) { branch = rpl->via1->branch->value; } diff --git a/modules/misc_radius/functions.c b/modules/misc_radius/functions.c index fb9ec784c1f..e171468a748 100644 --- a/modules/misc_radius/functions.c +++ b/modules/misc_radius/functions.c @@ -44,7 +44,7 @@ static inline int extract_avp(VALUE_PAIR* vp, unsigned short *flags, char *end; /* empty? */ - if (vp->lvalue==0 || vp->strvalue==0) + if (vp->lvalue==0) goto error; p = vp->strvalue; diff --git a/modules/peering/verify.c b/modules/peering/verify.c index cafd12ccad7..743fcfe2992 100644 --- a/modules/peering/verify.c +++ b/modules/peering/verify.c @@ -55,7 +55,7 @@ static inline int extract_avp(VALUE_PAIR* vp, unsigned short *flags, char *end; /* empty? */ - if (vp->lvalue==0 || vp->strvalue==0) + if (vp->lvalue==0) goto error; p = vp->strvalue; diff --git a/modules/pua_xmpp/xmpp2simple.c b/modules/pua_xmpp/xmpp2simple.c index 0d141255651..709351c9c0d 100644 --- a/modules/pua_xmpp/xmpp2simple.c +++ b/modules/pua_xmpp/xmpp2simple.c @@ -369,7 +369,7 @@ int build_publish(xmlNodePtr pres_node, int expires) return -1; } strcpy(resource, slash+1); - slash= '\0'; + slash= NULL; } pres_uri= euri_xmpp_sip(uri); xmlFree(uri); diff --git a/modules/tls/tls_config.c b/modules/tls/tls_config.c index af1d88a0324..fc631550b48 100644 --- a/modules/tls/tls_config.c +++ b/modules/tls/tls_config.c @@ -400,12 +400,16 @@ tls_domains_cfg_t* tls_load_config(str* filename) pkg_free(file_path); file_path = NULL; while (read(in_fd, &ch, 1)) { - write(out_fd, &ch, 1); + if (write(out_fd, &ch, 1)<0) { + LOG(L_ERR, "write error: %s\n", strerror(errno)); + } } close(in_fd); in_fd = 0; ch = '\n'; - write(out_fd, &ch, 1); + if (write(out_fd, &ch, 1)<0) { + LOG(L_ERR, "write error: %s\n", strerror(errno)); + } } } closedir(dir);