summaryrefslogtreecommitdiff
path: root/src/map/mapreg_sql.c
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-22 12:11:15 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-22 12:11:15 +0000
commit8e24391458a6584315c33a3a8423358d9f65785f (patch)
treef8aac89ca03cd1edb9d4c21db9b76cac3b70d9d9 /src/map/mapreg_sql.c
parent537296dd156e22592606eedf539395288855639b (diff)
downloadhercules-8e24391458a6584315c33a3a8423358d9f65785f.tar.gz
hercules-8e24391458a6584315c33a3a8423358d9f65785f.tar.bz2
hercules-8e24391458a6584315c33a3a8423358d9f65785f.tar.xz
hercules-8e24391458a6584315c33a3a8423358d9f65785f.zip
* Fixed sql mapreg loading code specifying output buffer size for SqlStmt_BindColumn without zero-terminator, leading to truncations of variable names and/or their values when using the maximum length (bugreport:1939, since r11245).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14614 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mapreg_sql.c')
-rw-r--r--src/map/mapreg_sql.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/mapreg_sql.c b/src/map/mapreg_sql.c
index 287aae4f9..f80be56a2 100644
--- a/src/map/mapreg_sql.c
+++ b/src/map/mapreg_sql.c
@@ -122,9 +122,9 @@ static void script_load_mapreg(void)
return;
}
- SqlStmt_BindColumn(stmt, 0, SQLDT_STRING, &varname[0], 32, &length, NULL);
+ SqlStmt_BindColumn(stmt, 0, SQLDT_STRING, &varname[0], sizeof(varname), &length, NULL);
SqlStmt_BindColumn(stmt, 1, SQLDT_INT, &index, 0, NULL, NULL);
- SqlStmt_BindColumn(stmt, 2, SQLDT_STRING, &value[0], 255, NULL, NULL);
+ SqlStmt_BindColumn(stmt, 2, SQLDT_STRING, &value[0], sizeof(value), NULL, NULL);
while ( SQL_SUCCESS == SqlStmt_NextRow(stmt) )
{