[sr-dev] git:master:6719a6db: modules/ims_qos: corrected fixup bug when passing in empty sub id and sub type

Richard Good richard.good at smilecoms.com
Wed Feb 18 16:21:38 CET 2015


Module: kamailio
Branch: master
Commit: 6719a6db100d3ab63c2e95b0e1d076989c65fa12
URL: https://github.com/kamailio/kamailio/commit/6719a6db100d3ab63c2e95b0e1d076989c65fa12

Author: Richard Good <richard.good at smilecoms.com>
Committer: Richard Good <richard.good at smilecoms.com>
Date: 2015-02-18T17:20:55+02:00

modules/ims_qos: corrected fixup bug when passing in empty sub id and sub type

---

Modified: modules/ims_qos/mod.c

---

Diff:  https://github.com/kamailio/kamailio/commit/6719a6db100d3ab63c2e95b0e1d076989c65fa12.diff
Patch: https://github.com/kamailio/kamailio/commit/6719a6db100d3ab63c2e95b0e1d076989c65fa12.patch

---

diff --git a/modules/ims_qos/mod.c b/modules/ims_qos/mod.c
index 49f3707..acb35ae 100644
--- a/modules/ims_qos/mod.c
+++ b/modules/ims_qos/mod.c
@@ -1204,9 +1204,10 @@ static int fixup_aar_register(void** param, int param_no) {
 
 static int fixup_aar(void** param, int param_no) {
     str s;
-    unsigned int num;
+    int num;
     
-    if (strlen((char*) *param) <= 0) {
+    //param 3 can be empty
+    if (param_no != 3 && strlen((char*) *param) <= 0) {
         LM_ERR("empty parameter %d not allowed\n", param_no);
         return -1;
     }
@@ -1221,12 +1222,12 @@ static int fixup_aar(void** param, int param_no) {
 	/*convert to int */
 	s.s = (char*)*param;
 	s.len = strlen(s.s);
-	if (str2int(&s, &num)==0) {
+	if (str2sint(&s, &num)==0) {
 		pkg_free(*param);
 		*param = (void*)(unsigned long)num;
 		return 0;
 	}
-	LM_ERR("Bad reservation units: <%s>n", (char*)(*param));
+	LM_ERR("Bad subscription id: <%s>n", (char*)(*param));
 	return E_CFG;
     }
 




More information about the sr-dev mailing list