<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/127786/">https://git.reviewboard.kde.org/r/127786/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On april 29th, 2016, 10:56 a.m. UTC, <b>David Faure</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This is not about trust and attacks, this is about not allocating 4 GB of RAM when reading a corrupted binary file.</p></pre>
</blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">That will only happen if the file or stream is 4 GB. <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">QDataStream &operator>>(QDataStream &in, QString &str)</code> allocates while reading in 1 MiB chunks.</p></pre>
<br />
<p>- Jos</p>
<br />
<p>On april 29th, 2016, 10:22 a.m. UTC, Jos van den Oever wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
<div>Review request for KDE Frameworks, David Faure and Milian Wolff.</div>
<div>By Jos van den Oever.</div>
<p style="color: grey;"><i>Updated apr 29, 2016, 10:22 a.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kservice
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Writing KBuildSycoca is done with <<. Up till now there were special 'safe' functions for reading QString and QStringList. They only limited the size of QString and the number of allowed entries in QStringList. The cache file is created by the trusted system. If file size is an attack vector, these safe functions are useful and we should keep them.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This patch is three commits:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">1) Use the standard read function for reading QStringList</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">2) Use the standard read function for reading QString</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">3) Remove redundant #include</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%">ksycocaentry.h is included via kservice.h
</pre></div>
</p></pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">All tests still pass.</p></pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>src/CMakeLists.txt <span style="color: grey">(f4d09d5)</span></li>
<li>src/services/kservicegroup.h <span style="color: grey">(c046314)</span></li>
<li>src/services/kservicetypefactory.cpp <span style="color: grey">(2edc57c)</span></li>
<li>src/sycoca/kctimefactory.cpp <span style="color: grey">(a8c7846)</span></li>
<li>src/sycoca/ksycoca.cpp <span style="color: grey">(5d43ef4)</span></li>
<li>src/sycoca/ksycoca_p.h <span style="color: grey">(119c3ee)</span></li>
<li>src/sycoca/ksycocaentry.cpp <span style="color: grey">(5fbd158)</span></li>
<li>src/sycoca/ksycocautils.cpp <span style="color: grey">(84998b7)</span></li>
<li>src/sycoca/ksycocautils_p.h <span style="color: grey">(aad9d50)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/127786/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>