Mercurial > pidgin.yaz
comparison libpurple/proxy.c @ 30185:9e60e300541a
Fix an invalid memory deref with Windows proxy settings when there's no ":port"
Patch from Marten Klencke. Closes #11701.
committer: Paul Aurich <paul@darkrain42.org>
author | mklencke@gmx.net |
---|---|
date | Thu, 22 Apr 2010 03:09:15 +0000 |
parents | 0257b8fe21d6 |
children | 7c871249318b |
comparison
equal
deleted
inserted
replaced
30184:3ac7f10d13d4 | 30185:9e60e300541a |
---|---|
377 { | 377 { |
378 int port = default_port; | 378 int port = default_port; |
379 char *d; | 379 char *d; |
380 | 380 |
381 d = g_strrstr(host, ":"); | 381 d = g_strrstr(host, ":"); |
382 if (d) | 382 if (d) { |
383 *d = '\0'; | 383 *d = '\0'; |
384 d++; | 384 |
385 if (*d) | 385 d++; |
386 sscanf(d, "%d", &port); | 386 if (*d) |
387 sscanf(d, "%d", &port); | |
388 | |
389 if (port == 0) | |
390 port = default_port; | |
391 } | |
387 | 392 |
388 purple_proxy_info_set_host(info, host); | 393 purple_proxy_info_set_host(info, host); |
389 purple_proxy_info_set_port(info, port); | 394 purple_proxy_info_set_port(info, port); |
390 } | 395 } |
391 | 396 |