From 16cf082eb78ed3bd7da621b750a6ac937801a960 Mon Sep 17 00:00:00 2001 From: tradke Date: Tue, 10 May 2005 15:37:58 +0000 Subject: Fix out-of-bounds array access for extent vector in Hyperslab_GlobalMappingByIndex(). This closes PR CactusBase/1926: "IOASCII uses uninitialised values for hyperslabbing". git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHSlab/trunk@137 10716dce-81a3-4424-a2c8-48026a0d3035 --- src/Mapping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mapping.c b/src/Mapping.c index 96b8846..d0ebc42 100644 --- a/src/Mapping.c +++ b/src/Mapping.c @@ -368,7 +368,7 @@ static CCTK_INT DefineMapping (const cGH *GH, real_extent = malloc (vinfo.dim * sizeof (CCTK_INT)); for (vdim = dim = 0; vdim < vinfo.dim; vdim++) { - real_extent[vdim] = extent[vdim]; + real_extent[vdim] = vdim < hdim ? extent[vdim] : -1; if (real_extent[vdim] < 0) { real_extent[vdim] = extras->nsize[vdim]; -- cgit v1.2.3