Pārlūkot izejas kodu

Added a check to login_sql against too long db-stored emails.
By the way, the length should most likely be 40+1, not 39+1 (underdimensioned)...

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10492 54d463be-8e91-2dee-dedb-b68131a5f0ec

ultramage 18 gadi atpakaļ
vecāks
revīzija
1b6605d798
2 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 1 0
      Changelog-Trunk.txt
  2. 1 1
      src/login_sql/login.c

+ 1 - 0
Changelog-Trunk.txt

@@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2007/05/07
+	* Added a check to login_sql against too long db-stored emails [ultramage]
 	* Removed an unused variable in script.c [Toms]
 	* Fixed Converters not overwriting each other [Playtester]
 	- thanks to scerez for the fix

+ 1 - 1
src/login_sql/login.c

@@ -809,7 +809,7 @@ int parse_fromchar(int fd)
 				if (sql_res) {
 					sql_row = mysql_fetch_row(sql_res);
 					connect_until_time = atol(sql_row[1]);
-					strcpy(email, sql_row[0]);
+					strncpy(email, sql_row[0], 40); email[39] = 0;
 					mysql_free_result(sql_res);
 				}
 				WFIFOW(fd,0) = 0x2713;