From 175e31101d3e0ff0fb164e94e35fd405a9d7aa95 Mon Sep 17 00:00:00 2001 From: Wiarda <wiardada@ornl.gov> Date: Wed, 23 Feb 2022 10:33:50 -0500 Subject: [PATCH] Avoid an overstepped bound in samint input --- sammy/src/samint/samint.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sammy/src/samint/samint.cpp b/sammy/src/samint/samint.cpp index fa5e2b75c..e7804c343 100644 --- a/sammy/src/samint/samint.cpp +++ b/sammy/src/samint/samint.cpp @@ -162,7 +162,8 @@ void userInput () { vector<string> asFirstInputLine = split(sCorr); if (asFirstInputLine[0] == "mid2bin") { vector<const char*> sInpFile (asFirstInputLine.size()+1); - for (unsigned int i = 0; i < sInpFile.size(); i++) { + sInpFile[0] = nullptr; + for (unsigned int i = 0; i < asFirstInputLine.size(); i++) { sInpFile[i+1] = asFirstInputLine[i].c_str(); } mid2bin(int(sInpFile.size()),&sInpFile[0]); -- GitLab