File 16_format-security.patch of Package mpqc
Index: mpqc-2.3.1/src/lib/chemistry/molecule/atominfo.cc
===================================================================
--- mpqc-2.3.1.orig/src/lib/chemistry/molecule/atominfo.cc
+++ mpqc-2.3.1/src/lib/chemistry/molecule/atominfo.cc
@@ -493,7 +493,7 @@ AtomInfo::string_to_Z(const std::string
if (iname != symbol_to_Z_.end()) return iname->second;
if (allow_exceptions) {
- ExEnv::err0() << sprintf("AtomInfo: invalid name: %s\n",name.c_str());
+ ExEnv::err0() << ("AtomInfo: invalid name: " + name + "\n").c_str();
throw std::runtime_error("invalid atom name");
}