[sr-dev] git:master:22fc924a: avp: clear code for unsupported parameter format

Daniel-Constantin Mierla miconda at gmail.com
Fri Jul 28 09:19:29 CEST 2017


Module: kamailio
Branch: master
Commit: 22fc924aa928fe126156290a10c4be8048ba4f8b
URL: https://github.com/kamailio/kamailio/commit/22fc924aa928fe126156290a10c4be8048ba4f8b

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-07-28T09:19:06+02:00

avp: clear code for unsupported parameter format

---

Modified: src/modules/avp/avp.c

---

Diff:  https://github.com/kamailio/kamailio/commit/22fc924aa928fe126156290a10c4be8048ba4f8b.diff
Patch: https://github.com/kamailio/kamailio/commit/22fc924aa928fe126156290a10c4be8048ba4f8b.patch

---

diff --git a/src/modules/avp/avp.c b/src/modules/avp/avp.c
index d6c8b3323d..1b13dd492b 100644
--- a/src/modules/avp/avp.c
+++ b/src/modules/avp/avp.c
@@ -1385,39 +1385,9 @@ static int attr_hdr_body2attrs_fixup(void **param, int param_no)
 	if(param_no == 1) {
 		c = *param;
 		if(*c == '#') {
-			c++;
-			n = strtol(c, &params, 10);
-			switch(*params) {
-				case PARAM_DELIM:
-					break;
-				case 0:
-					params = 0;
-					break;
-				default:
-					LOG(L_ERR, "attr_hdr_body2attrs_fixup: bad AVP value\n");
-					return E_CFG;
-			}
-			switch(n) {
-				//				case HDR_xxx:
-				//				case HDR_xxx:
-				//					break;
-				default:
-					LOG(L_ERR, "attr_hdr_body2attrs_fixup: header name is not "
-							"valid and supported HDR_xxx id '%s' resolved "
-							"as %d\n",
-							c, n);
-					return E_CFG;
-			}
-			h = pkg_malloc(sizeof(hdr_name_t));
-			if(!h) {
-				LOG(L_ERR, "attr_hdr_body2attrs_fixup: out of memory\n");
-				return E_OUT_OF_MEM;
-			}
-
-			h->kind = HDR_ID;
-			h->name.n = n;
-			pkg_free(*param);
-
+			LOG(L_ERR, "attr_hdr_body2attrs_fixup: header name is not "
+						"valid '%s'\n", c);
+			return E_CFG;
 		} else {
 			params = strchr(c, PARAM_DELIM);
 			if(params)




More information about the sr-dev mailing list