protect against circular inclusion of pro/pri files

Task-number: 250574
This commit is contained in:
Oswald Buddenhagen
2009-04-14 15:31:07 +02:00
parent 99fccb6d37
commit 870a3b3903

View File

@@ -2024,7 +2024,13 @@ ProFile *ProFileEvaluator::parsedProFile(const QString &fileName)
{
QFileInfo fi(fileName);
if (fi.exists()) {
ProFile *pro = new ProFile(fi.absoluteFilePath());
QString fn = QDir::cleanPath(fi.absoluteFilePath());
foreach (const ProFile *pf, d->m_profileStack)
if (pf->fileName() == fn) {
errorMessage(d->format("circular inclusion of %1").arg(fn));
return 0;
}
ProFile *pro = new ProFile(fn);
if (d->read(pro))
return pro;
delete pro;