Jelajahi Sumber

registrar: Add check for contact header before checking outbound support

- Fixes crash when processing REGISTER without a contact
Hugh Waite 11 tahun lalu
induk
melakukan
c9301c99d3
1 mengubah file dengan 1 tambahan dan 0 penghapusan
  1. 1 0
      modules/registrar/save.c

+ 1 - 0
modules/registrar/save.c

@@ -910,6 +910,7 @@ int save(struct sip_msg* _m, udomain_t* _d, int _cflags, str *_uri)
 	}
 	}
 
 
 	if (reg_outbound_mode != REG_OUTBOUND_NONE
 	if (reg_outbound_mode != REG_OUTBOUND_NONE
+			&& _m->contact && _m->contact->parsed
 			&& !(parse_headers(_m, HDR_VIA2_F, 0) == -1 || _m->via2 == 0
 			&& !(parse_headers(_m, HDR_VIA2_F, 0) == -1 || _m->via2 == 0
 				|| _m->via2->error != PARSE_OK)) {
 				|| _m->via2->error != PARSE_OK)) {
 		/* Outbound supported on server, and more than one Via: - not the first hop */
 		/* Outbound supported on server, and more than one Via: - not the first hop */