psi-3.4.0-format-security.patch 1021 B

12345678910111213141516171819202122232425262728293031323334
  1. src/lib/libmints/matrix.cc | 12 +++++-------
  2. 1 file changed, 5 insertions(+), 7 deletions(-)
  3. diff --git a/src/lib/libmints/matrix.cc b/src/lib/libmints/matrix.cc
  4. index 2ce5ede..2c7b5de 100644
  5. --- a/src/lib/libmints/matrix.cc
  6. +++ b/src/lib/libmints/matrix.cc
  7. @@ -549,10 +549,9 @@ void Matrix::save(const char *filename, bool append, bool saveLowerTriangle, boo
  8. } else {
  9. out = fopen(filename, "w");
  10. }
  11. -
  12. - fprintf(out, name_.c_str());
  13. - fprintf(out, "\n");
  14. -
  15. +
  16. + fprintf(out, "%s\n", name_.c_str());
  17. +
  18. if (saveSubBlocks == false) {
  19. // Convert the matrix to a full matrix
  20. double **fullblock = to_block_matrix();
  21. @@ -1083,9 +1082,8 @@ void SimpleMatrix::save(const char *filename, bool append, bool saveLowerTriangl
  22. } else {
  23. out = fopen(filename, "w");
  24. }
  25. -
  26. - fprintf(out, name_.c_str());
  27. - fprintf(out, "\n");
  28. +
  29. + fprintf(out, "%s\n", name_.c_str());
  30. if (saveLowerTriangle) {
  31. // Count the number of non-zero element