Daniel-Constantin Mierla
2021-06-04 07:08:38 UTC
Content preview: Module: kamailio Branch: master Commit: 490ae559d2b77b13b3f3831e7ff1aa58980e4086
URL: https://github.com/kamailio/kamailio/commit/490ae559d2b77b13b3f3831e7ff1aa58980e4086
Author: Daniel-Constantin Mierla <***@gmail.com> Committer: Daniel-Constantin
Mierla <***@gmail.com> Date: 2021-06-03T15:28:31+02:00
Content analysis details: (-2.4 points, 5.5 required)
pts rule name description
---- ---------------------- --------------------------------------------------
-1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
-1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
[score: 0.0000]
0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is
CUSTOM_MED
0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
mail domains are different
0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
provider (miconda[at]gmail.com)
1.0 FORGED_GMAIL_RCVD 'From' gmail.com does not match 'Received'
headers
0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
EnvelopeFrom freemail headers are
different
-1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list
manager
Module: kamailio
Branch: master
Commit: 490ae559d2b77b13b3f3831e7ff1aa58980e4086
URL: https://github.com/kamailio/kamailio/commit/490ae559d2b77b13b3f3831e7ff1aa58980e4086
Author: Daniel-Constantin Mierla <***@gmail.com>
Committer: Daniel-Constantin Mierla <***@gmail.com>
Date: 2021-06-03T15:28:31+02:00
dialog: safety checks for bind addr fields
- they can be null on non-local sockets
- GH #2757
---
Modified: src/modules/dialog/dlg_db_handler.c
---
Diff: https://github.com/kamailio/kamailio/commit/490ae559d2b77b13b3f3831e7ff1aa58980e4086.diff
Patch: https://github.com/kamailio/kamailio/commit/490ae559d2b77b13b3f3831e7ff1aa58980e4086.patch
---
diff --git a/src/modules/dialog/dlg_db_handler.c b/src/modules/dialog/dlg_db_handler.c
index 1bfcb2cad7..b6a49da2a4 100644
--- a/src/modules/dialog/dlg_db_handler.c
+++ b/src/modules/dialog/dlg_db_handler.c
@@ -802,6 +802,7 @@ int update_dialog_dbinfo_unsafe(struct dlg_cell * cell)
int i;
struct dlg_var *var;
srjson_doc_t jdoc;
+ str sempty = str_init("");
db_val_t values[DIALOG_TABLE_COL_NO];
@@ -870,14 +871,25 @@ int update_dialog_dbinfo_unsafe(struct dlg_cell * cell)
SET_STR_VALUE(values+6, cell->tag[DLG_CALLEE_LEG]);
SET_PROPER_NULL_FLAG(cell->tag[DLG_CALLEE_LEG], values, 6);
- LM_DBG("caller sock_info is %.*s, callee sock_info is %.*s\n",
- cell->bind_addr[DLG_CALLER_LEG]->sock_str.len,
- cell->bind_addr[DLG_CALLER_LEG]->sock_str.s,
- cell->bind_addr[DLG_CALLEE_LEG]->sock_str.len,
- cell->bind_addr[DLG_CALLEE_LEG]->sock_str.s);
- SET_STR_VALUE(values+7, cell->bind_addr[DLG_CALLER_LEG]->sock_str);
- SET_STR_VALUE(values+8, cell->bind_addr[DLG_CALLEE_LEG]->sock_str);
+ if(cell->bind_addr[DLG_CALLER_LEG]) {
+ LM_DBG("caller sock_info is %.*s\n",
+ cell->bind_addr[DLG_CALLER_LEG]->sock_str.len,
+ cell->bind_addr[DLG_CALLER_LEG]->sock_str.s);
+ SET_STR_VALUE(values+7, cell->bind_addr[DLG_CALLER_LEG]->sock_str);
+ } else {
+ LM_DBG("no caller sock_info\n");
+ SET_STR_VALUE(values+7, sempty);
+ }
+ if(cell->bind_addr[DLG_CALLEE_LEG]) {
+ LM_DBG("callee sock_info is %.*s\n",
+ cell->bind_addr[DLG_CALLEE_LEG]->sock_str.len,
+ cell->bind_addr[DLG_CALLEE_LEG]->sock_str.s);
+ SET_STR_VALUE(values+8, cell->bind_addr[DLG_CALLEE_LEG]->sock_str);
+ } else {
+ LM_DBG("no callee sock_info\n");
+ SET_STR_VALUE(values+8, sempty);
+ }
SET_STR_VALUE(values+12, cell->cseq[DLG_CALLER_LEG]);
SET_STR_VALUE(values+13, cell->cseq[DLG_CALLEE_LEG]);
URL: https://github.com/kamailio/kamailio/commit/490ae559d2b77b13b3f3831e7ff1aa58980e4086
Author: Daniel-Constantin Mierla <***@gmail.com> Committer: Daniel-Constantin
Mierla <***@gmail.com> Date: 2021-06-03T15:28:31+02:00
Content analysis details: (-2.4 points, 5.5 required)
pts rule name description
---- ---------------------- --------------------------------------------------
-1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
-1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
[score: 0.0000]
0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is
CUSTOM_MED
0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
mail domains are different
0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
provider (miconda[at]gmail.com)
1.0 FORGED_GMAIL_RCVD 'From' gmail.com does not match 'Received'
headers
0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
EnvelopeFrom freemail headers are
different
-1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list
manager
Module: kamailio
Branch: master
Commit: 490ae559d2b77b13b3f3831e7ff1aa58980e4086
URL: https://github.com/kamailio/kamailio/commit/490ae559d2b77b13b3f3831e7ff1aa58980e4086
Author: Daniel-Constantin Mierla <***@gmail.com>
Committer: Daniel-Constantin Mierla <***@gmail.com>
Date: 2021-06-03T15:28:31+02:00
dialog: safety checks for bind addr fields
- they can be null on non-local sockets
- GH #2757
---
Modified: src/modules/dialog/dlg_db_handler.c
---
Diff: https://github.com/kamailio/kamailio/commit/490ae559d2b77b13b3f3831e7ff1aa58980e4086.diff
Patch: https://github.com/kamailio/kamailio/commit/490ae559d2b77b13b3f3831e7ff1aa58980e4086.patch
---
diff --git a/src/modules/dialog/dlg_db_handler.c b/src/modules/dialog/dlg_db_handler.c
index 1bfcb2cad7..b6a49da2a4 100644
--- a/src/modules/dialog/dlg_db_handler.c
+++ b/src/modules/dialog/dlg_db_handler.c
@@ -802,6 +802,7 @@ int update_dialog_dbinfo_unsafe(struct dlg_cell * cell)
int i;
struct dlg_var *var;
srjson_doc_t jdoc;
+ str sempty = str_init("");
db_val_t values[DIALOG_TABLE_COL_NO];
@@ -870,14 +871,25 @@ int update_dialog_dbinfo_unsafe(struct dlg_cell * cell)
SET_STR_VALUE(values+6, cell->tag[DLG_CALLEE_LEG]);
SET_PROPER_NULL_FLAG(cell->tag[DLG_CALLEE_LEG], values, 6);
- LM_DBG("caller sock_info is %.*s, callee sock_info is %.*s\n",
- cell->bind_addr[DLG_CALLER_LEG]->sock_str.len,
- cell->bind_addr[DLG_CALLER_LEG]->sock_str.s,
- cell->bind_addr[DLG_CALLEE_LEG]->sock_str.len,
- cell->bind_addr[DLG_CALLEE_LEG]->sock_str.s);
- SET_STR_VALUE(values+7, cell->bind_addr[DLG_CALLER_LEG]->sock_str);
- SET_STR_VALUE(values+8, cell->bind_addr[DLG_CALLEE_LEG]->sock_str);
+ if(cell->bind_addr[DLG_CALLER_LEG]) {
+ LM_DBG("caller sock_info is %.*s\n",
+ cell->bind_addr[DLG_CALLER_LEG]->sock_str.len,
+ cell->bind_addr[DLG_CALLER_LEG]->sock_str.s);
+ SET_STR_VALUE(values+7, cell->bind_addr[DLG_CALLER_LEG]->sock_str);
+ } else {
+ LM_DBG("no caller sock_info\n");
+ SET_STR_VALUE(values+7, sempty);
+ }
+ if(cell->bind_addr[DLG_CALLEE_LEG]) {
+ LM_DBG("callee sock_info is %.*s\n",
+ cell->bind_addr[DLG_CALLEE_LEG]->sock_str.len,
+ cell->bind_addr[DLG_CALLEE_LEG]->sock_str.s);
+ SET_STR_VALUE(values+8, cell->bind_addr[DLG_CALLEE_LEG]->sock_str);
+ } else {
+ LM_DBG("no callee sock_info\n");
+ SET_STR_VALUE(values+8, sempty);
+ }
SET_STR_VALUE(values+12, cell->cseq[DLG_CALLER_LEG]);
SET_STR_VALUE(values+13, cell->cseq[DLG_CALLEE_LEG]);