-Wed Feb 12 22:23:00 UTC 2020
+Thu Feb 13 14:53:01 UTC 2020
msg_header_t *msg_header_d(su_home_t *home, msg_t const *msg, char const *b)
{
msg_mclass_t const *mc = msg->m_class;
- msg_href_t const *hr = mc->mc_unknown;
+ msg_href_t const *hr;
isize_t n; /* Length of header contents */
isize_t name_len, xtra;
msg_header_t *h;
size_t n = strcspn(s, "\"\\");
if (n == 0) {
- if (e + 2 <= bsiz)
+ if (b && e + 2 <= bsiz)
b[e] = '\\', b[e + 1] = s[0];
e += 2;
s++;
}
}
- if (e < bsiz)
+ if (b && e < bsiz)
b[e] = '"';
e++;
nea_view_queue(nes, evv, evq);
SU_DEBUG_7(("nea_server_update(%p): %s (%s)\n", (void *)nes,
- ev->ev_event->o_type, evv->evv_content_type->c_type));
+ ev->ev_event->o_type, (evv->evv_content_type ? evv->evv_content_type->c_type : "N/A")));
return 1;
}
}
}
+ if (!via) {
+ SU_DEBUG_9(("nta: agent_init_via failed\n" VA_NONE));
+ goto error;
+ }
+
/* Duplicate the list bind to the transports */
new_via = sip_via_dup(self->sa_home, via);
/* Duplicate the complete list shown to the application */
return;
}
- if (sip->sip_cseq->cs_method == sip_method_ack) {
+ if (sip->sip_cseq && sip->sip_cseq->cs_method == sip_method_ack) {
/* Drop response messages to ACK */
agent->sa_stats->as_bad_response++;
agent->sa_stats->as_bad_message++;
nta_outgoing_t **slot;
for (slot = &orq->orq_forking->orq_forks;
- *slot;
+ slot && *slot;
slot = &(*slot)->orq_forks) {
if (orq == *slot) {
*slot = orq->orq_forks;
size_t i, j;
path = (char *)url->url_path;
+
+ if (!path) {
+ SU_DEBUG_3(("nth_site_create(): invalid url\n" VA_NONE));
+ errno = EINVAL;
+ goto error;
+ }
+
while (path[0] == '/')
path++;
if (subsite)
subsite->site_access = now;
- else
+ else if (site)
site->site_access = now;
- if (subsite && subsite->site_isdir && subpath == site_nodir_match) {
+ if (site && subsite && subsite->site_isdir && subpath == site_nodir_match) {
/* Answer with 301 */
http_location_t loc[1];
http_location_init(loc);
struct notifier_usage *nu = nua_dialog_usage_private(du);
//nua_client_request_t *cr = du->du_cr;
+ if (!nu)
+ return -1;
+
nu->nu_substate = nua_substate_terminated;
#if 0
if (cr) {
su_home_t *home = nh->nh_home;
nua_t *nua = nh->nh_nua;
nua_handle_t *dnh = nua->nua_dhandle;
- nua_handle_preferences_t *dst = nh->nh_prefs, old[1];
+ nua_handle_preferences_t *dst, old[1];
if (gsrc) {
*nua->nua_prefs = *gsrc; /* No pointers this far */
ru = nua_dialog_usage_private(du);
+ if (!ru)
+ return;
+
if (ru->pending)
tport_release(ru->tport, ru->pending, NULL, NULL, nh, 0), ru->pending = 0;
sr_status(sr, SIP_500_INTERNAL_SERVER_ERROR);
}
else {
- sr->sr_answer_sent = 1, ss->ss_oa_sent = Answer;
- ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
+ sr->sr_answer_sent = 1;
+ if (ss) {
+ ss->ss_oa_sent = Answer;
+ ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
+ }
}
}
}
if (error < 0) {
- nua_stack_event(nh->nh_nua, nh, NULL, event,
+ if (nh) {
+ nua_stack_event(nh->nh_nua, nh, NULL, event,
NUA_ERROR_AT(__FILE__, __LINE__), NULL);
+ }
}
su_msg_destroy(nua->nua_signal);
if ((a != NULL) != (b != NULL))
return (a != NULL) < (b != NULL) ? -1 : 1;
+ if (!a || !b)
+ return -1;
+
if (a->k_method != b->k_method)
return a->k_method < b->k_method ? -1 : 1;
if (a->k_method == sdp_key_x &&
/* Make transport parameter lowercase */
if (transport && strlen(transport) < (sizeof _transport)) {
- char *s = strcpy(_transport, transport);
+ char *s;
short c;
+ strcpy(_transport, transport);
+
for (s = _transport; (c = *s) && c != ';'; s++)
if (isupper(c))
*s = tolower(c);
#endif
case AF_INET:
+#ifndef USE_LOCALINFO0
ip4 = 1;
+#endif
break;
case 0:
+#ifndef USE_LOCALINFO0
ip4 = 1;
+#endif
#if SU_HAVE_IN6
ip6 = 1;
#endif