From d1737a1713da27f825682fff0e9838b559ea81a3 Mon Sep 17 00:00:00 2001 From: Torgny Nyblom Date: Wed, 29 Sep 2010 19:45:20 +0200 Subject: Die when a rule file contains an invalid regexp --- src/ruleparser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ruleparser.cpp b/src/ruleparser.cpp index 5927c5a..1744969 100644 --- a/src/ruleparser.cpp +++ b/src/ruleparser.cpp @@ -193,6 +193,10 @@ void Rules::load() state = ReadingMatch; match = Match(); match.rx = QRegExp(matchLine.cap(1), Qt::CaseSensitive, QRegExp::RegExp2); + if( !match.rx.isValid() ) + qFatal("Malformed regular expression '%s' in file:'%s':%d, Error: %s", + qPrintable(matchLine.cap(1)), qPrintable(filename), lineNumber, + qPrintable(match.rx.errorString())); match.lineNumber = lineNumber; match.filename = filename; } else if (isVariableRule) { -- cgit v1.2.1