Daniel-Constantin Mierla
2021-06-03 08:55:59 UTC
Content preview: Module: kamailio Branch: master Commit: 2583446968d81a9351caab1cfdd2cc86434850f3
URL: https://github.com/kamailio/kamailio/commit/2583446968d81a9351caab1cfdd2cc86434850f3
Author: Daniel-Constantin Mierla <***@gmail.com> Committer: Daniel-Constantin
Mierla <***@gmail.com> Date: 2021-06-03T10:55:22+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]
1.0 FORGED_GMAIL_RCVD 'From' gmail.com does not match 'Received'
headers
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)
0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is
CUSTOM_MED
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: 2583446968d81a9351caab1cfdd2cc86434850f3
URL: https://github.com/kamailio/kamailio/commit/2583446968d81a9351caab1cfdd2cc86434850f3
Author: Daniel-Constantin Mierla <***@gmail.com>
Committer: Daniel-Constantin Mierla <***@gmail.com>
Date: 2021-06-03T10:55:22+02:00
core: select - test for HDR_ERROR_T after header name parsing
---
Modified: src/core/select_core.c
---
Diff: https://github.com/kamailio/kamailio/commit/2583446968d81a9351caab1cfdd2cc86434850f3.diff
Patch: https://github.com/kamailio/kamailio/commit/2583446968d81a9351caab1cfdd2cc86434850f3.patch
---
diff --git a/src/core/select_core.c b/src/core/select_core.c
index 029f880a48..02d393a6ba 100644
--- a/src/core/select_core.c
+++ b/src/core/select_core.c
@@ -595,7 +595,7 @@ int select_msg_header(str* res, select_t* s, struct sip_msg* msg)
{
/* get all headers */
char *c;
- res->s = SIP_MSG_START(msg) + msg->first_line.len;
+ res->s = SIP_MSG_START(msg) + msg->first_line.len;
c = get_body(msg);
res->len = c - res->s;
return 0;
@@ -607,7 +607,7 @@ int select_anyheader(str* res, select_t* s, struct sip_msg* msg)
int hi;
char c;
struct hdr_field hdr;
-
+
if(msg==NULL) {
if (res!=NULL) return -1;
@@ -622,13 +622,15 @@ int select_anyheader(str* res, select_t* s, struct sip_msg* msg)
/* if header name is parseable, parse it and set SEL_PARAM_DIV */
c=s->params[2].v.s.s[s->params[2].v.s.len];
s->params[2].v.s.s[s->params[2].v.s.len]=':';
- if (parse_hname2_short(s->params[2].v.s.s,s->params[2].v.s.s+(s->params[2].v.s.len<3?4:s->params[2].v.s.len+1),
- &hdr)==0) {
+ parse_hname2_short(s->params[2].v.s.s,s->params[2].v.s.s
+ +(s->params[2].v.s.len<3?4:s->params[2].v.s.len+1),
+ &hdr);
+ if(hdr.type==HDR_ERROR_T) {
LM_ERR("fixup_call:parse error\n");
return -1;
}
s->params[2].v.s.s[s->params[2].v.s.len]=c;
-
+
if (hdr.type!=HDR_OTHER_T && hdr.type!=HDR_ERROR_T) {
/* pkg_free(s->params[1].v.s.s); */
/* don't free it (the mem can leak only once at startup)
URL: https://github.com/kamailio/kamailio/commit/2583446968d81a9351caab1cfdd2cc86434850f3
Author: Daniel-Constantin Mierla <***@gmail.com> Committer: Daniel-Constantin
Mierla <***@gmail.com> Date: 2021-06-03T10:55:22+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]
1.0 FORGED_GMAIL_RCVD 'From' gmail.com does not match 'Received'
headers
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)
0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is
CUSTOM_MED
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: 2583446968d81a9351caab1cfdd2cc86434850f3
URL: https://github.com/kamailio/kamailio/commit/2583446968d81a9351caab1cfdd2cc86434850f3
Author: Daniel-Constantin Mierla <***@gmail.com>
Committer: Daniel-Constantin Mierla <***@gmail.com>
Date: 2021-06-03T10:55:22+02:00
core: select - test for HDR_ERROR_T after header name parsing
---
Modified: src/core/select_core.c
---
Diff: https://github.com/kamailio/kamailio/commit/2583446968d81a9351caab1cfdd2cc86434850f3.diff
Patch: https://github.com/kamailio/kamailio/commit/2583446968d81a9351caab1cfdd2cc86434850f3.patch
---
diff --git a/src/core/select_core.c b/src/core/select_core.c
index 029f880a48..02d393a6ba 100644
--- a/src/core/select_core.c
+++ b/src/core/select_core.c
@@ -595,7 +595,7 @@ int select_msg_header(str* res, select_t* s, struct sip_msg* msg)
{
/* get all headers */
char *c;
- res->s = SIP_MSG_START(msg) + msg->first_line.len;
+ res->s = SIP_MSG_START(msg) + msg->first_line.len;
c = get_body(msg);
res->len = c - res->s;
return 0;
@@ -607,7 +607,7 @@ int select_anyheader(str* res, select_t* s, struct sip_msg* msg)
int hi;
char c;
struct hdr_field hdr;
-
+
if(msg==NULL) {
if (res!=NULL) return -1;
@@ -622,13 +622,15 @@ int select_anyheader(str* res, select_t* s, struct sip_msg* msg)
/* if header name is parseable, parse it and set SEL_PARAM_DIV */
c=s->params[2].v.s.s[s->params[2].v.s.len];
s->params[2].v.s.s[s->params[2].v.s.len]=':';
- if (parse_hname2_short(s->params[2].v.s.s,s->params[2].v.s.s+(s->params[2].v.s.len<3?4:s->params[2].v.s.len+1),
- &hdr)==0) {
+ parse_hname2_short(s->params[2].v.s.s,s->params[2].v.s.s
+ +(s->params[2].v.s.len<3?4:s->params[2].v.s.len+1),
+ &hdr);
+ if(hdr.type==HDR_ERROR_T) {
LM_ERR("fixup_call:parse error\n");
return -1;
}
s->params[2].v.s.s[s->params[2].v.s.len]=c;
-
+
if (hdr.type!=HDR_OTHER_T && hdr.type!=HDR_ERROR_T) {
/* pkg_free(s->params[1].v.s.s); */
/* don't free it (the mem can leak only once at startup)