comparison src/proxy.c @ 10912:dcbc56eb3f37

[gaim-migrate @ 12667] Fix bug 1200218 - crash when socks5 password is empty committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 14 May 2005 13:20:37 +0000
parents 00483ba950bf
children aca17634b9ab
comparison
equal deleted inserted replaced
10911:1012f463d2b9 10912:dcbc56eb3f37
1574 return; 1574 return;
1575 } 1575 }
1576 1576
1577 if (buf[1] == 0x02) { 1577 if (buf[1] == 0x02) {
1578 unsigned int i, j; 1578 unsigned int i, j;
1579 1579 const char *u, *p;
1580 i = strlen(gaim_proxy_info_get_username(phb->gpi)); 1580
1581 j = strlen(gaim_proxy_info_get_password(phb->gpi)); 1581 u = gaim_proxy_info_get_username(phb->gpi);
1582 p = gaim_proxy_info_get_password(phb->gpi);
1583
1584 i = (u == NULL) ? 0 : strlen(u);
1585 j = (p == NULL) ? 0 : strlen(p);
1582 1586
1583 buf[0] = 0x01; /* version 1 */ 1587 buf[0] = 0x01; /* version 1 */
1584 buf[1] = i; 1588 buf[1] = i;
1585 memcpy(buf + 2, gaim_proxy_info_get_username(phb->gpi), i); 1589 memcpy(buf + 2, gaim_proxy_info_get_username(phb->gpi), i);
1586 buf[2 + i] = j; 1590 buf[2 + i] = j;