From e2ada0e1ead2006dddded48883723d9c3f77326c Mon Sep 17 00:00:00 2001 From: Paradox924X Date: Tue, 7 Sep 2010 22:43:18 +0000 Subject: [PATCH] Ensure a pointer is valid within map_readfromcache() before attempting to access its members. git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14401 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 2 ++ src/map/map.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 1d758875b5..c4fb28d312 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -3,6 +3,8 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. +2010/09/07 + * Ensure a pointer is valid within map_readfromcache() before attempting to access its members. [Paradox924X] 2010/09/06 * Rev. 14400 Implemented Icescope's fix for devotion, reflect damage is no longer absorbed by the devoter. (bugreport:3189) [L0ne_W0lf] * As a folow up to r14301, increased MAX_REG_NUM to 256, to prevent possible data loss. diff --git a/src/map/map.c b/src/map/map.c index 790c1515ad..27d7e01d83 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -2719,7 +2719,7 @@ int map_readfromcache(struct map_data *m, char *buffer, char *decode_buffer) p += sizeof(struct map_cache_map_info) + info->len; } - if( i < header->map_count ) { + if( info && i < header->map_count ) { unsigned long size, xy; if( info->xs <= 0 || info->ys <= 0 )