[sr-dev] git:master:b9c36860: ims_qos_npn: updates for lib/ims macro names

2025-02-11 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: b9c36860fc8a91fc6c73b456ff64b6191f61813b
URL: 
https://github.com/kamailio/kamailio/commit/b9c36860fc8a91fc6c73b456ff64b6191f61813b

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2025-02-11T15:25:30+01:00

ims_qos_npn: updates for lib/ims macro names

---

Modified: src/modules/ims_qos_npn/rx_avp.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/b9c36860fc8a91fc6c73b456ff64b6191f61813b.diff
Patch: 
https://github.com/kamailio/kamailio/commit/b9c36860fc8a91fc6c73b456ff64b6191f61813b.patch

---

diff --git a/src/modules/ims_qos_npn/rx_avp.c b/src/modules/ims_qos_npn/rx_avp.c
index 54afddaa354..fd17533c99a 100644
--- a/src/modules/ims_qos_npn/rx_avp.c
+++ b/src/modules/ims_qos_npn/rx_avp.c
@@ -2038,7 +2038,7 @@ int 
rx_avp_process_3gpp_user_location_information(AAAMessage *rar, str *dst)
LOG(L_INFO, "P-Access-Network-Info from Diameter is [%.*s]\n", dst->len,
dst->s);
if(!dst->len) {
-   str_free(*dst, pkg);
+   ims_str_free(*dst, pkg);
}
return (dst->len > 1);
 }

___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] git:master:f1abcba4: ims_charging: updates for lib/ims macro names

2025-02-11 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: f1abcba4eeabccf96a8d16c2e63a47b27db62f88
URL: 
https://github.com/kamailio/kamailio/commit/f1abcba4eeabccf96a8d16c2e63a47b27db62f88

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2025-02-11T15:24:20+01:00

ims_charging: updates for lib/ims macro names

---

Modified: src/modules/ims_charging/Ro_data.c
Modified: src/modules/ims_charging/Ro_data.h
Modified: src/modules/ims_charging/ccr.c
Modified: src/modules/ims_charging/ims_ro.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/f1abcba4eeabccf96a8d16c2e63a47b27db62f88.diff
Patch: 
https://github.com/kamailio/kamailio/commit/f1abcba4eeabccf96a8d16c2e63a47b27db62f88.patch

___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] git:master:f37940b9: db_sqlite: added prefix to internal helper function

2025-02-11 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: f37940b9a113ab79611f851334af7f8fbb7b3f6a
URL: 
https://github.com/kamailio/kamailio/commit/f37940b9a113ab79611f851334af7f8fbb7b3f6a

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2025-02-11T15:27:26+01:00

db_sqlite: added prefix to internal helper function

---

Modified: src/modules/db_sqlite/dbase.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/f37940b9a113ab79611f851334af7f8fbb7b3f6a.diff
Patch: 
https://github.com/kamailio/kamailio/commit/f37940b9a113ab79611f851334af7f8fbb7b3f6a.patch

---

diff --git a/src/modules/db_sqlite/dbase.c b/src/modules/db_sqlite/dbase.c
index a82f8e59546..2ff40fc0898 100644
--- a/src/modules/db_sqlite/dbase.c
+++ b/src/modules/db_sqlite/dbase.c
@@ -369,7 +369,7 @@ static int type_to_dbtype(int type)
}
 }
 
-static str *str_dup(const char *_s)
+static str *sqlt_str_dup(const char *_s)
 {
str *s;
int len = strlen(_s);
@@ -432,7 +432,8 @@ int db_sqlite_store_result(const db1_con_t *_h, db1_res_t 
**_r)
const char *decltype;
int dbtype;
 
-   RES_NAMES(res)[i] = 
str_dup(sqlite3_column_name(conn->stmt, i));
+   RES_NAMES(res)
+   [i] = 
sqlt_str_dup(sqlite3_column_name(conn->stmt, i));
if(RES_NAMES(res)[i] == NULL)
goto no_mem;
decltype = sqlite3_column_decltype(conn->stmt, 
i);

___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] git:master:3fb1d783: ims_registrar_scscf: updates for lib/ims macro names

2025-02-11 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 3fb1d7832006d290ee1c2e15ea1e731dc0768b5f
URL: 
https://github.com/kamailio/kamailio/commit/3fb1d7832006d290ee1c2e15ea1e731dc0768b5f

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2025-02-11T15:26:27+01:00

ims_registrar_scscf: updates for lib/ims macro names

---

Modified: src/modules/ims_registrar_scscf/registrar_notify.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/3fb1d7832006d290ee1c2e15ea1e731dc0768b5f.diff
Patch: 
https://github.com/kamailio/kamailio/commit/3fb1d7832006d290ee1c2e15ea1e731dc0768b5f.patch

---

