diff src/protocols/oscar/auth.c @ 5345:bfe98c4d331e

[gaim-migrate @ 5721] ICQ has a maximum password length of 8 characters, apparently. I made Gaim truncate that shizzle for ICQ. This fixes this: http://sourceforge.net/tracker/?func=detail&aid=732409&group_id=235&atid=100235 committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 10 May 2003 15:33:48 +0000
parents 7c9f3d0fe8b2
children 04dc7fe68889
line wrap: on
line diff
--- a/src/protocols/oscar/auth.c	Sat May 10 12:47:17 2003 +0000
+++ b/src/protocols/oscar/auth.c	Sat May 10 15:33:48 2003 +0000
@@ -7,7 +7,7 @@
  */
 
 #define FAIM_INTERNAL
-#include <aim.h> 
+#include <aim.h>
 
 #include "md5.h"
 
@@ -156,10 +156,14 @@
 {
 	aim_frame_t *fr;
 	aim_tlvlist_t *tl = NULL;
+	int passwdlen;
 	char *password_encoded;
 
-	if (!(password_encoded = (char *) malloc(strlen(password))))
+	passwdlen = strlen(password);
+	if (!(password_encoded = (char *)malloc(passwdlen+1)))
 		return -ENOMEM;
+	if (passwdlen > MAXICQPASSLEN)
+		passwdlen = MAXICQPASSLEN;
 
 	if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x01, 1152))) {
 		free(password_encoded);
@@ -170,7 +174,7 @@
 
 	aimbs_put32(&fr->data, 0x00000001); /* FLAP Version */
 	aim_addtlvtochain_raw(&tl, 0x0001, strlen(sn), sn);
-	aim_addtlvtochain_raw(&tl, 0x0002, strlen(password), password_encoded);
+	aim_addtlvtochain_raw(&tl, 0x0002, passwdlen, password_encoded);
 
 	if (ci->clientstring)
 		aim_addtlvtochain_raw(&tl, 0x0003, strlen(ci->clientstring), ci->clientstring);