Daniel-Constantin Mierla
2021-05-26 06:31:00 UTC
Content preview: Module: kamailio Branch: 5.4 Commit: dd09c233417129694ffb7481b03d465defae447d
URL: https://github.com/kamailio/kamailio/commit/dd09c233417129694ffb7481b03d465defae447d
Author: Daniel-Constantin Mierla <***@gmail.com> Committer: Daniel-Constantin
Mierla <***@gmail.com> Date: 2021-05-26T08:29:04+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.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.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 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: 5.4
Commit: dd09c233417129694ffb7481b03d465defae447d
URL: https://github.com/kamailio/kamailio/commit/dd09c233417129694ffb7481b03d465defae447d
Author: Daniel-Constantin Mierla <***@gmail.com>
Committer: Daniel-Constantin Mierla <***@gmail.com>
Date: 2021-05-26T08:29:04+02:00
core: xavp - safety checks for name len
(cherry picked from commit d22d812da1c3b2a2f65f142ef5ed5fa07e8ab072)
(cherry picked from commit 6a5a61bfab80116338f6a9c91ed7ec5f7b98923b)
---
Modified: src/core/xavp.c
---
Diff: https://github.com/kamailio/kamailio/commit/dd09c233417129694ffb7481b03d465defae447d.diff
Patch: https://github.com/kamailio/kamailio/commit/dd09c233417129694ffb7481b03d465defae447d.patch
---
diff --git a/src/core/xavp.c b/src/core/xavp.c
index e27c07bd6f..5f160a1ceb 100644
--- a/src/core/xavp.c
+++ b/src/core/xavp.c
@@ -106,7 +106,7 @@ static sr_xavp_t *xavp_new_value(str *name, sr_xval_t *val)
int size;
unsigned int id;
- if(name==NULL || name->s==NULL || val==NULL)
+ if(name==NULL || name->s==NULL || name->len<=0 || val==NULL)
return NULL;
id = get_hash1_raw(name->s, name->len);
@@ -427,7 +427,7 @@ static int xavp_rm_internal(str *name, sr_xavp_t **head, int idx)
int n=0;
int count=0;
- if(name==NULL || name->s==NULL)
+ if(name==NULL || name->s==NULL || name->len<=0)
return 0;
id = get_hash1_raw(name->s, name->len);
@@ -498,7 +498,7 @@ int xavp_count(str *name, sr_xavp_t **start)
unsigned int id;
int n = 0;
- if(name==NULL || name->s==NULL)
+ if(name==NULL || name->s==NULL || name->len<=0)
return -1;
id = get_hash1_raw(name->s, name->len);
@@ -865,7 +865,7 @@ sr_xavp_t *xavp_extract(str *name, sr_xavp_t **list)
sr_xavp_t *prv = 0;
unsigned int id;
- if(name==NULL || name->s==NULL) {
+ if(name==NULL || name->s==NULL || name->len<=0) {
if(list!=NULL) {
avp = *list;
if(avp!=NULL) {
@@ -1157,7 +1157,7 @@ static sr_xavp_t *xavu_get_internal(str *name, sr_xavp_t **list, sr_xavp_t **prv
sr_xavp_t *avu;
unsigned int id;
- if(name==NULL || name->s==NULL) {
+ if(name==NULL || name->s==NULL || name->len<=0) {
return NULL;
}
@@ -1235,7 +1235,7 @@ int xavu_rm_by_name(str *name, sr_xavp_t **head)
unsigned int id;
- if(name==NULL || name->s==NULL) {
+ if(name==NULL || name->s==NULL || name->len<=0) {
return -1;
}
@@ -1466,7 +1466,7 @@ static sr_xavp_t *xavi_new_value(str *name, sr_xval_t *val)
int size;
unsigned int id;
- if(name==NULL || name->s==NULL || val==NULL)
+ if(name==NULL || name->s==NULL || name->len<=0 || val==NULL)
return NULL;
id = get_hash1_case_raw(name->s, name->len);
@@ -1699,7 +1699,7 @@ static sr_xavp_t *xavi_get_internal(str *name, sr_xavp_t **list, int idx, sr_xav
unsigned int id;
int n = 0;
- if(name==NULL || name->s==NULL)
+ if(name==NULL || name->s==NULL || name->len<=0)
return NULL;
id = get_hash1_case_raw(name->s, name->len);
@@ -1826,7 +1826,7 @@ static int xavi_rm_internal(str *name, sr_xavp_t **head, int idx)
int n=0;
int count=0;
- if(name==NULL || name->s==NULL)
+ if(name==NULL || name->s==NULL || name->len<=0)
return 0;
id = get_hash1_case_raw(name->s, name->len);
@@ -1909,7 +1909,7 @@ int xavi_count(str *name, sr_xavp_t **start)
unsigned int id;
int n = 0;
- if(name==NULL || name->s==NULL)
+ if(name==NULL || name->s==NULL || name->len<=0)
return -1;
id = get_hash1_case_raw(name->s, name->len);
@@ -2202,7 +2202,7 @@ sr_xavp_t *xavi_extract(str *name, sr_xavp_t **list)
sr_xavp_t *prv = 0;
unsigned int id;
- if(name==NULL || name->s==NULL) {
+ if(name==NULL || name->s==NULL || name->len<=0) {
if(list!=NULL) {
avi = *list;
if(avi!=NULL) {
URL: https://github.com/kamailio/kamailio/commit/dd09c233417129694ffb7481b03d465defae447d
Author: Daniel-Constantin Mierla <***@gmail.com> Committer: Daniel-Constantin
Mierla <***@gmail.com> Date: 2021-05-26T08:29:04+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.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.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 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: 5.4
Commit: dd09c233417129694ffb7481b03d465defae447d
URL: https://github.com/kamailio/kamailio/commit/dd09c233417129694ffb7481b03d465defae447d
Author: Daniel-Constantin Mierla <***@gmail.com>
Committer: Daniel-Constantin Mierla <***@gmail.com>
Date: 2021-05-26T08:29:04+02:00
core: xavp - safety checks for name len
(cherry picked from commit d22d812da1c3b2a2f65f142ef5ed5fa07e8ab072)
(cherry picked from commit 6a5a61bfab80116338f6a9c91ed7ec5f7b98923b)
---
Modified: src/core/xavp.c
---
Diff: https://github.com/kamailio/kamailio/commit/dd09c233417129694ffb7481b03d465defae447d.diff
Patch: https://github.com/kamailio/kamailio/commit/dd09c233417129694ffb7481b03d465defae447d.patch
---
diff --git a/src/core/xavp.c b/src/core/xavp.c
index e27c07bd6f..5f160a1ceb 100644
--- a/src/core/xavp.c
+++ b/src/core/xavp.c
@@ -106,7 +106,7 @@ static sr_xavp_t *xavp_new_value(str *name, sr_xval_t *val)
int size;
unsigned int id;
- if(name==NULL || name->s==NULL || val==NULL)
+ if(name==NULL || name->s==NULL || name->len<=0 || val==NULL)
return NULL;
id = get_hash1_raw(name->s, name->len);
@@ -427,7 +427,7 @@ static int xavp_rm_internal(str *name, sr_xavp_t **head, int idx)
int n=0;
int count=0;
- if(name==NULL || name->s==NULL)
+ if(name==NULL || name->s==NULL || name->len<=0)
return 0;
id = get_hash1_raw(name->s, name->len);
@@ -498,7 +498,7 @@ int xavp_count(str *name, sr_xavp_t **start)
unsigned int id;
int n = 0;
- if(name==NULL || name->s==NULL)
+ if(name==NULL || name->s==NULL || name->len<=0)
return -1;
id = get_hash1_raw(name->s, name->len);
@@ -865,7 +865,7 @@ sr_xavp_t *xavp_extract(str *name, sr_xavp_t **list)
sr_xavp_t *prv = 0;
unsigned int id;
- if(name==NULL || name->s==NULL) {
+ if(name==NULL || name->s==NULL || name->len<=0) {
if(list!=NULL) {
avp = *list;
if(avp!=NULL) {
@@ -1157,7 +1157,7 @@ static sr_xavp_t *xavu_get_internal(str *name, sr_xavp_t **list, sr_xavp_t **prv
sr_xavp_t *avu;
unsigned int id;
- if(name==NULL || name->s==NULL) {
+ if(name==NULL || name->s==NULL || name->len<=0) {
return NULL;
}
@@ -1235,7 +1235,7 @@ int xavu_rm_by_name(str *name, sr_xavp_t **head)
unsigned int id;
- if(name==NULL || name->s==NULL) {
+ if(name==NULL || name->s==NULL || name->len<=0) {
return -1;
}
@@ -1466,7 +1466,7 @@ static sr_xavp_t *xavi_new_value(str *name, sr_xval_t *val)
int size;
unsigned int id;
- if(name==NULL || name->s==NULL || val==NULL)
+ if(name==NULL || name->s==NULL || name->len<=0 || val==NULL)
return NULL;
id = get_hash1_case_raw(name->s, name->len);
@@ -1699,7 +1699,7 @@ static sr_xavp_t *xavi_get_internal(str *name, sr_xavp_t **list, int idx, sr_xav
unsigned int id;
int n = 0;
- if(name==NULL || name->s==NULL)
+ if(name==NULL || name->s==NULL || name->len<=0)
return NULL;
id = get_hash1_case_raw(name->s, name->len);
@@ -1826,7 +1826,7 @@ static int xavi_rm_internal(str *name, sr_xavp_t **head, int idx)
int n=0;
int count=0;
- if(name==NULL || name->s==NULL)
+ if(name==NULL || name->s==NULL || name->len<=0)
return 0;
id = get_hash1_case_raw(name->s, name->len);
@@ -1909,7 +1909,7 @@ int xavi_count(str *name, sr_xavp_t **start)
unsigned int id;
int n = 0;
- if(name==NULL || name->s==NULL)
+ if(name==NULL || name->s==NULL || name->len<=0)
return -1;
id = get_hash1_case_raw(name->s, name->len);
@@ -2202,7 +2202,7 @@ sr_xavp_t *xavi_extract(str *name, sr_xavp_t **list)
sr_xavp_t *prv = 0;
unsigned int id;
- if(name==NULL || name->s==NULL) {
+ if(name==NULL || name->s==NULL || name->len<=0) {
if(list!=NULL) {
avi = *list;
if(avi!=NULL) {