summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-08-24 02:43:20 +0300
committerAndrei Karas <akaras@inbox.ru>2018-08-24 02:43:20 +0300
commitbfdbfaadddf66d2eaa7b21cc5d7568aab1f3fc56 (patch)
tree72e72fb1f38f4cfd6b6a1ee187c19b3a3420ffc4
parent49a106f6d4c605005ff411a5377285a8abcf51b5 (diff)
downloadhercules-bfdbfaadddf66d2eaa7b21cc5d7568aab1f3fc56.tar.gz
hercules-bfdbfaadddf66d2eaa7b21cc5d7568aab1f3fc56.tar.bz2
hercules-bfdbfaadddf66d2eaa7b21cc5d7568aab1f3fc56.tar.xz
hercules-bfdbfaadddf66d2eaa7b21cc5d7568aab1f3fc56.zip
Fix out of bound access in clif_guild_belonginfo.
-rw-r--r--src/map/clif.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 71ae22ec3..fd8a3c783 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7629,12 +7629,13 @@ static void clif_guild_created(struct map_session_data *sd, int flag)
/// mode: @see enum guild_permission
static void clif_guild_belonginfo(struct map_session_data *sd, struct guild *g)
{
- int ps,fd;
nullpo_retv(sd);
nullpo_retv(g);
- fd=sd->fd;
- ps=guild->getposition(g,sd);
+ int fd = sd->fd;
+ int ps = guild->getposition(g, sd);
+ Assert_retv(ps != -1);
+
WFIFOHEAD(fd,packet_len(0x16c));
WFIFOW(fd,0)=0x16c;
WFIFOL(fd,2)=g->guild_id;