From 58a7bf46508b7f186704e7efb39576e09f0ab866 Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 1 May 2016 20:44:33 +0200 Subject: Fixed truncation of `@request` messages - The `@request` command still makes an inter-server call. This will be fixed at a later point. Signed-off-by: Haru --- src/map/intif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/map') diff --git a/src/map/intif.c b/src/map/intif.c index 346a847c8..2d6d39406 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -1035,11 +1035,11 @@ void intif_parse_WisToGM(int fd) mes_len = RFIFOW(fd,2) - 33; // Length not including the NUL terminator Assert_retv(mes_len > 0 && mes_len < 32000); - message = (mes_len >= 255 ? aMalloc(mes_len) : mbuf); + message = (mes_len >= 255 ? aMalloc(mes_len + 1) : mbuf); permission = RFIFOL(fd,28); safestrncpy(Wisp_name, RFIFOP(fd,4), NAME_LENGTH); - safestrncpy(message, RFIFOP(fd,32), mes_len); + safestrncpy(message, RFIFOP(fd,32), mes_len + 1); // information is sent to all online GM map->foreachpc(intif->pWisToGM_sub, permission, Wisp_name, message, mes_len); -- cgit v1.2.3-60-g2f50