[AMBER-Developers] bugs in ptraj/transformSecondaryStruct and transformWatershell

From: Hannes Loeffler <Hannes.Loeffler.stfc.ac.uk>
Date: Mon, 14 Mar 2011 15:44:20 +0000

Hi,

I think there's a bug in the function transformSecondaryStruct (I have
AmberTools 1.4 with bug fixes up to #16 here). In PTRAJ_PRINT mode
structInfo->filename is concatenated with a file suffix but as far as I
can tell from the code structInfo->filename may not be big enough and
strcat will happily overwrite subsequent memory.

    /*
     * ACTION: PTRAJ_PRINT
     */

    structInfo = (transformSecondaryStructInfo *) action->carg1;
    if (structInfo->filename != NULL)
      outFile = safe_fopen(strcat(structInfo->filename, ".sum"), "w");
    else
      outFile = stdout;


There is still a problem in transformWatershell (I have reported that a
while back). The function assumes that :WAT should be used as
the default water residue. This will fail with a segmentation fault if
no such residue exists (I tried this with a PSF file).

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


Cheers,
Hannes.

_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Mon Mar 14 2011 - 09:00:02 PDT
Custom Search