From 27425e62c071441fa8ef34775b6ad7d985e07fde Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 18 May 2016 08:50:53 +0200 Subject: Moc: fix crash when a file ends with \\\r MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Robert Loehning --- tests/auto/tools/moc/backslash-newlines.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/auto/tools/moc/backslash-newlines.h') 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 -- cgit v1.2.3