Skip to content

Commit 74d9d28

Browse files
author
frostmoss
committed
Refactor: replace fixed-size char array with std::string to prevent buffer overflow in input.cpp
1 parent 2f59a6f commit 74d9d28

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • source/source_pw/module_ofdft/ml_tools

source/source_pw/module_ofdft/ml_tools/input.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "./input.h"
2-
2+
#include <string>
33
void Input::readInput()
44
{
55
std::ifstream ifs("nnINPUT", std::ios::in);
@@ -9,7 +9,7 @@ void Input::readInput()
99
exit(0);
1010
}
1111

12-
char word[80];
12+
std::string word;
1313
int ierr = 0;
1414

1515
ifs.rdstate();

0 commit comments

Comments
 (0)