Daniel-Constantin Mierla
2021-05-26 06:30:57 UTC
Content preview: Module: kamailio Branch: 5.4 Commit: b95e319d006a38fcc6385d704de82e553f7c2236
URL: https://github.com/kamailio/kamailio/commit/b95e319d006a38fcc6385d704de82e553f7c2236
Author: Daniel-Constantin Mierla <***@gmail.com> Committer: Daniel-Constantin
Mierla <***@gmail.com> Date: 2021-05-26T08:23:45+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 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
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.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: b95e319d006a38fcc6385d704de82e553f7c2236
URL: https://github.com/kamailio/kamailio/commit/b95e319d006a38fcc6385d704de82e553f7c2236
Author: Daniel-Constantin Mierla <***@gmail.com>
Committer: Daniel-Constantin Mierla <***@gmail.com>
Date: 2021-05-26T08:23:45+02:00
core/mem: q_malloc - use #else with DBG_QM_MALLOC for debug on freed fragments
(cherry picked from commit 764d5be0c44036bb4b86f841588fb0df3b4bb834)
(cherry picked from commit fc90e4c06c5df8c8a9d5cd615923c09a93b5a810)
---
Modified: src/core/mem/q_malloc.c
---
Diff: https://github.com/kamailio/kamailio/commit/b95e319d006a38fcc6385d704de82e553f7c2236.diff
Patch: https://github.com/kamailio/kamailio/commit/b95e319d006a38fcc6385d704de82e553f7c2236.patch
---
diff --git a/src/core/mem/q_malloc.c b/src/core/mem/q_malloc.c
index b518bfab81..b0f7625a40 100644
--- a/src/core/mem/q_malloc.c
+++ b/src/core/mem/q_malloc.c
@@ -509,7 +509,7 @@ void qm_free(void* qmp, void* p)
#ifdef DBG_QM_MALLOC
qm_debug_frag(qm, f, file, line);
- if (f->u.is_free){
+ if (unlikely(f->u.is_free)){
if(likely(cfg_get(core, core_cfg, mem_safety)==0)) {
LM_CRIT("BUG: freeing already freed pointer (%p),"
" called from %s: %s(%d), first free %s: %s(%ld) - aborting\n",
@@ -524,12 +524,13 @@ void qm_free(void* qmp, void* p)
}
MDBG("freeing frag. %p alloc'ed from %s: %s(%ld)\n",
f, f->file, f->func, f->line);
-#endif
+#else
if (unlikely(f->u.is_free)){
LM_INFO("freeing a free fragment (%p/%p) - ignore\n",
f, p);
return;
}
+#endif
size=f->size;
qm->used-=size;
URL: https://github.com/kamailio/kamailio/commit/b95e319d006a38fcc6385d704de82e553f7c2236
Author: Daniel-Constantin Mierla <***@gmail.com> Committer: Daniel-Constantin
Mierla <***@gmail.com> Date: 2021-05-26T08:23:45+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 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
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.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: b95e319d006a38fcc6385d704de82e553f7c2236
URL: https://github.com/kamailio/kamailio/commit/b95e319d006a38fcc6385d704de82e553f7c2236
Author: Daniel-Constantin Mierla <***@gmail.com>
Committer: Daniel-Constantin Mierla <***@gmail.com>
Date: 2021-05-26T08:23:45+02:00
core/mem: q_malloc - use #else with DBG_QM_MALLOC for debug on freed fragments
(cherry picked from commit 764d5be0c44036bb4b86f841588fb0df3b4bb834)
(cherry picked from commit fc90e4c06c5df8c8a9d5cd615923c09a93b5a810)
---
Modified: src/core/mem/q_malloc.c
---
Diff: https://github.com/kamailio/kamailio/commit/b95e319d006a38fcc6385d704de82e553f7c2236.diff
Patch: https://github.com/kamailio/kamailio/commit/b95e319d006a38fcc6385d704de82e553f7c2236.patch
---
diff --git a/src/core/mem/q_malloc.c b/src/core/mem/q_malloc.c
index b518bfab81..b0f7625a40 100644
--- a/src/core/mem/q_malloc.c
+++ b/src/core/mem/q_malloc.c
@@ -509,7 +509,7 @@ void qm_free(void* qmp, void* p)
#ifdef DBG_QM_MALLOC
qm_debug_frag(qm, f, file, line);
- if (f->u.is_free){
+ if (unlikely(f->u.is_free)){
if(likely(cfg_get(core, core_cfg, mem_safety)==0)) {
LM_CRIT("BUG: freeing already freed pointer (%p),"
" called from %s: %s(%d), first free %s: %s(%ld) - aborting\n",
@@ -524,12 +524,13 @@ void qm_free(void* qmp, void* p)
}
MDBG("freeing frag. %p alloc'ed from %s: %s(%ld)\n",
f, f->file, f->func, f->line);
-#endif
+#else
if (unlikely(f->u.is_free)){
LM_INFO("freeing a free fragment (%p/%p) - ignore\n",
f, p);
return;
}
+#endif
size=f->size;
qm->used-=size;