From af055964f57dfccc76663bbf8e96b90d0fee984c Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 19 Jul 2016 12:48:10 +0200 Subject: moc: fix infinite loop over malformed input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We should not call prev() if we had already reched the end. Task-number: QTBUG-54815 Change-Id: I56bc86880a0dbfdce57fc4a08e5950f2ff3a5958 Reviewed-by: Jędrzej Nowacki --- tests/auto/tools/moc/tst_moc.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/auto/tools/moc/tst_moc.cpp') diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 9d2b883112..7f73e8f23d 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -1942,6 +1942,13 @@ void tst_Moc::warnings_data() << 1 << QString("IGNORE_ALL_STDOUT") << QString(":-1: Error: Unexpected character in macro argument list."); + + QTest::newRow("QTBUG-54815: Crash on invalid input") + << QByteArray("class M{(})F<{}d000000000000000#0") + << QStringList() + << 0 + << QString() + << QString("standard input:1: Note: No relevant classes found. No output generated."); } void tst_Moc::warnings() -- cgit v1.2.3