[AMBER-Developers] bug in transformWatershell/actions.c (AmberTools 1.3)

From: Hannes Loeffler <Hannes.Loeffler.stfc.ac.uk>
Date: Tue, 23 Feb 2010 09:45:32 +0000

Hi,

I'm afraid I have another one, this time in transformWatershell of
actions.c. Again, I found this one with PSF/DCD input. The
problematic lines are

    buffer = getArgumentString(argumentStackPointer, NULL);
    if (buffer != NULL)
      info->solventMask = processAtomMask(buffer, action->state);
    else
      info->solventMask = processAtomMask(":WAT", action->state);
    safe_free(buffer);

The problem is obviously that if no solvent mask is given by the user
the code assumes :WAT residues by default. I have :TIP3 in my PSF
file which will lead to an unallocated info->solventMask and a segfault
later in the code. I think the better solution would be

    buffer = getArgumentString(argumentStackPointer, NULL);
    if (buffer != NULL)
      info->solventMask = processAtomMask(buffer, action->state);
    else
      info->solventMask = state->solventMask;
    safe_free(buffer);

In any case, the code should check if info->solventMask actually points
somewhere.


Cheers,
Hannes.

_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Tue Feb 23 2010 - 02:00:03 PST
Custom Search