diff options
author | Marten Klencke <mklencke@gmx.net> | 2010-04-22 03:09:15 +0000 |
---|---|---|
committer | Marten Klencke <mklencke@gmx.net> | 2010-04-22 03:09:15 +0000 |
commit | 22287f29f78f846e77a842d24af585dd0b42c6e6 (patch) | |
tree | b64e431c89be89b49d407d6763673354058f67a9 /libpurple/proxy.c | |
parent | c309b498265cfd10dd4c99d9925640d6c2996750 (diff) | |
download | pidgin-22287f29f78f846e77a842d24af585dd0b42c6e6.tar.gz |
Fix an invalid memory deref with Windows proxy settings when there's no ":port"
Patch from Marten Klencke. Closes #11701.
committer: Paul Aurich <darkrain42@pidgin.im>
Diffstat (limited to 'libpurple/proxy.c')
-rw-r--r-- | libpurple/proxy.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libpurple/proxy.c b/libpurple/proxy.c index 282b3572f0..15e943711b 100644 --- a/libpurple/proxy.c +++ b/libpurple/proxy.c @@ -379,11 +379,16 @@ _proxy_fill_hostinfo(PurpleProxyInfo *info, char *host, int default_port) char *d; d = g_strrstr(host, ":"); - if (d) + if (d) { *d = '\0'; - d++; - if (*d) - sscanf(d, "%d", &port); + + d++; + if (*d) + sscanf(d, "%d", &port); + + if (port == 0) + port = default_port; + } purple_proxy_info_set_host(info, host); purple_proxy_info_set_port(info, port); |