cd $AMBERHOME patch -p0 -N < patch Author: Daniel R. Roe Date: 2010-07-26 Description: Fixes two bugs in clustering code: 1) If no atoms are selected in RMS mask resulting NULL mask, segfault would occur or 2) Pointer was being compared like an integer; the check would result in no initialization and a segfault. ----------------------------------------------------------------------------- --- AmberTools/src/ptraj/actions.c 2010-07-26 09:30:41.462276836 -0400 +++ AmberTools/src/ptraj/actions.c 2010-07-26 09:31:36.767408649 -0400 @@ -3655,6 +3655,8 @@ { action->mask = processAtomMask("*", action->state); } + if (action->mask==NULL) + return INVALID_ARGUMENTS_RETURN_CODE; /* Create a new "substate" trajInfo->state containing only some atoms: */ modifyStateByMask(&trajInfo->state, &action->state, action->mask, 0); trajInfo->atoms = trajInfo->state->atoms; --- AmberTools/src/ptraj/cluster.c 2010-07-26 22:48:49.998157908 -0400 +++ AmberTools/src/ptraj/cluster.c 2010-07-26 22:51:04.023535647 -0400 @@ -4041,7 +4041,7 @@ OutputTrajInfo = (trajectoryInfo*)action->carg2; } - if (!FirstOutputFlag) + if (FirstOutputFlag==NULL) { FirstOutputFlag = (int*)SafeMalloc(__FILE__, __LINE__, sizeof(int) * This->ClusterCount); memset(FirstOutputFlag, 1, sizeof(int) * This->ClusterCount);