summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/package.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-07-12 16:01:25 +0200
committerAdam Borowski <kilobyte@angband.pl>2012-07-12 16:01:25 +0200
commit94c716ceb046b665cce64a410ac4d4a325382ecb (patch)
tree8352eb7fe0e27189fb1899fad0fa0ec2b179d62f /crawl-ref/source/package.cc
parentf2adc98f1a78412291467f36e692f571171c1491 (diff)
downloadcrawl-ref-94c716ceb046b665cce64a410ac4d4a325382ecb.tar.gz
crawl-ref-94c716ceb046b665cce64a410ac4d4a325382ecb.zip
Check if some code tries to read from a save into (void*)0
This way, we can tell save corruption from reader corruption.
Diffstat (limited to 'crawl-ref/source/package.cc')
-rw-r--r--crawl-ref/source/package.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/crawl-ref/source/package.cc b/crawl-ref/source/package.cc
index c999abcbcd..b39e8402b4 100644
--- a/crawl-ref/source/package.cc
+++ b/crawl-ref/source/package.cc
@@ -778,6 +778,7 @@ void chunk_writer::finish_block(len_t next)
void chunk_writer::write(const void *data, len_t len)
{
+ ASSERT(data);
ASSERT(!pkg->aborted);
#ifdef USE_ZLIB
@@ -898,6 +899,7 @@ len_t chunk_reader::raw_read(void *data, len_t len)
len_t chunk_reader::read(void *data, len_t len)
{
+ ASSERT(data);
if (pkg->aborted)
return 0;