diff --git a/src/modules/ims_registrar_scscf/registrar_notify.c 
b/src/modules/ims_registrar_scscf/registrar_notify.c
index b1af5189a8d..25425af7a1f 100644
--- a/src/modules/ims_registrar_scscf/registrar_notify.c
+++ b/src/modules/ims_registrar_scscf/registrar_notify.c
@@ -2478,7 +2478,7 @@ void uac_request_cb(struct cell *t, int type, struct 
tmcb_params *ps)
}
 done:
if(watcher_contact) {
-   str_free(*watcher_contact, shm);
+   ims_str_free(*watcher_contact, shm);
shm_free(watcher_contact);
*(ps->param) = 0;
}
@@ -2618,10 +2618,10 @@ void send_notification(reg_notification *n)
watcher_contact = 0;
 done:
 out_of_memory:
-   str_free(h, pkg);
-   str_free(content, pkg);
+   ims_str_free(h, pkg);
+   ims_str_free(content, pkg);
if(watcher_contact) {
-   str_free(*watcher_contact, shm);
+   ims_str_free(*watcher_contact, shm);
shm_free(watcher_contact);
}
free_tm_dlg(td);

___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] git:master:c45c7116: lib/ims: renamed specific macros with pretty generic name

2025-02-11 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: c45c71164ed40e06cdfab4ceda292d29d2d1459f
URL: 
https://github.com/kamailio/kamailio/commit/c45c71164ed40e06cdfab4ceda292d29d2d1459f

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2025-02-11T15:23:34+01:00

lib/ims: renamed specific macros with pretty generic name

---

Modified: src/lib/ims/ims_getters.c
Modified: src/lib/ims/ims_getters.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/c45c71164ed40e06cdfab4ceda292d29d2d1459f.diff
Patch: 
https://github.com/kamailio/kamailio/commit/c45c71164ed40e06cdfab4ceda292d29d2d1459f.patch

---

