diff options
author | Mark Murawki <markm@intellasoft.net> | 2011-05-26 20:16:28 +0000 |
---|---|---|
committer | Mark Murawki <markm@intellasoft.net> | 2011-05-26 20:16:28 +0000 |
commit | 0648d9595bb5b00cb2b5ef362cb24691ad2e4ae2 (patch) | |
tree | 4173d9e36e0d0e82bbb1fbba194289d9a12adf95 /channels | |
parent | 74ba3af20119e561873e9bd491798e5b6975f07a (diff) |
Merged revisions 321100 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r321100 | markm | 2011-05-26 16:09:35 -0400 (Thu, 26 May 2011) | 11 lines
ast_sockaddr_resolve() in netsock2.c may deref a null pointer
Added a null check in netsock2 ast_sockaddr_resolve() as well as added default initalizers in chan_sip parse_uri_legacy_check() to make sure that invalid uris will make null (and not undefined) user,pass,domain,transport variables
(closes issue #19346)
Reported by: kobaz
Patches:
netsock2.patch uploaded by kobaz (license 834)
Tested by: kobaz, Marquis
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@321101 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 6d8e3e0e5..f542a112c 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -13551,6 +13551,20 @@ static int parse_ok_contact(struct sip_pvt *pvt, struct sip_request *req) /*! \brief parse uri in a way that allows semicolon stripping if legacy mode is enabled */ static int parse_uri_legacy_check(char *uri, const char *scheme, char **user, char **pass, char **domain, char **transport) { + /* Assume invalid to start */ + if (user) { + *user = 0; + } + if (pass) { + *pass = 0; + } + if (domain) { + *domain = 0; + } + if (transport) { + *transport = 0; + } + int ret = parse_uri(uri, scheme, user, pass, domain, transport); if (sip_cfg.legacy_useroption_parsing) { /* if legacy mode is active, strip semis from the user field */ char *p; |