Merged revisions 290506 via svnmerge from
authorDavid Vossel <dvossel@digium.com>
Tue, 5 Oct 2010 22:23:52 +0000 (22:23 +0000)
committerDavid Vossel <dvossel@digium.com>
Tue, 5 Oct 2010 22:23:52 +0000 (22:23 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r290506 | dvossel | 2010-10-05 17:23:00 -0500 (Tue, 05 Oct 2010) | 2 lines

  Fixes uninitialized memory problem in 'iax2 set debug peer' option.
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@290509 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c

index 5f085e5..0438c97 100644 (file)
@@ -7312,7 +7312,6 @@ static char *handle_cli_iax2_set_debug(struct ast_cli_entry *e, int cmd, struct
                struct iax2_peer *peer;
                struct sockaddr_in peer_addr;
 
-               ast_sockaddr_to_sin(&peer->addr, &peer_addr);
 
                if (a->argc != e->args + 1)
                        return CLI_SHOWUSAGE;
@@ -7324,6 +7323,8 @@ static char *handle_cli_iax2_set_debug(struct ast_cli_entry *e, int cmd, struct
                        return CLI_FAILURE;
                }
 
+               ast_sockaddr_to_sin(&peer->addr, &peer_addr);
+
                debugaddr.sin_addr = peer_addr.sin_addr;
                debugaddr.sin_port = peer_addr.sin_port;