[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: Review Request 114519: fix endless loop in KLineEdit->setSqueezedText()
From: "David Faure" <faure () kde ! org>
Date: 2013-12-18 16:36:15
Message-ID: 20131218163615.23190.76178 () vidsolbach ! de
[Download RAW message or body]
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/114519/#review45900
-----------------------------------------------------------
kdeui/widgets/klineedit.cpp
<http://git.reviewboard.kde.org/r/114519/#comment32753>
This could even be fullLength/2 given that the code uses left(letters) and \
right(letters). After half, we'll get redundant characters.
- David Faure
On Dec. 17, 2013, 3:15 p.m., Axel Arnold wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/114519/
> -----------------------------------------------------------
>
> (Updated Dec. 17, 2013, 3:15 p.m.)
>
>
> Review request for kdelibs.
>
>
> Bugs: 328263
> http://bugs.kde.org/show_bug.cgi?id=328263
>
>
> Repository: kdelibs
>
>
> Description
> -------
>
> If KLineEdit has squeezed text enabled, but the widget has still zero width, \
> KLineEdit::setSqueezedText() can go into an endless loop trying to remove more than \
> all letters from the string. This patch fixes both this underrun and the \
> corresponding possible overrun if the squeezed text is too small. The underrun is \
> responsible for endless loops in digikam, see the corresponding bug report.
>
> Diffs
> -----
>
> kdeui/widgets/klineedit.cpp 2193ef2969d49ad602e66da7776feda4b7595b13
>
> Diff: http://git.reviewboard.kde.org/r/114519/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Axel Arnold
>
>
[Attachment #3 (text/html)]
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;"> <tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/114519/">http://git.reviewboard.kde.org/r/114519/</a>
</td>
</tr>
</table>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="http://git.reviewboard.kde.org/r/114519/diff/1/?file=225955#file225955line615" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kdeui/widgets/klineedit.cpp</a> <span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void \
KLineEdit::setSqueezedText()</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">614</font></th> <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="p">}</span> <span class="k">while</span> <span class="p">(</span><span \
class="n">squeezedWidth</span> <span class="o"><</span> <span \
class="n">labelWidth</span><span class="p">);</span></pre></td> <th \
bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">615</font></th> <td bgcolor="#fdfebc" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> \
<span class="p">}</span> <span class="k">while</span> <span class="p">(</span><span \
class="n">squeezedWidth</span> <span class="o"><</span> <span \
class="n">labelWidth</span><span class="hl"> </span><span class="o"><span \
class="hl">&&</span></span><span class="hl"> </span><span class="n"><span \
class="hl">letters</span></span><span class="hl"> </span><span class="o"><span \
class="hl"><</span></span><span class="hl"> </span><span class="n"><span \
class="hl">fullLength</span></span><span class="p">);</span></pre></td> </tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This could \
even be fullLength/2 given that the code uses left(letters) and right(letters). After \
half, we'll get redundant characters.</pre> </div>
<br />
<p>- David Faure</p>
<br />
<p>On December 17th, 2013, 3:15 p.m. UTC, Axel Arnold wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;"> <tr>
<td>
<div>Review request for kdelibs.</div>
<div>By Axel Arnold.</div>
<p style="color: grey;"><i>Updated Dec. 17, 2013, 3:15 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="http://bugs.kde.org/show_bug.cgi?id=328263">328263</a>
</div>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kdelibs
</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;">If KLineEdit has squeezed text enabled, but the widget has still zero \
width, KLineEdit::setSqueezedText() can go into an endless loop trying to remove more \
than all letters from the string. This patch fixes both this underrun and the \
corresponding possible overrun if the squeezed text is too small. The underrun is \
responsible for endless loops in digikam, see the corresponding bug report. </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>kdeui/widgets/klineedit.cpp <span style="color: \
grey">(2193ef2969d49ad602e66da7776feda4b7595b13)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/114519/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic