1 Commits

Author SHA1 Message Date
Tim Biermann
8bc31c0745 Fix segfault in prt-cache
Co-authored-by: Alexandr Savca <alexandr.savca89@gmail.com>
2022-02-27 22:30:23 +01:00

View File

@@ -1806,6 +1806,11 @@ void PrtGet::ls()
if ( p ) {
string dirname = p->path() + "/" + p->name();
DIR* dir = opendir(dirname.c_str());
if (dir == NULL) {
cerr << "Directory " << dirname << " not found" << endl;
m_returnValue = PG_GENERAL_ERROR;
return;
}
struct dirent* entry;
vector<string> files;
while ((entry = readdir(dir))) {
@@ -1848,7 +1853,7 @@ void PrtGet::cat()
}
string file = p->path() + "/" + p->name() + "/" + fileName;
if (!printFile(file)) {
cerr << "File '" << *it << "' not found" << endl;
cerr << "File '" << fileName << "' not found" << endl;
m_returnValue = PG_GENERAL_ERROR;
return;
}