From b05c5948bc4ac52ff2baa7e4eaf5a979b4f7740e Mon Sep 17 00:00:00 2001 From: Lance Date: Tue, 6 Jun 2006 03:21:32 +0000 Subject: * [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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7001 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/guild.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/map/guild.c b/src/map/guild.c index 5364fb8bd..80d1e2fde 100644 --- a/src/map/guild.c +++ b/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); -- cgit v1.2.3-70-g09d2