aboutsummaryrefslogtreecommitdiff
path: root/src/SetupGroup.c
diff options
context:
space:
mode:
authorschnetter <schnetter@b61c5cb5-eaca-4651-9a7a-d64986f99364>2005-09-26 00:26:12 +0000
committerschnetter <schnetter@b61c5cb5-eaca-4651-9a7a-d64986f99364>2005-09-26 00:26:12 +0000
commite7a3e95d815446986410cf338fea46503f1a7100 (patch)
tree831549520337bd5213f93a228d1b7151e12afb1d /src/SetupGroup.c
parentdecfbe2af929ab8ad92ae337f83880dfe95d9875 (diff)
Insert several checks whether variable indices passed into routines
are legal, and whether malloc returned a null pointer. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@468 b61c5cb5-eaca-4651-9a7a-d64986f99364
Diffstat (limited to 'src/SetupGroup.c')
-rw-r--r--src/SetupGroup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/SetupGroup.c b/src/SetupGroup.c
index 8fdca77..7a93391 100644
--- a/src/SetupGroup.c
+++ b/src/SetupGroup.c
@@ -174,7 +174,7 @@ static int PUGH_SetupGAGroup (pGH *newGH,
/* Set up the communication buffer used for all variables within this group.
Note: only with allocated buffers we can have group communication. */
groupcomm = NULL;
- if(newGH->commmodel == PUGH_ALLOCATEDBUFFERS)
+ if(n_variables > 0 && newGH->commmodel == PUGH_ALLOCATEDBUFFERS)
{
groupcomm = PUGH_SetupGArrayGroupComm (newGH,
dim,
@@ -213,7 +213,7 @@ static int PUGH_SetupGAGroup (pGH *newGH,
staggercode,
vectorlength,
variable%vectorlength,
- variable%vectorlength > 0 ? newGH->variables[newGH->nvariables-variable%vectorlength][level] : NULL);
+ variable%vectorlength > 0 ? newGH->variables[newGH->nvariables - variable%vectorlength][level] : NULL);
newGH->narrays++;
}
newGH->nvariables++;