diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2005-06-03 21:02:51 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2005-06-03 21:02:51 +0000 |
commit | a198e5af5a0d543430b74d32f7d298b07cd92b98 (patch) | |
tree | d7b006cc53d1a0549605d0fb383f68cb794513c5 /channels | |
parent | 115e45c7b0dcd710e929d75f0df78e09bed5732a (diff) |
use ast_strip_quoted to strip brackets from key secrets
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5835 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rwxr-xr-x | channels/chan_iax2.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 4dabea684..759fdb146 100755 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -2877,13 +2877,8 @@ static void parse_dial_string(char *data, struct parsed_dial_string *pds) move it to the key field instead */ if (pds->password && (pds->password[0] == '[')) { - int len = strlen(pds->password); - - if ((len > 2) && (pds->password[len - 1] == ']')) { - pds->key = ++(pds->password); - pds->password[len - 1] = '\0'; - pds->password = NULL; - } + pds->key = ast_strip_quoted(pds->password, "[", "]"); + pds->password = NULL; } } |