Browse code

fix k bug #2790184, crash related to uninitialized match_callid parameter

- reported from Inaki, port from kamailio r5835

Henning Westerholt authored on 13/05/2009 11:03:30
Showing 1 changed files
... ...
@@ -179,6 +179,7 @@ int registered(struct sip_msg* _m, char* _t, char* _s)
179 179
 	urecord_t* r;
180 180
 	ucontact_t* ptr;
181 181
 	int res;
182
+	int_str match_callid;
182 183
 
183 184
 	if (_m->new_uri.s) uri = _m->new_uri;
184 185
 	else uri = _m->first_line.u.request.uri;
... ...
@@ -199,12 +200,15 @@ int registered(struct sip_msg* _m, char* _t, char* _s)
199 199
 
200 200
 	if (res == 0) {
201 201
 		
202
-		int_str match_callid;
203 202
 		if (reg_callid_avp_name.n) {
204 203
 			struct usr_avp *avp =
205 204
 				search_first_avp( reg_callid_avp_type, reg_callid_avp_name, &match_callid, 0);
206 205
 			if (!(avp && is_avp_str_val(avp)))
207
-				match_callid=(int_str)0;
206
+				match_callid.n = 0;
207
+				match_callid.s.s = NULL;
208
+		} else {
209
+			match_callid.n = 0;
210
+			match_callid.s.s = NULL;
208 211
 		}
209 212
 
210 213
 		for (ptr = r->contacts; ptr; ptr = ptr->next) {