kamailio.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
List overview
Download
sr-dev
July 2017
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
sr-dev@lists.kamailio.org
23 participants
410 discussions
Start a n
N
ew thread
git:master:0cf4ad7b: app_perl: free on error cases for modf execution
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 0cf4ad7b4e839856eef4dc2cd76adacd1627ce7c URL:
https://github.com/kamailio/kamailio/commit/0cf4ad7b4e839856eef4dc2cd76adac…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2017-07-24T13:24:49+02:00 app_perl: free on error cases for modf execution --- Modified: src/modules/app_perl/kamailioxs.xs --- Diff:
https://github.com/kamailio/kamailio/commit/0cf4ad7b4e839856eef4dc2cd76adac…
Patch:
https://github.com/kamailio/kamailio/commit/0cf4ad7b4e839856eef4dc2cd76adac…
--- diff --git a/src/modules/app_perl/kamailioxs.xs b/src/modules/app_perl/kamailioxs.xs index 8d2604c1a5..385fa1a115 100644 --- a/src/modules/app_perl/kamailioxs.xs +++ b/src/modules/app_perl/kamailioxs.xs @@ -289,6 +289,7 @@ int moduleFunc(struct sip_msg *m, char *func, LM_ERR("Module function '%s' is unsafe. Call is refused.\n", func); if (argv[0]) pkg_free(argv[0]); if (argv[1]) pkg_free(argv[1]); + pkg_free(act); *retval = -1; return -1; } @@ -297,6 +298,9 @@ int moduleFunc(struct sip_msg *m, char *func, *retval = exp_func_struct->fixup(&(act->val[3].u.data), 2); if (*retval < 0) { LM_ERR("Error in fixup (2)\n"); + if (argv[0]) pkg_free(argv[0]); + if (argv[1]) pkg_free(argv[1]); + pkg_free(act); return -1; } act->val[3].type = MODFIXUP_ST; @@ -305,6 +309,9 @@ int moduleFunc(struct sip_msg *m, char *func, *retval = exp_func_struct->fixup(&(act->val[2].u.data), 1); if (*retval < 0) { LM_ERR("Error in fixup (1)\n"); + if (argv[0]) pkg_free(argv[0]); + if (argv[1]) pkg_free(argv[1]); + pkg_free(act); return -1; } act->val[2].type = MODFIXUP_ST; @@ -313,6 +320,9 @@ int moduleFunc(struct sip_msg *m, char *func, *retval = exp_func_struct->fixup(0, 0); if (*retval < 0) { LM_ERR("Error in fixup (0)\n"); + if (argv[0]) pkg_free(argv[0]); + if (argv[1]) pkg_free(argv[1]); + pkg_free(act); return -1; } } @@ -337,7 +347,7 @@ int moduleFunc(struct sip_msg *m, char *func, if (argv[1]) pkg_free(argv[1]); pkg_free(act); - + return 1; } @@ -699,7 +709,9 @@ getFullHeader(self) LM_ERR("getFullHeader: Invalid message type.\n"); ST(0) = &PL_sv_undef; } else { - parse_headers(msg, ~0, 0); + if(parse_headers(msg, ~0, 0)<0) { + LM_ERR("failed to parse headers\n"); + } if (getType(msg) == SIP_REQUEST) { firsttoken = (msg->first_line).u.request.method.s; } else { /* SIP_REPLY */ @@ -713,7 +725,7 @@ getFullHeader(self) -((long)(firsttoken)); if (headerlen > 0) { - ST(0) = + ST(0) = sv_2mortal(newSVpv(firsttoken, headerlen)); } else { ST(0) = &PL_sv_undef; @@ -739,7 +751,9 @@ getBody(self) LM_ERR("Invalid message reference\n"); ST(0) = &PL_sv_undef; } else { - parse_headers(msg, ~0, 0); + if(parse_headers(msg, ~0, 0)<0) { + LM_ERR("failed to parse headers\n"); + } ST(0) = sv_2mortal(newSVpv(get_body(msg), 0)); } @@ -792,7 +806,9 @@ getHeader(self, name) if (!msg) { LM_ERR("Invalid message reference\n"); } else { - parse_headers(msg, ~0, 0); + if(parse_headers(msg, ~0, 0)<0) { + LM_ERR("failed to parse headers\n"); + } for (hf = msg->headers; hf; hf = hf->next) { if (namelen == hf->name.len) { if (strncmp(name, hf->name.s, namelen) == 0) { @@ -825,11 +841,13 @@ getHeaderNames(self) struct hdr_field *hf = NULL; int found = 0; PPCODE: - + if (!msg) { LM_ERR("Invalid message reference\n"); } else { - parse_headers(msg, ~0, 0); + if(parse_headers(msg, ~0, 0)<0) { + LM_ERR("failed to parse headers\n"); + } for (hf = msg->headers; hf; hf = hf->next) { found = 1; XPUSHs(sv_2mortal(newSVpv(hf->name.s, hf->name.len))); @@ -1231,17 +1249,22 @@ getParsedRURI(self) LM_ERR("Invalid message reference\n"); ST(0) = NULL; } else { - parse_sip_msg_uri(msg); - parse_headers(msg, ~0, 0); - - uri = &(msg->parsed_uri); - ret = sv_newmortal(); - sv_setref_pv(ret, "Kamailio::URI", (void *)uri); - SvREADONLY_on(SvRV(ret)); + if(parse_sip_msg_uri(msg)<0) { + LM_ERR("Invalid message uri\n"); + ST(0) = NULL; + } else { + if(parse_headers(msg, ~0, 0)<0) { + LM_ERR("failed to parse headers\n"); + } + uri = &(msg->parsed_uri); + ret = sv_newmortal(); + sv_setref_pv(ret, "Kamailio::URI", (void *)uri); + SvREADONLY_on(SvRV(ret)); - ST(0) = ret; + ST(0) = ret; + } } - + MODULE = Kamailio PACKAGE = Kamailio::URI
7 years, 5 months
1
0
0
0
git:master:0f3fb6b8: xmlrpc: handle return codes
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 0f3fb6b8cb04162be07e9246c23bcfa8b8e4e4e6 URL:
https://github.com/kamailio/kamailio/commit/0f3fb6b8cb04162be07e9246c23bcfa…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2017-07-24T13:00:44+02:00 xmlrpc: handle return codes --- Modified: src/modules/xmlrpc/xmlrpc.c --- Diff:
https://github.com/kamailio/kamailio/commit/0f3fb6b8cb04162be07e9246c23bcfa…
Patch:
https://github.com/kamailio/kamailio/commit/0f3fb6b8cb04162be07e9246c23bcfa…
--- diff --git a/src/modules/xmlrpc/xmlrpc.c b/src/modules/xmlrpc/xmlrpc.c index ef1535cc88..61b73d0993 100644 --- a/src/modules/xmlrpc/xmlrpc.c +++ b/src/modules/xmlrpc/xmlrpc.c @@ -654,7 +654,7 @@ static int fix_delayed_reply_ctx(rpc_ctx_t* ctx) { if ((ctx->flags & XMLRPC_DELAYED_CTX_F) && (ctx->reply.buf.s==0)){ if (init_xmlrpc_reply(&ctx->reply) <0) return -1; - add_xmlrpc_reply(&ctx->reply, &success_prefix); + if(add_xmlrpc_reply(&ctx->reply, &success_prefix)<0) return -1; if (ctx->flags & RET_ARRAY) return add_xmlrpc_reply(&ctx->reply, &array_prefix); } @@ -787,7 +787,7 @@ static int get_rpc_document(str* doc, sip_msg_t* msg) */ static int send_reply(sip_msg_t* msg, str* body) { - if (add_lump_rpl(msg, body->s, body->len, LUMP_RPL_BODY) < 0) { + if (add_lump_rpl(msg, body->s, body->len, LUMP_RPL_BODY) == 0) { ERR("Error while adding reply lump\n"); return -1; } @@ -1965,6 +1965,7 @@ static int rpc_struct_scan(struct rpc_struct* s, char* fmt, ...) break; default: ERR("Invalid parameter type in formatting string: %c\n", *fmt); + va_end(ap); return -1; } fmt++; @@ -2176,7 +2177,7 @@ static int init_context(rpc_ctx_t* ctx, sip_msg_t* msg) ctx->doc = 0; ctx->structs = 0; if (init_xmlrpc_reply(&ctx->reply) < 0) return -1; - add_xmlrpc_reply(&ctx->reply, &success_prefix); + if (add_xmlrpc_reply(&ctx->reply, &success_prefix)<0) return -1; if (open_doc(ctx, msg) < 0) return -1; return 0; } @@ -2367,7 +2368,9 @@ static int process_xmlrpc(sip_msg_t* msg) n_method = method[0] + (method[1] << 8) + (method[2] << 16) + (method[3] << 24); n_method |= 0x20202020; - n_method &= ((method_len < 4) * (1U << method_len * 8) - 1); + if(method_len < 4) { + n_method &= ((1U << (method_len * 8)) - 1); + } /* accept only GET or POST */ if ((n_method == N_HTTP_GET) || ((n_method == N_HTTP_POST) && (method_len == HTTP_POST_LEN))) {
7 years, 5 months
1
0
0
0
git:master:96582d77: xcap_client: safety check for namespace variable
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 96582d77583719d7bb9c5e5437198800ae9e7a12 URL:
https://github.com/kamailio/kamailio/commit/96582d77583719d7bb9c5e543719880…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2017-07-24T12:22:00+02:00 xcap_client: safety check for namespace variable --- Modified: src/modules/xcap_client/xcap_functions.c --- Diff:
https://github.com/kamailio/kamailio/commit/96582d77583719d7bb9c5e543719880…
Patch:
https://github.com/kamailio/kamailio/commit/96582d77583719d7bb9c5e543719880…
--- diff --git a/src/modules/xcap_client/xcap_functions.c b/src/modules/xcap_client/xcap_functions.c index 6b875b17d0..cee161b7d0 100644 --- a/src/modules/xcap_client/xcap_functions.c +++ b/src/modules/xcap_client/xcap_functions.c @@ -223,7 +223,7 @@ xcap_node_sel_t* xcapNodeSelAddStep(xcap_node_sel_t* curr_sel, str* name, } curr_sel->size+= 1+ new_step.len; - if(namespace->len) + if(namespace && namespace->len) { curr_sel->size+= namespace->len+ 3; }
7 years, 5 months
1
0
0
0
git:master:e6e04f4c: xcap_client: removed unused api function get_elem()
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: e6e04f4c96e5fdd7a3a90f265fd6cb7470f1135b URL:
https://github.com/kamailio/kamailio/commit/e6e04f4c96e5fdd7a3a90f265fd6cb7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2017-07-24T12:15:55+02:00 xcap_client: removed unused api function get_elem() --- Modified: src/modules/xcap_client/xcap_functions.c Modified: src/modules/xcap_client/xcap_functions.h --- Diff:
https://github.com/kamailio/kamailio/commit/e6e04f4c96e5fdd7a3a90f265fd6cb7…
Patch:
https://github.com/kamailio/kamailio/commit/e6e04f4c96e5fdd7a3a90f265fd6cb7…
--- diff --git a/src/modules/xcap_client/xcap_functions.c b/src/modules/xcap_client/xcap_functions.c index 1b2e6b457f..6b875b17d0 100644 --- a/src/modules/xcap_client/xcap_functions.c +++ b/src/modules/xcap_client/xcap_functions.c @@ -50,7 +50,6 @@ int bind_xcap(xcap_api_t* api) LM_ERR("Invalid parameter value\n"); return -1; } - api->get_elem= xcapGetElem; api->int_node_sel= xcapInitNodeSel; api->add_step= xcapNodeSelAddStep; api->add_terminal= xcapNodeSelAddTerminal; @@ -455,39 +454,6 @@ char* get_xcap_path(xcap_get_req_t req) return NULL; } -/* xcap_root must be a NULL terminated string */ - -char* xcapGetElem(xcap_get_req_t req, char** etag) -{ - char* path= NULL; - char* stream= NULL; - - path= get_xcap_path(req); - if(path== NULL) - { - LM_ERR("while constructing xcap path\n"); - return NULL; - } - - stream= send_http_get(path, req.port, req.etag, req.match_type, etag); - if(stream== NULL) - { - LM_DBG("the serched element was not found\n"); - } - - if(etag== NULL) - { - LM_ERR("no etag found\n"); - pkg_free(stream); - stream= NULL; - } - - if(path) - pkg_free(path); - - return stream; -} - size_t get_xcap_etag( void *ptr, size_t size, size_t nmemb, void *stream) { int len= 0; diff --git a/src/modules/xcap_client/xcap_functions.h b/src/modules/xcap_client/xcap_functions.h index 8750aeae53..44ae635972 100644 --- a/src/modules/xcap_client/xcap_functions.h +++ b/src/modules/xcap_client/xcap_functions.h @@ -103,11 +103,6 @@ xcap_node_sel_t* xcapNodeSelAddTerminal(xcap_node_sel_t* curr_sel, typedef xcap_node_sel_t* (*xcap_nodeSel_add_terminal_t)(xcap_node_sel_t* curr_sel, char* attr_sel, char* namespace_sel, char* extra_sel ); -/* generical function to get an element from an xcap server */ -char* xcapGetElem(xcap_get_req_t req, char** etag); - -typedef char* (*xcap_get_elem_t)(xcap_get_req_t req, char** etag); - void xcapFreeNodeSel(xcap_node_sel_t* node); typedef void (*xcap_nodeSel_free_t)(xcap_node_sel_t* node); @@ -118,7 +113,6 @@ char* xcapGetNewDoc(xcap_get_req_t req, str user, str domain); typedef char* (*xcapGetNewDoc_t)(xcap_get_req_t req, str user, str domain); typedef struct xcap_api { - xcap_get_elem_t get_elem; xcap_nodeSel_init_t int_node_sel; xcap_nodeSel_add_step_t add_step; xcap_nodeSel_add_terminal_t add_terminal;
7 years, 5 months
1
0
0
0
git:master:8147009b: xcap_client: handle return code for strchr()
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 8147009b34639304fb75d4f6c39269c49ee385ca URL:
https://github.com/kamailio/kamailio/commit/8147009b34639304fb75d4f6c39269c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2017-07-24T12:15:09+02:00 xcap_client: handle return code for strchr() --- Modified: src/modules/xcap_client/xcap_client.c --- Diff:
https://github.com/kamailio/kamailio/commit/8147009b34639304fb75d4f6c39269c…
Patch:
https://github.com/kamailio/kamailio/commit/8147009b34639304fb75d4f6c39269c…
--- diff --git a/src/modules/xcap_client/xcap_client.c b/src/modules/xcap_client/xcap_client.c index e96511651d..0b8a707d8d 100644 --- a/src/modules/xcap_client/xcap_client.c +++ b/src/modules/xcap_client/xcap_client.c @@ -310,24 +310,33 @@ int parse_doc_url(str doc_url, char** serv_addr, xcap_doc_sel_t* doc_sel) char* sl, *str_type; sl= strchr(doc_url.s, '/'); + if(sl==NULL) { + return -1; + } *sl= '\0'; *serv_addr= doc_url.s; sl++; doc_sel->auid.s= sl; sl= strchr(sl, '/'); + if(sl==NULL) { + return -1; + } doc_sel->auid.len= sl- doc_sel->auid.s; sl++; str_type= sl; sl= strchr(sl, '/'); + if(sl==NULL) { + return -1; + } *sl= '\0'; - if(strcasecmp(str_type, "users")== 0) + if(strcasecmp(str_type, "users")== 0) { doc_sel->type= USERS_TYPE; - else - if(strcasecmp(str_type, "group")== 0) + } else if(strcasecmp(str_type, "group")== 0) { doc_sel->type= GLOBAL_TYPE; + } sl++;
7 years, 5 months
1
0
0
0
git:master:37129325: presence_xml: fixed misleading error message
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 371293257d000c004f78068f15a4184df3dbd57b URL:
https://github.com/kamailio/kamailio/commit/371293257d000c004f78068f15a4184…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2017-07-24T12:14:18+02:00 presence_xml: fixed misleading error message --- Modified: src/modules/presence_xml/presence_xml.c --- Diff:
https://github.com/kamailio/kamailio/commit/371293257d000c004f78068f15a4184…
Patch:
https://github.com/kamailio/kamailio/commit/371293257d000c004f78068f15a4184…
--- diff --git a/src/modules/presence_xml/presence_xml.c b/src/modules/presence_xml/presence_xml.c index da0e056e3e..0f221852d7 100644 --- a/src/modules/presence_xml/presence_xml.c +++ b/src/modules/presence_xml/presence_xml.c @@ -242,7 +242,7 @@ static int mod_init(void) xcap_GetNewDoc= xcap_api.getNewDoc; if(xcap_GetNewDoc== NULL) { - LM_ERR("can't import get_elem from xcap_client module\n"); + LM_ERR("can't import getNewDoc from xcap_client module\n"); return -1; } @@ -559,4 +559,4 @@ int mod_register(char *path, int *dlflags, void *p1, void *p2) { sr_kemi_modules_add(sr_kemi_presence_xml_exports); return 0; -} \ No newline at end of file +}
7 years, 5 months
1
0
0
0
git:master:4ba40243: stun: link attribute when calling stun_parse_body() with an existing list
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 4ba402434449ec9cb426d5200b12c5cec4d07ab4 URL:
https://github.com/kamailio/kamailio/commit/4ba402434449ec9cb426d5200b12c5c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2017-07-24T11:56:57+02:00 stun: link attribute when calling stun_parse_body() with an existing list --- Modified: src/modules/stun/kam_stun.c --- Diff:
https://github.com/kamailio/kamailio/commit/4ba402434449ec9cb426d5200b12c5c…
Patch:
https://github.com/kamailio/kamailio/commit/4ba402434449ec9cb426d5200b12c5c…
--- diff --git a/src/modules/stun/kam_stun.c b/src/modules/stun/kam_stun.c index 8257fbab4c..350317b0e7 100644 --- a/src/modules/stun/kam_stun.c +++ b/src/modules/stun/kam_stun.c @@ -336,8 +336,10 @@ static int stun_parse_body( } if (*unknown == NULL) { *unknown = body = tmp_unknown; - } - else { + } else { + if(body==NULL) { + body = *unknown; + } body->next = tmp_unknown; body = body->next; }
7 years, 5 months
1
0
0
0
git:master:f75eba63: statsd: simplified error handling inside statsd_connect()
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: f75eba63a1f0176adc8cd38846a0d1943471e10c URL:
https://github.com/kamailio/kamailio/commit/f75eba63a1f0176adc8cd38846a0d19…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2017-07-24T11:44:21+02:00 statsd: simplified error handling inside statsd_connect() --- Modified: src/modules/statsd/lib_statsd.c --- Diff:
https://github.com/kamailio/kamailio/commit/f75eba63a1f0176adc8cd38846a0d19…
Patch:
https://github.com/kamailio/kamailio/commit/f75eba63a1f0176adc8cd38846a0d19…
--- diff --git a/src/modules/statsd/lib_statsd.c b/src/modules/statsd/lib_statsd.c index bbda181d6a..79d99fcfbd 100644 --- a/src/modules/statsd/lib_statsd.c +++ b/src/modules/statsd/lib_statsd.c @@ -29,25 +29,24 @@ bool statsd_connect(void){ rc = getaddrinfo( statsd_connection.ip, statsd_connection.port, NULL, &serverAddr); - if (rc != 0) + if (rc != 0 || serverAddr == NULL) { - LM_ERR( - "Statsd: could not initiate server information (%s)\n", + LM_ERR("Statsd: could not initiate server information (%s)\n", gai_strerror(rc)); - if(serverAddr) freeaddrinfo(serverAddr); + if(serverAddr) freeaddrinfo(serverAddr); return false; } statsd_connection.sock = socket(serverAddr->ai_family, SOCK_DGRAM, IPPROTO_UDP); if (statsd_connection.sock < 0 ){ LM_ERR("Statsd: could not create a socket for statsd connection\n"); - if(serverAddr) freeaddrinfo(serverAddr); + freeaddrinfo(serverAddr); return false; } - rc = connect( - statsd_connection.sock, serverAddr->ai_addr, serverAddr->ai_addrlen); - freeaddrinfo(serverAddr); + rc = connect(statsd_connection.sock, serverAddr->ai_addr, + serverAddr->ai_addrlen); + freeaddrinfo(serverAddr); if (rc < 0){ LM_ERR("Statsd: could not initiate a connect to statsd\n"); return false;
7 years, 5 months
1
0
0
0
git:master:711a5600: statistics: free vars in case of error in fixup function
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 711a5600330793b2ca787ce451f2ad48620dd639 URL:
https://github.com/kamailio/kamailio/commit/711a5600330793b2ca787ce451f2ad4…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2017-07-24T11:38:51+02:00 statistics: free vars in case of error in fixup function --- Modified: src/modules/statistics/statistics.c --- Diff:
https://github.com/kamailio/kamailio/commit/711a5600330793b2ca787ce451f2ad4…
Patch:
https://github.com/kamailio/kamailio/commit/711a5600330793b2ca787ce451f2ad4…
--- diff --git a/src/modules/statistics/statistics.c b/src/modules/statistics/statistics.c index 499b4198ba..c5ace8c185 100644 --- a/src/modules/statistics/statistics.c +++ b/src/modules/statistics/statistics.c @@ -135,6 +135,7 @@ static int fixup_stat(void** param, int param_no) if (s.s[0]=='$') { if (fixup_pvar_null(param, 1)!=0) { LM_ERR("invalid pv %s as parameter\n",s.s); + pkg_free(sopv); return E_CFG; } sopv->pv = (pv_spec_t*)(*param); @@ -143,10 +144,10 @@ static int fixup_stat(void** param, int param_no) sopv->stat = get_stat( &s ); if (sopv->stat==0) { LM_ERR("variable <%s> not defined\n", s.s); + pkg_free(sopv); return E_CFG; } } - pkg_free(s.s); *param=(void*)sopv; return 0; } else if (param_no==2) { @@ -160,6 +161,7 @@ static int fixup_stat(void** param, int param_no) if (s.s[0] == '$') { if (fixup_pvar_pvar(param, 2) != 0) { LM_ERR("invalid pv %s as parameter\n",s.s); + pkg_free(lopv); return E_CFG; } lopv->pv = (pv_spec_t*) (*param); @@ -179,13 +181,14 @@ static int fixup_stat(void** param, int param_no) if (err==0){ if (n==0 && (s.s[0]!='$')) { //we can't check the value of the pvar so have to ignore this check if it is a pvar LM_ERR("update with 0 has no sense\n"); + pkg_free(lopv); return E_CFG; } - pkg_free(s.s); *param=(void*)lopv; return 0; }else{ LM_ERR("bad update number <%s>\n",(char*)(*param)); + pkg_free(lopv); return E_CFG; } }
7 years, 5 months
1
0
0
0
git:master:6997738a: sst: add 0 after memcpy
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 6997738a7098ef56becfd40cb6e7c7864d1975f0 URL:
https://github.com/kamailio/kamailio/commit/6997738a7098ef56becfd40cb6e7c78…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2017-07-24T08:26:38+02:00 sst: add 0 after memcpy --- Modified: src/modules/sst/sst_handlers.c --- Diff:
https://github.com/kamailio/kamailio/commit/6997738a7098ef56becfd40cb6e7c78…
Patch:
https://github.com/kamailio/kamailio/commit/6997738a7098ef56becfd40cb6e7c78…
--- diff --git a/src/modules/sst/sst_handlers.c b/src/modules/sst/sst_handlers.c index ba1d4928b0..be55eb8883 100644 --- a/src/modules/sst/sst_handlers.c +++ b/src/modules/sst/sst_handlers.c @@ -791,11 +791,12 @@ static int append_header(struct sip_msg *msg, const char *header) return(1); } len = strlen(header); - if ((s = (char *)pkg_malloc(len)) == 0) { + if ((s = (char *)pkg_malloc(len+1)) == 0) { LM_ERR("No more pkg memory. (size requested = %d)\n", len); return(1); } memcpy(s, header, len); + s[len] = '\0'; if (insert_new_lump_before(anchor, s, len, 0) == 0) { LM_ERR("failed to insert lump\n"); pkg_free(s);
7 years, 5 months
1
0
0
0
← Newer
1
...
16
17
18
19
20
21
22
...
41
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Results per page:
10
25
50
100
200