[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#347392: libqt3-mt: Possible stack overflow by recursion in QListViewItemIterator::operator++()



Subject: libqt3-mt: Possible stack overflow by recursion in 
QListViewItemIterator::operator++()
Package: libqt3-mt
Version: 3:3.3.5-1
Severity: normal
Tags: patch

*** Please type your report below this line ***
When KMail has a very big mailbox (lots of messages), it crashes when
trying to display them. This is because Qt recurses too deep in a
listview iterator. Changing the recursion to a simple do-while loop
fixes the problem locally:

diff qt-copy/qt-copy/src/widgets/qlistview.cpp
qt-x11-free-3.3.5/src/widgets/qlistview.cpp
7571,7585c7571,7586
<     if ( !curr )
<       return *this;
<
<     QListViewItem *item = curr->firstChild();
<     if ( !item ) {
<       while ( (item = curr->nextSibling()) == 0  ) {
<           curr = curr->parent();
<           if ( curr == 0 )
<               break;
<       }
<     }
<     curr = item;
<     // if the next one doesn't match the flags we try one more ahead
<     if ( curr && !matchesFlags( curr ) )
<       ++( *this );
---
>     do {
>         if ( !curr )
>       return *this;
>
>         QListViewItem *item = curr->firstChild();
>         if ( !item ) {
>       while ( (item = curr->nextSibling()) == 0  ) {
>           curr = curr->parent();
>           if ( curr == 0 )
>               break;
>       }
>         }
>         curr = item;
>         // if the next one doesn't match the flags we try one more
>         ahead
>     } while ( curr && !matchesFlags( curr ) );



-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14-2-amd64-k8
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages libqt3-mt depends on:
ii  fontconfig                2.3.2-1        generic font configuration 
library
ii  libaudio2                 1.7-3          The Network Audio System (NAS). 
(s
ii  libc6                     2.3.5-6        GNU C Library: Shared libraries 
an
ii  libfontconfig1            2.3.2-1        generic font configuration 
library
ii  libfreetype6              2.1.10-1       FreeType 2 font engine, shared 
lib
ii  libgcc1                   1:4.0.2-5      GCC support library
ii  libice6                   6.8.2.dfsg.1-8 Inter-Client Exchange library
ii  libjpeg62                 6b-10          The Independent JPEG Group's JPEG 
ii  libmng1                   1.0.8-1        Multiple-image Network Graphics 
li
ii  libpng12-0                1.2.8rel-5     PNG library - runtime
ii  libsm6                    6.8.2.dfsg.1-8 X Window System Session 
Management
ii  libstdc++6                4.0.2-5        The GNU Standard C++ Library v3
ii  libx11-6                  6.8.2.dfsg.1-8 X Window System protocol client 
li
ii  libxcursor1               1.1.3-1        X cursor management library
ii  libxext6                  6.8.2.dfsg.1-8 X Window System miscellaneous 
exte
ii  libxft2                   2.1.7-1        FreeType-based font drawing 
librar
ii  libxi6                    6.8.2.dfsg.1-8 X Window System Input extension 
li
ii  libxinerama1              6.8.2.dfsg.1-8 X Window System multi-head 
display
ii  libxrandr2                6.8.2.dfsg.1-8 X Window System Resize, Rotate 
and
ii  libxrender1               1:0.9.0-2      X Rendering Extension client 
libra
ii  libxt6                    6.8.2.dfsg.1-8 X Toolkit Intrinsics
ii  xlibs                     6.8.2.dfsg.1-8 X Window System client libraries 
m
ii  zlib1g                    1:1.2.3-4      compression library - runtime

libqt3-mt recommends no packages.

-- no debconf information



Reply to: