From cfa26d3c75bd09cbfb893c9ff87cf39b346ae28b Mon Sep 17 00:00:00 2001 From: bagyenda <> Date: Mon, 15 May 2006 17:07:06 +0000 Subject: [PATCH] - Bug fix, failure when x-wap-profile header missing --- mbuni/mmsc/mmsproxy.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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),