[sr-dev] git:master:853f6545: core: don't abort() Kamailio in case of invalid lump parameters, return an error

Henning Westerholt hw at skalatan.de
Thu Apr 11 09:23:05 CEST 2019


Module: kamailio
Branch: master
Commit: 853f65454d1a77b0145e80b006699fa1048045ac
URL: https://github.com/kamailio/kamailio/commit/853f65454d1a77b0145e80b006699fa1048045ac

Author: Henning Westerholt <hw at skalatan.de>
Committer: Henning Westerholt <hw at skalatan.de>
Date: 2019-04-11T09:21:44+02:00

core: don't abort() Kamailio in case of invalid lump parameters, return an error

---

Modified: src/core/data_lump.c

---

Diff:  https://github.com/kamailio/kamailio/commit/853f65454d1a77b0145e80b006699fa1048045ac.diff
Patch: https://github.com/kamailio/kamailio/commit/853f65454d1a77b0145e80b006699fa1048045ac.patch

---

diff --git a/src/core/data_lump.c b/src/core/data_lump.c
index 007c5de2cc..a15f3e30e6 100644
--- a/src/core/data_lump.c
+++ b/src/core/data_lump.c
@@ -291,14 +291,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);
@@ -348,9 +348,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);
@@ -408,9 +408,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);




More information about the sr-dev mailing list