[Asterisk-code-review] res parking: Fix crash if ATTENDEDTRANSFER set empty before ... (asterisk[master])
Richard Mudgett
asteriskteam at digium.com
Thu Jul 16 12:24:51 CDT 2015
Richard Mudgett has uploaded a new change for review.
https://gerrit.asterisk.org/915
Change subject: res_parking: Fix crash if ATTENDEDTRANSFER set empty before Park.
......................................................................
res_parking: Fix crash if ATTENDEDTRANSFER set empty before Park.
setup_park_common_datastore() was assuming that a non-NULL string returned
for the ATTENDEDTRANSFER and BLINDTRANSFER channel variables are not empty
strings. Things got crashy as a result.
* Made setup_park_common_datastore() treat the channel variable values the
same whether they are NULL or empty for ATTENDEDTRANSFER and
BLINDTRANSFER.
ASTERISK-25254 #close
Reported by: Richard Mudgett
Change-Id: I9a9c174b33f354f35f82cc6b7cea8303adbaf9c2
---
M res/parking/parking_applications.c
1 file changed, 6 insertions(+), 2 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/15/915/1
diff --git a/res/parking/parking_applications.c b/res/parking/parking_applications.c
index 5077474..7ce8a32 100644
--- a/res/parking/parking_applications.c
+++ b/res/parking/parking_applications.c
@@ -349,8 +349,12 @@
attended_transfer = pbx_builtin_getvar_helper(parkee, "ATTENDEDTRANSFER");
blind_transfer = pbx_builtin_getvar_helper(parkee, "BLINDTRANSFER");
- if (attended_transfer || blind_transfer) {
- parker_dial_string = ast_strdupa(S_OR(attended_transfer, blind_transfer));
+ if (!ast_strlen_zero(attended_transfer)) {
+ parker_dial_string = ast_strdupa(attended_transfer);
+ } else if (!ast_strlen_zero(blind_transfer)) {
+ parker_dial_string = ast_strdupa(blind_transfer);
+ /* Ensure that attended_transfer is NULL and not an empty string. */
+ attended_transfer = NULL;
}
ast_channel_unlock(parkee);
--
To view, visit https://gerrit.asterisk.org/915
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9a9c174b33f354f35f82cc6b7cea8303adbaf9c2
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
More information about the asterisk-code-review
mailing list