Преглед на файлове

* [Fixed]:
- Allocation of event_list in guild_npc_request_info to aCalloc so memcpy(ev->name,event,strlen(event)) will have a null terminator.

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

Lance преди 19 години
родител
ревизия
1a63e4205f
променени са 2 файла, в които са добавени 6 реда и са изтрити 2 реда
  1. 4 0
      Changelog-Trunk.txt
  2. 2 2
      src/map/guild.c

+ 4 - 0
Changelog-Trunk.txt

@@ -3,6 +3,10 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
+2006/06/06
+	* [Fixed]:
+	  - Allocation of event_list in guild_npc_request_info to aCalloc so 
+	    memcpy(ev->name,event,strlen(event)) will have a null terminator. [Lance]
 2006/06/05
 	* Fixed a crash when using SL_SMA and the "combo" ain't ready. [Skotlex]
 	* Hopefully fixed changing a mob's class causing them to get all sort of

+ 2 - 2
src/map/guild.c

@@ -482,8 +482,8 @@ int guild_npc_request_info(int guild_id,const char *event)
 	if(event==NULL || *event==0)
 		return guild_request_info(guild_id);
 
-	ev=(struct eventlist *)aMalloc(sizeof(struct eventlist));
-	memcpy(ev->name,event,strlen(event));
+	ev=(struct eventlist *)aCalloc(sizeof(struct eventlist));
+	memcpy(ev->name,event,strlen(event) + 1);
 	//The one in the db becomes the next event from this.
 	ev->next=idb_put(guild_infoevent_db,guild_id,ev);
 	return guild_request_info(guild_id);