summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-21 02:39:32 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-21 02:39:32 +0000
commita53971a734a55c1ceebb47bb5bb03611d7e569c5 (patch)
treeb0ae23c7bf45214b9e562067390924b8e954168a /src/map/clif.c
parent673424a0cc951fde76c498836172042f036ccc2a (diff)
downloadhercules-a53971a734a55c1ceebb47bb5bb03611d7e569c5.tar.gz
hercules-a53971a734a55c1ceebb47bb5bb03611d7e569c5.tar.bz2
hercules-a53971a734a55c1ceebb47bb5bb03611d7e569c5.tar.xz
hercules-a53971a734a55c1ceebb47bb5bb03611d7e569c5.zip
And again
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6672 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index eba0229ed..811f3bde0 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9806,11 +9806,13 @@ void clif_parse_NpcStringInput(int fd,struct map_session_data *sd)
if(message_len >= sizeof(sd->npc_str)){
ShowWarning("clif: input string too long !\n");
message_len = sizeof(sd->npc_str);
+ } else {
+ message_len += 1; // Null character
}
// Exploit prevention if crafted packets (without null) is being sent. [Lance]
memcpy(sd->npc_str,RFIFOP(fd,8),message_len);
- sd->npc_str[message_len]=0;
+ sd->npc_str[message_len-1]=0;
npc_scriptcont(sd,RFIFOL(fd,4));
}