From 4ba8a054266c78e6ec4edc5b70d5b42ce2bee344 Mon Sep 17 00:00:00 2001 From: Dennis Friis Date: Thu, 10 Apr 2008 17:18:21 +0000 Subject: Proper fix for rev 17 --- src/map/intif.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/map/intif.c') diff --git a/src/map/intif.c b/src/map/intif.c index ace0187..3790d3b 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -585,7 +585,11 @@ int mapif_parse_WisToGM(int fd) { // 0x3003/0x3803 .w .24B struct map_session_data *pl_sd; char Wisp_name[24]; char mbuf[255]; - char *message = ((RFIFOW(fd,2) - 30) >= sizeof(mbuf)) ? (char *) malloc((RFIFOW(fd,2) - 30)) : mbuf; + + if (RFIFOW(fd,2)-30 <= 0) + return 0; + + char *message = ((RFIFOW(fd,2) - 30) >= 255) ? (char *) malloc((RFIFOW(fd,2) - 30)) : mbuf; min_gm_level = (int)RFIFOW(fd,28); memcpy(Wisp_name, RFIFOP(fd,4), 24); -- cgit v1.2.3-60-g2f50