[prev in list] [next in list] [prev in thread] [next in thread]
List: kwrite-devel
Subject: Re: Protect against negative size
From: Hamish Rodda <rodda () kde ! org>
Date: 2007-12-10 2:21:14
Message-ID: 200712101321.16622.rodda () kde ! org
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
On Mon, 10 Dec 2007 02:24:41 am Vladimir Prus wrote:
> Hello!
>
> While working on KDevelop4, using Oxygen style, I've run
> into a situation where KateViewInternal::doUpdateView is
> called while height() returns -4. Since height() is used
> in various math in that function, this leads to overflow,
> and Kate starts to allocate huge vectors, and eventually
> crashes.
>
> The problem seems to be that:
>
> - KDevelop4, for a short moment, sets height 0 for
> the KateView object.
> - KateView, sometimes, add a padding of 4. This code
> in particularly suspect:
>
> if (style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents)) {
> QHBoxLayout *extrahbox = new QHBoxLayout ();
> QFrame * frame = new QFrame(this);
>
> Now, I don't know what's right solution for this problem.
> On KDevelop side, I'm gonna make sure KateView is never 0 in height.
> However, I'd like propose the following patch that merely adds
> assert -- so that next time somebody runs into this problem, the
> crash is more obvious.
>
> OK to commit?
Ok by me.
Cheers,
Hamish.
["signature.asc" (application/pgp-signature)]
_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic