summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-05-06 13:44:35 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-05-06 13:44:35 +0000
commitc2da6e2ec4fe64e664d9a3a696a86ff866dabc8a (patch)
tree7db43cbd252b0ed7c9cdec6f4e9d7877a95fdfab
parent60e14b0a38301d0013a795c1459e5573ee7d49dc (diff)
downloadhercules-c2da6e2ec4fe64e664d9a3a696a86ff866dabc8a.tar.gz
hercules-c2da6e2ec4fe64e664d9a3a696a86ff866dabc8a.tar.bz2
hercules-c2da6e2ec4fe64e664d9a3a696a86ff866dabc8a.tar.xz
hercules-c2da6e2ec4fe64e664d9a3a696a86ff866dabc8a.zip
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10492 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt1
-rw-r--r--src/login_sql/login.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index dcdcfa21d..80ed3abc8 100644
--- a/Changelog-Trunk.txt
+++ b/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
diff --git a/src/login_sql/login.c b/src/login_sql/login.c
index 4b3c4c4a2..5929e9748 100644
--- a/src/login_sql/login.c
+++ b/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;