From 1fd6b5a12f7be681486d7ff1af73660bc01f4b04 Mon Sep 17 00:00:00 2001 From: tradke Date: Tue, 24 May 2005 17:13:18 +0000 Subject: Check for NULL pointer passed as output array in CCTK_Reduce(). This closes PR CactusPUGH/1934: "CCTK_Reduce does not produce an error message, but segfaults". git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHReduce/trunk@66 d60812e6-3970-4df4-986e-c251b06effeb --- src/Reduction.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Reduction.c b/src/Reduction.c index 7106dea..0ea8998 100644 --- a/src/Reduction.c +++ b/src/Reduction.c @@ -276,6 +276,12 @@ int PUGH_ReductionGVs (const cGH *GH, return (-1); } + if (outvals == NULL) + { + CCTK_WARN (1, "PUGH_ReductionGVs: NULL pointer passed for output array"); + return (-1); + } + outtypesize = CCTK_VarTypeSize (outtype); if (outtypesize <= 0) { -- cgit v1.2.3