Browse code

modules/enum: fixed access to service parameter in enum_query.

Juha Heinanen authored on 06/01/2011 09:14:14
Showing 1 changed files
... ...
@@ -730,19 +730,20 @@ int enum_query_1(struct sip_msg* _msg, char* _suffix, char* _str2)
730 730
  */
731 731
 int enum_query_2(struct sip_msg* _msg, char* _suffix, char* _service)
732 732
 {
733
-    str suffix, service;
733
+    str suffix, *service;
734 734
   
735 735
     if (get_str_fparam(&suffix, _msg, (fparam_t*)_suffix) != 0) {
736 736
 	LM_ERR("unable to get suffix\n");
737 737
 	return -1;
738 738
     }
739
-  
740
-    if (get_str_fparam(&service, _msg, (fparam_t*)_service) != 0) {
741
-	LM_ERR("unable to get service\n");
739
+
740
+    service = (str*)_service;
741
+    if ((service == NULL) || (service->len == 0)) {
742
+	LM_ERR("invalid service parameter");
742 743
 	return -1;
743 744
     }
744 745
 
745
-    return enum_query(_msg, &suffix, &service);
746
+    return enum_query(_msg, &suffix, service);
746 747
 }
747 748
 
748 749
 
... ...
@@ -756,6 +757,9 @@ int enum_query(struct sip_msg* _msg, str* suffix, str* service)
756 756
 	char name[MAX_DOMAIN_SIZE];
757 757
 	char string[17];
758 758
 
759
+	LM_DBG("enum_query on suffix <%.*s> service <%.*s>\n",
760
+	       suffix->len, suffix->s, service->len, service->s);
761
+
759 762
 	if (parse_sip_msg_uri(_msg) < 0) {
760 763
 		LM_ERR("Parsing of R-URI failed\n");
761 764
 		return -1;