diff --git a/mbuni/mmsc/mmsproxy.c b/mbuni/mmsc/mmsproxy.c index 295835e..4da34bd 100644 --- a/mbuni/mmsc/mmsproxy.c +++ b/mbuni/mmsc/mmsproxy.c @@ -131,11 +131,12 @@ int main(int argc, char *argv[]) /* Get the profile URL and store it. Has effect of fetching if missing. */ if ((h.profile_url = http_header_value(h.headers, - octstr_imm("X-Wap-Profile"))) == NULL) + octstr_imm("X-Wap-Profile"))) == NULL) h.profile_url = http_header_value(h.headers, octstr_imm("Profile")); - - octstr_strip_nonalphanums(h.profile_url); - + + if (h.profile_url) + octstr_strip_nonalphanums(h.profile_url); + /* Get the sender address. */ h.base_client_addr = mms_find_sender_msisdn(h.url, h.ip, @@ -252,7 +253,8 @@ void fetchmms_proxy(MmsHTTPClientInfo *h) prof = mms_get_ua_profile(octstr_get_cstr(h->profile_url)); if (!prof) prof = mms_make_ua_profile(h->headers); - } + } else + prof = mms_make_ua_profile(h->headers); if (loc == MMS_LOC_MQUEUE) { /* where is the message? */ e = mms_queue_readenvelope(octstr_get_cstr(qf),