From b826bc2c54dbe6a2ad0f204f36f82bf116d8e663 Mon Sep 17 00:00:00 2001 From: ultramage Date: Sat, 22 Sep 2007 11:02:26 +0000 Subject: * Added 'safestrnlen' to prevent null pointer crashes * Fixed global chat logging always crashing on a null pointer * Applied changes to clif_parse_globalmessage() from my WiP code - clearer processing of the individual packet components - proper code ordering, some more integrity checks - fixes to some poorly chosen ShowWarning() format strings - global chat logging no longer logs the entire string (w/ player name) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11271 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/char_sql/int_guild.c | 2 +- src/char_sql/int_party.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/char_sql') diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c index f33f58097..663cb4b6b 100644 --- a/src/char_sql/int_guild.c +++ b/src/char_sql/int_guild.c @@ -829,7 +829,7 @@ int search_guildname(char *str) int guild_id; char esc_name[NAME_LENGTH*2+1]; - Sql_EscapeStringLen(sql_handle, esc_name, str, strnlen(str, NAME_LENGTH)); + Sql_EscapeStringLen(sql_handle, esc_name, str, safestrnlen(str, NAME_LENGTH)); //Lookup guilds with the same name if( SQL_ERROR == Sql_Query(sql_handle, "SELECT guild_id FROM `%s` WHERE name='%s'", guild_db, esc_name) ) { diff --git a/src/char_sql/int_party.c b/src/char_sql/int_party.c index f6d783b3b..fd1f0c37c 100644 --- a/src/char_sql/int_party.c +++ b/src/char_sql/int_party.c @@ -299,7 +299,7 @@ struct party_data* search_partyname(char* str) char* data; struct party_data* p = NULL; - Sql_EscapeStringLen(sql_handle, esc_name, str, strnlen(str, NAME_LENGTH)); + Sql_EscapeStringLen(sql_handle, esc_name, str, safestrnlen(str, NAME_LENGTH)); if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `party_id` FROM `%s` WHERE `name`='%s'", party_db, esc_name) ) Sql_ShowDebug(sql_handle); else if( SQL_SUCCESS == Sql_NextRow(sql_handle) ) -- cgit v1.2.3-70-g09d2