Module: kamailio
Branch: 5.1
Commit: e723cc9730a039a24f6fdb969c3259b2d4935be4
URL:
https://github.com/kamailio/kamailio/commit/e723cc9730a039a24f6fdb969c3259b…
Author: Henning Westerholt <hw(a)skalatan.de>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2019-04-11T09:23:36+02:00
core: don't abort() Kamailio in case of invalid lump parameters, return an error
(cherry picked from commit 853f65454d1a77b0145e80b006699fa1048045ac)
---
Modified: src/core/data_lump.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e723cc9730a039a24f6fdb969c3259b…
Patch:
https://github.com/kamailio/kamailio/commit/e723cc9730a039a24f6fdb969c3259b…
---
diff --git a/src/core/data_lump.c b/src/core/data_lump.c
index e033b4e794..bb181ef2d9 100644
--- a/src/core/data_lump.c
+++ b/src/core/data_lump.c
@@ -288,14 +288,14 @@ struct lump* del_lump(struct sip_msg* msg, int offset, int len, enum
_hdr_types_
/* extra checks */
if (offset>msg->len){
- LM_CRIT("offset exceeds message size (%d > %d) aborting...\n",
+ LM_CRIT("offset exceeds message size (%d > %d)\n",
offset, msg->len);
- abort();
+ return 0;
}
if (offset+len>msg->len){
LM_CRIT("offset + len exceeds message size (%d + %d > %d)\n",
offset, len, msg->len);
- abort();
+ return 0;
}
if (len==0){
LM_WARN("0 len (offset=%d)\n", offset);
@@ -344,9 +344,9 @@ struct lump* anchor_lump(struct sip_msg* msg, int offset, int len,
enum _hdr_typ
/* extra checks */
if (offset>msg->len){
- LM_CRIT("offset exceeds message size (%d > %d) aborting...\n",
+ LM_CRIT("offset exceeds message size (%d > %d)\n",
offset, msg->len);
- abort();
+ return 0;
}
if (len){
LM_WARN("len !=0 (%d)\n", len);
@@ -404,9 +404,9 @@ struct lump* anchor_lump2(struct sip_msg* msg, int offset, int len,
enum _hdr_ty
/* extra checks */
if (offset>msg->len){
- LM_CRIT("offset exceeds message size (%d > %d) aborting...\n",
+ LM_CRIT("offset exceeds message size (%d > %d)\n",
offset, msg->len);
- abort();
+ return 0;
}
if (len){
LM_WARN("len !=0 (%d)\n", len);