diff --git a/src/lib/ims/ims_getters.c b/src/lib/ims/ims_getters.c
index 44f1a0be34d..8d97a7a54f9 100644
--- a/src/lib/ims/ims_getters.c
+++ b/src/lib/ims/ims_getters.c
@@ -1303,20 +1303,21 @@ int cscf_get_p_charging_vector(
if(!header->body.s || !header->body.len)
return 0;
 
-   str_dup(header_body, header->body, pkg);
+   ims_str_dup(header_body, header->body, pkg);
 
LM_DBG("p_charging_vector body is %.*s\n", header_body.len, 
header_body.s);
 
p = strtok(header_body.s, " ;:\r\t\n\"=");
 loop:
-   if(p == NULL || p > (header_body.s + header_body.len))
+   if(p == NULL || p > (header_body.s + header_body.len)) {
return 1;
+   }
 
if(strncmp(p, "icid-value", 10) == 0) {
p = strtok(NULL, " ;:\r\t\n\"=");
if(p == NULL || p > (header_body.s + header_body.len)) {
LM_ERR("cscf_get_p_charging_vector: no value for 
icid\n");
-   return 0;
+   goto error;
}
temp.s = p;
temp.len = 0;
@@ -1332,11 +1333,10 @@ int cscf_get_p_charging_vector(
p = strtok(NULL, " ;:\r\t\n\"=");
goto loop;
} else if(strncmp(p, "orig-ioi", 8) == 0) {
-
p = strtok(NULL, " ;:\r\t\n\"=");
if(p == NULL || p > (header_body.s + header_body.len)) {
LM_ERR("cscf_get_p_charging_vector: no value for 
icid\n");
-   return 0;
+   goto error;
}
temp.s = p;
temp.len = 0;
@@ -1352,11 +1352,10 @@ int cscf_get_p_charging_vector(
p = strtok(NULL, " ;:\r\t\n\"=");
goto loop;
} else if(strncmp(p, "term-ioi", 8) == 0) {
-
p = strtok(NULL, " ;:\r\t\n\"=");
if(p == NULL || p > (header_body.s + header_body.len)) {
LM_ERR("cscf_get_p_charging_vector: no value for 
icid\n");
-   return 0;
+   goto error;
}
temp.s = p;
temp.len = 0;
@@ -1374,10 +1373,12 @@ int cscf_get_p_charging_vector(
}
 
LM_DBG("end\n");
-   str_free(header_body, pkg);
+   ims_str_free(header_body, pkg);
return 1;
 out_of_memory:
PKG_MEM_ERROR;
+error:
+   ims_str_free(header_body, pkg);
return 0;
 }
 
diff --git a/src/lib/ims/ims_getters.h b/src/lib/ims/ims_getters.h
index 081a5ae1934..4d10c00077d 100644
--- a/src/lib/ims/ims_getters.h
+++ b/src/lib/ims/ims_getters.h
@@ -80,7 +80,7 @@ enum cscf_dialog_direction
  * @param src - source src
  * @param mem - type of mem to duplicate into (shm/pkg)
  */
-#define str_dup(dst, src, mem) 
\
+#define ims_str_dup(dst, src, mem) 
\
do {
   \
if((src).len) { 
   \
(dst).s = mem##_malloc((src).len);  
   \
@@ -102,7 +102,7 @@ enum cscf_dialog_direction
  * @param x - the str to free
  * @param mem - type of memory that the content is using (shm/pkg)
  */
-#define str_free(x, mem)   \
+#define ims_str_free(x, mem)   \
do {   \
if((x).s)  \
mem##_free((x).s); \

___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] git:master:2ba6d4ff: core: check for unexpected long value return by pathconf()

2025-02-11 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 2ba6d4ff2727031e7bca5d3d1da016bfe508b8df
URL: 
https://github.com/kamailio/kamailio/commit/2ba6d4ff2727031e7bca5d3d1da016bfe508b8df

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2025-02-11T12:41:26+01:00

core: check for unexpected long value return by pathconf()

---

Modified: src/core/ut.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/2ba6d4ff2727031e7bca5d3d1da016bfe508b8df.diff
Patch: 
https://github.com/kamailio/kamailio/commit/2ba6d4ff2727031e7bca5d3d1da016bfe508b8df.patch

---

diff --git a/src/core/ut.h b/src/core/ut.h
index f1829f73ca0..3a3d66202b6 100644
--- a/src/core/ut.h
+++ b/src/core/ut.h
@@ -546,7 +546,8 @@ inline static int pathmax(void)
 #endif
if(pathmax == 0) { /* init */
pathmax = pathconf("/", _PC_PATH_MAX);
-   pathmax = (pathmax <= 0) ? PATH_MAX_GUESS : pathmax + 1;
+   pathmax = (pathmax <= 0 || pathmax >= INT_MAX - 1) ? 
PATH_MAX_GUESS
+   
   : pathmax + 1;
}
return pathmax;
 }

___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] git:master:6c12477f: core: pass fd - check for unexpected read size overflow

2025-02-11 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 6c12477f1dad2279431d703d1a4f63fcfc6543b8
URL: 
https://github.com/kamailio/kamailio/commit/6c12477f1dad2279431d703d1a4f63fcfc6543b8

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2025-02-11T11:30:34+01:00

core: pass fd - check for unexpected read size overflow

---

Modified: src/core/pass_fd.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/6c12477f1dad2279431d703d1a4f63fcfc6543b8.diff
Patch: 
https://github.com/kamailio/kamailio/commit/6c12477f1dad2279431d703d1a4f63fcfc6543b8.patch

---

diff --git a/src/core/pass_fd.c b/src/core/pass_fd.c
index eae20206fd5..77431dbf293 100644
--- a/src/core/pass_fd.c
+++ b/src/core/pass_fd.c
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include  /* for NULL definition on openbsd */
+#include 
 #include 
 #include 
 #ifdef NO_MSG_WAITALL
@@ -289,9 +290,14 @@ int receive_fd(int unix_socket, void *data, int data_len, 
int *fd, int flags)
/* blocking recv_all */
n = recv_all(
unix_socket, (char *)data + ret, data_len - 
ret, MSG_WAITALL);
-   if(n >= 0)
+   if(n >= 0) {
+   if(ret >= INT_MAX - n) {
+   LM_ERR("int size overflowing: %d + %d\n", ret, 
n);
+   ret = -1;
+   goto error;
+   }
ret += n;
-   else {
+   } else {
ret = n;
goto error;
}

___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] git:master:6fb38cb3: tsilo: clean allocated memory on error for append by contact

2025-02-11 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 6fb38cb33095c11a1c90d7b88140ac159b9fd5ca
URL: 
https://github.com/kamailio/kamailio/commit/6fb38cb33095c11a1c90d7b88140ac159b9fd5ca

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2025-02-11T10:25:34+01:00

tsilo: clean allocated memory on error for append by contact

---

Modified: src/modules/tsilo/tsilo.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/6fb38cb33095c11a1c90d7b88140ac159b9fd5ca.diff
Patch: 
https://github.com/kamailio/kamailio/commit/6fb38cb33095c11a1c90d7b88140ac159b9fd5ca.patch

---

diff --git a/src/modules/tsilo/tsilo.c b/src/modules/tsilo/tsilo.c
index 5119b3f5a21..6af49d59dd3 100644
--- a/src/modules/tsilo/tsilo.c
+++ b/src/modules/tsilo/tsilo.c
@@ -459,19 +459,19 @@ static int w_ts_append_by_contact2(
 
if(ts_check_uri(&ruri) < 0) {
LM_ERR("failed to parse R-URI.\n");
-   return -1;
+   goto error;
}
 
/* parse Contact header */
if((!_msg->contact && parse_headers(_msg, HDR_CONTACT_F, 0) != 0)
|| !_msg->contact) {
LM_WARN("missing contact header or the value is 
empty/malformed.\n");
-   return -1;
+   goto error;
}
if(_msg->contact) {
if(parse_contact(_msg->contact) < 0) {
LM_WARN("failed to parse Contact header.\n");
-   return -1;
+   goto error;
}
if(parse_uri(((struct contact_body *)_msg->contact->parsed)
 ->contacts->uri.s,
@@ -481,7 +481,7 @@ static int w_ts_append_by_contact2(
!= 0) {
if(ts_check_uri(&_msg->contact->body) < 0) { /* one 
more attempt */
LM_WARN("failed to parse Contact header.\n");
-   return -1;
+   goto error;
}
}
 
@@ -490,7 +490,7 @@ static int w_ts_append_by_contact2(
tmp_contact.s = (char *)pkg_malloc(tmp_contact.len + 1);
if(tmp_contact.s == NULL) {
PKG_MEM_ERROR;
-   return -1;
+   goto error;
}
memcpy(tmp_contact.s,
((struct contact_body 
*)_msg->contact->parsed)->contacts->uri.s,
@@ -502,7 +502,7 @@ static int w_ts_append_by_contact2(
< 0) { /* one more attempt */
LM_ERR("problems when calling 
ts_append_contact(), cannot copy "
   "Contact parameter.\n");
-   return -1;
+   goto error;
}
}
}
@@ -516,6 +516,18 @@ static int w_ts_append_by_contact2(
pkg_free(tmp_contact.s);
 
return rc;
+
+error:
+   if(ruri.s != NULL) {
+   pkg_free(ruri.s);
+   }
+   if(contact.s != NULL) {
+   pkg_free(contact.s);
+   }
+   if(tmp_contact.s != NULL) {
+   pkg_free(tmp_contact.s);
+   }
+   return -1;
 }
 
 /**
@@ -538,11 +550,11 @@ static int ki_ts_append_by_contact(sip_msg_t *_msg, str 
*_table, str *_ruri)
/* parse Contact header */
if((!_msg->contact && parse_headers(_msg, HDR_CONTACT_F, 0) != 0)
|| !_msg->contact)
-   return -1;
+   goto error;
 
if(_msg->contact) {
if(parse_contact(_msg->contact) < 0)
-   return -1;
+   goto error;
if(parse_uri(((struct contact_body *)_msg->contact->parsed)
 ->contacts->uri.s,
   ((struct contact_body 
*)_msg->contact->parsed)
@@ -550,7 +562,7 @@ static int ki_ts_append_by_contact(sip_msg_t *_msg, str 
*_table, str *_ruri)
   &curi)
!= 0) {
if(ts_check_uri(&_msg->contact->body) < 0) /* one more 
attempt */
-   return -1;
+   goto error;
}
 
tmp_contact.len = ((struct contact_body *)_msg->contact->parsed)
@@ -558,7 +570,7 @@ static int ki_ts_append_by_contact(sip_msg_t *_msg, str 
*_table, str *_ruri)
tmp_contact.s = (char *)pkg_malloc(tmp_contact.len + 1);
if(tmp_contact.s == NULL) {
PKG_MEM_ERROR;
-   return -1;
+   goto error;
}
memcpy(tmp_contact.s,
((struct contact_body 
*)_msg->contact->parsed)->contacts->uri.s,
@@ -568,7 +580,7 @@ static int 

[sr-dev] Re: [kamailio/kamailio] xhttp_prom module with custom tags (Issue #4021)

2025-02-11 Thread Henning Westerholt via sr-dev
Closed #4021 as completed.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4021#event-16260890127
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] Re: [kamailio/kamailio] xhttp_prom module with custom tags (Issue #4021)

2025-02-11 Thread Henning Westerholt via sr-dev
PR was merged last month, close

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4021#issuecomment-2650187605
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] [kamailio/kamailio] sl: doesn't handle 1xx_replies while metric exists (Issue #4144)

2025-02-11 Thread Boris Korzun via sr-dev
### Description

There're `1xx_replies` metric in `sl` module. But the metric doesn't work.

### Troubleshooting

There're no handle in `void update_sl_stats(int code)`.
https://github.com/kamailio/kamailio/blob/f37940b9a113ab79611f851334af7f8fbb7b3f6a/src/modules/sl/sl_stats.c#L151-L153

### Proposal

Remove `1xx_replies` from `sl` module. Or add the handling.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4144
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] Re: [kamailio/kamailio] Kamailio passive instance tries to send dialog keepalives after service restart (Issue #4077)

2025-02-11 Thread github-actions[bot] via sr-dev
Closed #4077 as not planned.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4077#event-16274226735
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!