Daniel-Constantin Mierla
2021-06-02 17:00:34 UTC
Content preview: Module: kamailio Branch: master Commit: 785bbaa0f16f83353ad1d776816f439608a67858
URL: https://github.com/kamailio/kamailio/commit/785bbaa0f16f83353ad1d776816f439608a67858
Author: Daniel-Constantin Mierla <***@gmail.com> Committer: Daniel-Constantin
Mierla <***@gmail.com> Date: 2021-06-02T18:57:53+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.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
provider (miconda[at]gmail.com)
0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
mail domains are different
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: 785bbaa0f16f83353ad1d776816f439608a67858
URL: https://github.com/kamailio/kamailio/commit/785bbaa0f16f83353ad1d776816f439608a67858
Author: Daniel-Constantin Mierla <***@gmail.com>
Committer: Daniel-Constantin Mierla <***@gmail.com>
Date: 2021-06-02T18:57:53+02:00
core: kemi - check hdr type HDR_ERROR_T after parsing
---
Modified: src/core/kemi.c
---
Diff: https://github.com/kamailio/kamailio/commit/785bbaa0f16f83353ad1d776816f439608a67858.diff
Patch: https://github.com/kamailio/kamailio/commit/785bbaa0f16f83353ad1d776816f439608a67858.patch
---
diff --git a/src/core/kemi.c b/src/core/kemi.c
index 324e7cd6cf..bee8a98f07 100644
--- a/src/core/kemi.c
+++ b/src/core/kemi.c
@@ -1988,7 +1988,8 @@ static int sr_kemi_hdr_append_after(sip_msg_t *msg, str *txt, str *hname)
hbuf[hname->len] = ':';
hbuf[hname->len+1] = '\0';
- if (parse_hname2_short(hbuf, hbuf+hname->len+1, &hfm)==0) {
+ parse_hname2_short(hbuf, hbuf+hname->len+1, &hfm);
+ if(hfm.type==HDR_ERROR_T) {
LM_ERR("error parsing header name [%.*s]\n", hname->len, hname->s);
return -1;
}
@@ -2056,7 +2057,8 @@ int sr_kemi_hdr_remove(sip_msg_t *msg, str *hname)
hbuf[hname->len] = ':';
hbuf[hname->len+1] = '\0';
- if (parse_hname2_short(hbuf, hbuf+hname->len+1, &hfm)==0) {
+ parse_hname2_short(hbuf, hbuf+hname->len+1, &hfm);
+ if(hfm.type==HDR_ERROR_T) {
LM_ERR("error parsing header name [%.*s]\n", hname->len, hname->s);
return -1;
}
@@ -2106,7 +2108,8 @@ static int sr_kemi_hdr_is_present(sip_msg_t *msg, str *hname)
hbuf[hname->len] = ':';
hbuf[hname->len+1] = '\0';
- if (parse_hname2_short(hbuf, hbuf+hname->len+1, &hfm)==0) {
+ parse_hname2_short(hbuf, hbuf+hname->len+1, &hfm);
+ if(hfm.type==HDR_ERROR_T) {
LM_ERR("error parsing header name [%.*s]\n", hname->len, hname->s);
return -1;
}
@@ -2188,7 +2191,8 @@ static int sr_kemi_hdr_insert_before(sip_msg_t *msg, str *txt, str *hname)
hbuf[hname->len] = ':';
hbuf[hname->len+1] = '\0';
- if (parse_hname2_short(hbuf, hbuf+hname->len+1, &hfm)==0) {
+ parse_hname2_short(hbuf, hbuf+hname->len+1, &hfm);
+ if(hfm.type==HDR_ERROR_T) {
LM_ERR("error parsing header name [%.*s]\n", hname->len, hname->s);
return -1;
}
@@ -2305,7 +2309,8 @@ static sr_kemi_xval_t* sr_kemi_hdr_get_mode(sip_msg_t *msg, str *hname, int idx,
sr_kemi_xval_null(&_sr_kemi_xval, rmode);
return &_sr_kemi_xval;
}
- if (parse_hname2_str(hname, &shdr)==0) {
+ parse_hname2_str(hname, &shdr);
+ if(shdr.type==HDR_ERROR_T) {
LM_ERR("error parsing header name [%.*s]\n", hname->len, hname->s);
sr_kemi_xval_null(&_sr_kemi_xval, rmode);
return &_sr_kemi_xval;
@@ -2426,7 +2431,8 @@ static int sr_kemi_hdr_match_content(sip_msg_t *msg, str *hname, str *op,
return SR_KEMI_FALSE;
}
- if (parse_hname2_str(hname, &hfm)==0) {
+ parse_hname2_str(hname, &hfm);
+ if(hfm.type==HDR_ERROR_T) {
LM_ERR("error parsing header name [%.*s]\n", hname->len, hname->s);
return SR_KEMI_FALSE;
}
URL: https://github.com/kamailio/kamailio/commit/785bbaa0f16f83353ad1d776816f439608a67858
Author: Daniel-Constantin Mierla <***@gmail.com> Committer: Daniel-Constantin
Mierla <***@gmail.com> Date: 2021-06-02T18:57:53+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.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
provider (miconda[at]gmail.com)
0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
mail domains are different
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: 785bbaa0f16f83353ad1d776816f439608a67858
URL: https://github.com/kamailio/kamailio/commit/785bbaa0f16f83353ad1d776816f439608a67858
Author: Daniel-Constantin Mierla <***@gmail.com>
Committer: Daniel-Constantin Mierla <***@gmail.com>
Date: 2021-06-02T18:57:53+02:00
core: kemi - check hdr type HDR_ERROR_T after parsing
---
Modified: src/core/kemi.c
---
Diff: https://github.com/kamailio/kamailio/commit/785bbaa0f16f83353ad1d776816f439608a67858.diff
Patch: https://github.com/kamailio/kamailio/commit/785bbaa0f16f83353ad1d776816f439608a67858.patch
---
diff --git a/src/core/kemi.c b/src/core/kemi.c
index 324e7cd6cf..bee8a98f07 100644
--- a/src/core/kemi.c
+++ b/src/core/kemi.c
@@ -1988,7 +1988,8 @@ static int sr_kemi_hdr_append_after(sip_msg_t *msg, str *txt, str *hname)
hbuf[hname->len] = ':';
hbuf[hname->len+1] = '\0';
- if (parse_hname2_short(hbuf, hbuf+hname->len+1, &hfm)==0) {
+ parse_hname2_short(hbuf, hbuf+hname->len+1, &hfm);
+ if(hfm.type==HDR_ERROR_T) {
LM_ERR("error parsing header name [%.*s]\n", hname->len, hname->s);
return -1;
}
@@ -2056,7 +2057,8 @@ int sr_kemi_hdr_remove(sip_msg_t *msg, str *hname)
hbuf[hname->len] = ':';
hbuf[hname->len+1] = '\0';
- if (parse_hname2_short(hbuf, hbuf+hname->len+1, &hfm)==0) {
+ parse_hname2_short(hbuf, hbuf+hname->len+1, &hfm);
+ if(hfm.type==HDR_ERROR_T) {
LM_ERR("error parsing header name [%.*s]\n", hname->len, hname->s);
return -1;
}
@@ -2106,7 +2108,8 @@ static int sr_kemi_hdr_is_present(sip_msg_t *msg, str *hname)
hbuf[hname->len] = ':';
hbuf[hname->len+1] = '\0';
- if (parse_hname2_short(hbuf, hbuf+hname->len+1, &hfm)==0) {
+ parse_hname2_short(hbuf, hbuf+hname->len+1, &hfm);
+ if(hfm.type==HDR_ERROR_T) {
LM_ERR("error parsing header name [%.*s]\n", hname->len, hname->s);
return -1;
}
@@ -2188,7 +2191,8 @@ static int sr_kemi_hdr_insert_before(sip_msg_t *msg, str *txt, str *hname)
hbuf[hname->len] = ':';
hbuf[hname->len+1] = '\0';
- if (parse_hname2_short(hbuf, hbuf+hname->len+1, &hfm)==0) {
+ parse_hname2_short(hbuf, hbuf+hname->len+1, &hfm);
+ if(hfm.type==HDR_ERROR_T) {
LM_ERR("error parsing header name [%.*s]\n", hname->len, hname->s);
return -1;
}
@@ -2305,7 +2309,8 @@ static sr_kemi_xval_t* sr_kemi_hdr_get_mode(sip_msg_t *msg, str *hname, int idx,
sr_kemi_xval_null(&_sr_kemi_xval, rmode);
return &_sr_kemi_xval;
}
- if (parse_hname2_str(hname, &shdr)==0) {
+ parse_hname2_str(hname, &shdr);
+ if(shdr.type==HDR_ERROR_T) {
LM_ERR("error parsing header name [%.*s]\n", hname->len, hname->s);
sr_kemi_xval_null(&_sr_kemi_xval, rmode);
return &_sr_kemi_xval;
@@ -2426,7 +2431,8 @@ static int sr_kemi_hdr_match_content(sip_msg_t *msg, str *hname, str *op,
return SR_KEMI_FALSE;
}
- if (parse_hname2_str(hname, &hfm)==0) {
+ parse_hname2_str(hname, &hfm);
+ if(hfm.type==HDR_ERROR_T) {
LM_ERR("error parsing header name [%.*s]\n", hname->len, hname->s);
return SR_KEMI_FALSE;
}