From a4bb779a5bd7f95118eef519940b32b7c3c98a86 Mon Sep 17 00:00:00 2001 From: "Daniel R. Roe" Date: Thu, 13 Jun 2019 15:41:41 -0400 Subject: [PATCH 1/5] DRR - Cpptraj: Use actual format width instead of string width when determining if printf should be used or not. --- src/DataSet_string.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DataSet_string.cpp b/src/DataSet_string.cpp index a710279fbc..9269d22a05 100644 --- a/src/DataSet_string.cpp +++ b/src/DataSet_string.cpp @@ -38,7 +38,7 @@ void DataSet_string::WriteBuffer(CpptrajFile &cbuffer, SizeArray const& pIn) con cbuffer.Printf(format_.fmt(), "NoData"); else { // Protect against CpptrajFile buffer overflow. - if (Data_[pIn[0]].size() >= CpptrajFile::BUF_SIZE) { + if (format_.Width() >= (int)CpptrajFile::BUF_SIZE) { // FIXME: Data sets should not have to worry about spaces in format strings. if (format_.fmt()[0] == ' ') cbuffer.Printf(" "); cbuffer.Write(Data_[pIn[0]].c_str(), Data_[pIn[0]].size()); From f5933742104fe704e28c85f342d958d3cb750d23 Mon Sep 17 00:00:00 2001 From: "Daniel R. Roe" Date: Thu, 13 Jun 2019 15:46:10 -0400 Subject: [PATCH 2/5] DRR - Cpptraj: Revision bump for string dataset overflow fix. --- src/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Version.h b/src/Version.h index 0f298b530c..e324438b53 100644 --- a/src/Version.h +++ b/src/Version.h @@ -12,7 +12,7 @@ * Whenever a number that precedes is incremented, all subsequent * numbers should be reset to 0. */ -#define CPPTRAJ_INTERNAL_VERSION "V4.14.10" +#define CPPTRAJ_INTERNAL_VERSION "V4.14.11" /// PYTRAJ relies on this #define CPPTRAJ_VERSION_STRING CPPTRAJ_INTERNAL_VERSION #endif From e480732c5a0ed8fff93e9d98e9348b328ad55f0a Mon Sep 17 00:00:00 2001 From: "Daniel R. Roe" Date: Thu, 13 Jun 2019 16:45:07 -0400 Subject: [PATCH 3/5] DRR - Cpptraj: Make it clear that stfcdiffusion mask2 is needed for lower/upper. --- src/Action_STFC_Diffusion.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Action_STFC_Diffusion.cpp b/src/Action_STFC_Diffusion.cpp index 67aa64101e..54ab3309c4 100644 --- a/src/Action_STFC_Diffusion.cpp +++ b/src/Action_STFC_Diffusion.cpp @@ -19,7 +19,7 @@ Action_STFC_Diffusion::Action_STFC_Diffusion() : void Action_STFC_Diffusion::Help() const { mprintf("\tmask [out ] [time