summaryrefslogtreecommitdiffstats
path: root/tools/linguist
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-04-14 13:31:07 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-04-15 18:38:59 (GMT)
commit287d5e7b349dac0cfdb74e9747752fcadc432064 (patch)
tree24193363072e9396c873f90fb4ebefcdb8239737 /tools/linguist
parent443f9389f65b05699a10449afc774da3e816f3d1 (diff)
downloadQt-287d5e7b349dac0cfdb74e9747752fcadc432064.zip
Qt-287d5e7b349dac0cfdb74e9747752fcadc432064.tar.gz
Qt-287d5e7b349dac0cfdb74e9747752fcadc432064.tar.bz2
protect against circular inclusion of pro/pri files
Task-number: 250574
Diffstat (limited to 'tools/linguist')
-rw-r--r--tools/linguist/shared/profileevaluator.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/linguist/shared/profileevaluator.cpp b/tools/linguist/shared/profileevaluator.cpp
index 98929c0..5440752 100644
--- a/tools/linguist/shared/profileevaluator.cpp
+++ b/tools/linguist/shared/profileevaluator.cpp
@@ -1476,7 +1476,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;