Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
5c88a8dd
Commit
5c88a8dd
authored
Sep 16, 2013
by
jehan
Browse files
fix crash in sal_process_authentication when auth cannot be sent synchronously
parent
632f0ac0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
coreapi/bellesip_sal/sal_impl.c
coreapi/bellesip_sal/sal_impl.c
+13
-11
No files found.
coreapi/bellesip_sal/sal_impl.c
View file @
5c88a8dd
...
...
@@ -105,7 +105,8 @@ void sal_remove_pending_auth(Sal *sal, SalOp *op){
}
void
sal_process_authentication
(
SalOp
*
op
)
{
belle_sip_request_t
*
request
=
belle_sip_transaction_get_request
((
belle_sip_transaction_t
*
)
op
->
pending_auth_transaction
);
belle_sip_request_t
*
initial_request
=
belle_sip_transaction_get_request
((
belle_sip_transaction_t
*
)
op
->
pending_auth_transaction
);
belle_sip_request_t
*
new_request
;
bool_t
is_within_dialog
=
FALSE
;
belle_sip_list_t
*
auth_list
=
NULL
;
belle_sip_auth_event_t
*
auth_event
;
...
...
@@ -114,30 +115,31 @@ void sal_process_authentication(SalOp *op) {
sal_add_pending_auth
(
op
->
base
.
root
,
op
);
if
(
op
->
dialog
&&
belle_sip_dialog_get_state
(
op
->
dialog
)
==
BELLE_SIP_DIALOG_CONFIRMED
)
{
request
=
belle_sip_dialog_create_request_from
(
op
->
dialog
,
request
);
if
(
!
request
)
request
=
belle_sip_dialog_create_queued_request_from
(
op
->
dialog
,
request
);
new_
request
=
belle_sip_dialog_create_request_from
(
op
->
dialog
,
initial_
request
);
if
(
!
new_
request
)
new_
request
=
belle_sip_dialog_create_queued_request_from
(
op
->
dialog
,
initial_
request
);
is_within_dialog
=
TRUE
;
}
else
{
belle_sip_message_remove_header
(
BELLE_SIP_MESSAGE
(
request
),
BELLE_SIP_AUTHORIZATION
);
belle_sip_message_remove_header
(
BELLE_SIP_MESSAGE
(
request
),
BELLE_SIP_PROXY_AUTHORIZATION
);
new_request
=
initial_request
;
belle_sip_message_remove_header
(
BELLE_SIP_MESSAGE
(
new_request
),
BELLE_SIP_AUTHORIZATION
);
belle_sip_message_remove_header
(
BELLE_SIP_MESSAGE
(
new_request
),
BELLE_SIP_PROXY_AUTHORIZATION
);
}
if
(
request
==
NULL
)
{
if
(
new_
request
==
NULL
)
{
ms_error
(
"sal_process_authentication() op=[%p] cannot obtain new request from dialog."
,
op
);
return
;
}
if
(
belle_sip_provider_add_authorization
(
op
->
base
.
root
->
prov
,
request
,
response
,
&
auth_list
))
{
if
(
belle_sip_provider_add_authorization
(
op
->
base
.
root
->
prov
,
new_
request
,
response
,
&
auth_list
))
{
if
(
is_within_dialog
)
{
sal_op_send_request
(
op
,
request
);
sal_op_send_request
(
op
,
new_
request
);
}
else
{
sal_op_resend_request
(
op
,
request
);
sal_op_resend_request
(
op
,
new_
request
);
}
sal_remove_pending_auth
(
op
->
base
.
root
,
op
);
}
else
{
ms_message
(
"No auth info found for [%s]"
,
sal_op_get_from
(
op
));
if
(
is_within_dialog
)
{
belle_sip_object_unref
(
request
);
belle_sip_object_unref
(
new_
request
);
}
if
(
op
->
auth_info
)
sal_auth_info_delete
(
op
->
auth_info
);
auth_event
=
(
belle_sip_auth_event_t
*
)(
auth_list
->
data
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment