[sr-dev] git:master:3b6d7a28: utils: Fix crash in http_query

Hugh Waite hugh.waite at xura.com
Wed Dec 9 15:20:18 CET 2015


Module: kamailio
Branch: master
Commit: 3b6d7a28ea0b053f27cb169ac31259e20ef4ece0
URL: https://github.com/kamailio/kamailio/commit/3b6d7a28ea0b053f27cb169ac31259e20ef4ece0

Author: Hugh Waite <hugh.waite at xura.com>
Committer: Hugh Waite <hugh.waite at xura.com>
Date: 2015-12-09T14:15:47Z

utils: Fix crash in http_query
- Fixes incorrect fixup logic for http_query_post_hdr
- Bug reported by jayesh1017

---

Modified: modules/utils/utils.c

---

Diff:  https://github.com/kamailio/kamailio/commit/3b6d7a28ea0b053f27cb169ac31259e20ef4ece0.diff
Patch: https://github.com/kamailio/kamailio/commit/3b6d7a28ea0b053f27cb169ac31259e20ef4ece0.patch

---

diff --git a/modules/utils/utils.c b/modules/utils/utils.c
index 368f5b9..b407742 100644
--- a/modules/utils/utils.c
+++ b/modules/utils/utils.c
@@ -361,8 +361,7 @@ static int fixup_http_query_get(void** param, int param_no)
 static int fixup_free_http_query_get(void** param, int param_no)
 {
     if (param_no == 1) {
-	LM_WARN("free function has not been defined for spve\n");
-	return 0;
+	return fixup_free_spve_null(param, 1);
     }
 
     if (param_no == 2) {
@@ -406,7 +405,7 @@ static int fixup_http_query_post(void** param, int param_no)
  */
 static int fixup_http_query_post_hdr(void** param, int param_no)
 {
-    if ((param_no >= 1) || (param_no <= 3)) {
+    if ((param_no >= 1) && (param_no <= 3)) {
 	return fixup_spve_null(param, 1);
     }
 
@@ -432,8 +431,7 @@ static int fixup_http_query_post_hdr(void** param, int param_no)
 static int fixup_free_http_query_post(void** param, int param_no)
 {
     if ((param_no == 1) || (param_no == 2)) {
-	LM_WARN("free function has not been defined for spve\n");
-	return 0;
+	return fixup_free_spve_null(param, 1);
     }
 
     if (param_no == 3) {
@@ -449,12 +447,11 @@ static int fixup_free_http_query_post(void** param, int param_no)
  */
 static int fixup_free_http_query_post_hdr(void** param, int param_no)
 {
-    if ((param_no >= 1) || (param_no <= 2)) {
-	LM_WARN("free function has not been defined for spve\n");
-	return 0;
+    if ((param_no >= 1) && (param_no <= 3)) {
+	return fixup_free_spve_null(param, 1);
     }
 
-    if (param_no == 3) {
+    if (param_no == 4) {
 	return fixup_free_pvar_null(param, 1);
     }
     




More information about the sr-dev mailing list