summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2016-05-18 08:50:53 +0200
committerOlivier Goffart (Woboq GmbH) <ogoffart@woboq.com>2016-05-18 10:34:13 +0000
commit27425e62c071441fa8ef34775b6ad7d985e07fde (patch)
treed2753c99ab8d200811637c54e2d1bb597bd2f0a2 /tests
parent4251509c2d7af3ae691350b4bae7fcbd7773d8c6 (diff)
Moc: fix crash when a file ends with \\\r
make the 'cleaned' more robust by making sure we do not read past the buffer in some cases. We must also use resize and not reserve on the outpt buffer because reseve is meant as a hint and we are not supposed to write past the size of the QByteArray even if it is reserved. [ChangeLog][moc] Fixed crash on file ending with \\\r Task-number: QTBUG-53441 Change-Id: I901e6c0ffc7f8877de3d07fd08cf26495461d294 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/tools/moc/backslash-newlines.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/backslash-newlines.h b/tests/auto/tools/moc/backslash-newlines.h
index fea3045eb1..764d8f87da 100644
--- a/tests/auto/tools/moc/backslash-newlines.h
+++ b/tests/auto/tools/moc/backslash-newlines.h
@@ -57,3 +57,5 @@ public slots:
#undef value
#endif // BACKSLASH_NEWLINES_H
+
+// ends with \\\r should not make moc crash (QTBUG-53441) (no new lines on purpose!!) \ \ No newline at end of file