diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-25 17:41:42 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-31 23:06:27 +0300 |
commit | a71a056abb8931aa4a11d0cde296fe9de68ee6df (patch) | |
tree | 0ebda387e185404e2670a0c6f81b38b2cd1dbc95 /src/map/clif.c | |
parent | db5fd3795cba3d30bb3d031719a272eec23cd586 (diff) | |
download | hercules-a71a056abb8931aa4a11d0cde296fe9de68ee6df.tar.gz hercules-a71a056abb8931aa4a11d0cde296fe9de68ee6df.tar.bz2 hercules-a71a056abb8931aa4a11d0cde296fe9de68ee6df.tar.xz hercules-a71a056abb8931aa4a11d0cde296fe9de68ee6df.zip |
Fix possible memory overflows and underflows.
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index d7b10f2f4..a1eb6662f 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -14495,8 +14495,8 @@ void clif_ranking_pk(struct map_session_data* sd) { WFIFOHEAD(fd,packet_len(0x238)); WFIFOW(fd,0) = 0x238; - for(i=0;i<10;i++){ - memcpy(WFIFOP(fd,i*24+2), "Unknown", NAME_LENGTH); + for (i = 0; i < 10;i ++) { + strncpy((char*)WFIFOP(fd, i * 24 + 2), "Unknown", NAME_LENGTH); WFIFOL(fd,i*4+242) = 0; } WFIFOSET(fd, packet_len(0x238)); |