# HG changeset patch # User Stu Tomlinson # Date 1116076837 0 # Node ID dcbc56eb3f37f3f06d2064592737a0b5c5ea7fa5 # Parent 1012f463d2b9a90475098b64b4eb2f1a33e89524 [gaim-migrate @ 12667] Fix bug 1200218 - crash when socks5 password is empty committer: Tailor Script diff -r 1012f463d2b9 -r dcbc56eb3f37 src/proxy.c --- a/src/proxy.c Fri May 13 01:04:08 2005 +0000 +++ b/src/proxy.c Sat May 14 13:20:37 2005 +0000 @@ -1576,9 +1576,13 @@ if (buf[1] == 0x02) { unsigned int i, j; + const char *u, *p; - i = strlen(gaim_proxy_info_get_username(phb->gpi)); - j = strlen(gaim_proxy_info_get_password(phb->gpi)); + u = gaim_proxy_info_get_username(phb->gpi); + p = gaim_proxy_info_get_password(phb->gpi); + + i = (u == NULL) ? 0 : strlen(u); + j = (p == NULL) ? 0 : strlen(p); buf[0] = 0x01; /* version 1 */ buf[1] = i;