Bladeren bron

Fix a crash in char_sql/char.c

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@983 54d463be-8e91-2dee-dedb-b68131a5f0ec
amber 20 jaren geleden
bovenliggende
commit
55c44e3eb1
2 gewijzigde bestanden met toevoegingen van 6 en 1 verwijderingen
  1. 3 1
      Changelog.txt
  2. 3 0
      src/char_sql/char.c

+ 3 - 1
Changelog.txt

@@ -1,6 +1,8 @@
 Date	Added
 
-01/24 
+01/24
+        * Fixed a crash in char_sql/char.c where people were selecting
+          chars before requesting connections [SVN 983] [MouseJstr]
         * some G++ compile tweaks and got through several files in the
         map server - [SVN 976]   [MouseJstr]
 

+ 3 - 0
src/char_sql/char.c

@@ -2417,6 +2417,9 @@ int parse_char(int fd) {
 			if (RFIFOREST(fd) < 3)
 				return 0;
 
+                        if (sd == NULL)
+                          return 0;
+
 			sprintf(tmp_sql, "SELECT `char_id` FROM `%s` WHERE `account_id`='%d' AND `char_num`='%d'",char_db, sd->account_id, RFIFOB(fd, 2));
 			if (mysql_query(&mysql_handle, tmp_sql)) {
 				printf("DB server Error - %s\n", mysql_error(&mysql_handle));