use ast_strip_quoted to strip brackets from key secrets
authorKevin P. Fleming <kpfleming@digium.com>
Fri, 3 Jun 2005 21:02:51 +0000 (21:02 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Fri, 3 Jun 2005 21:02:51 +0000 (21:02 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5835 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c

index 4dabea6..759fdb1 100755 (executable)
@@ -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;
        }
 }