Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37048516
en ru br
Репозитории ALT
S:4.8.7-alt25
5.1: 4.6.3-alt1.M51.1
4.1: 4.4.3-alt1.M41.1
4.0: 4.3.4-alt5.M40.1
3.0: 4.0.1-alt1
+updates:4.0.1-alt2
+backports:4.2.3-alt7.1.M30
www.altlinux.org/Changes

Группа :: Система/Библиотеки
Пакет: qt4

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: xmlpatterns_stack_overflow_fix.diff
Скачать


commit d1b17740ed4d9b1e3c3ad5898bb8259969dc77df
Author: Kamil Rojewski <kamil.rojewski@gmail.com>
Date:   Wed Aug 13 10:38:38 2014 +0200
    fix for stack overflow
    
    Recursion in item mapping iterator caused a stack
    overflow for large datasets.
    
    Task-number: QTBUG-40153
    Change-Id: I693798de0ecfd3a920a3dd270172ce7ec3c13d8d
    Reviewed-by: Jд≥drzej Nowacki <jedrzej.nowacki@digia.com>
Index: qt4-x11/src/xmlpatterns/iterators/qitemmappingiterator_p.h
===================================================================
--- qt4-x11.orig/src/xmlpatterns/iterators/qitemmappingiterator_p.h	2014-09-04 11:47:43.979391542 -0500
+++ qt4-x11/src/xmlpatterns/iterators/qitemmappingiterator_p.h	2014-09-04 11:47:43.975391542 -0500
@@ -117,24 +117,28 @@
          */
         virtual TResult next()
         {
-            const TSource sourceItem(m_it->next());
-
-            if(qIsForwardIteratorEnd(sourceItem))
+            while (true)
             {
-                m_current = TResult();
-                m_position = -1;
-                return TResult();
-            }
-            else
-            {
-                m_current = m_mapper->mapToItem(sourceItem, m_context);
-                if(qIsForwardIteratorEnd(m_current))
-                    return next(); /* The mapper returned null, so continue with the next in the source. */
-                else
+                const TSource &sourceItem = m_it->next();
+                if (qIsForwardIteratorEnd(sourceItem))
                 {
-                    ++m_position;
+                    m_current = TResult();
+                    m_position = -1;
                     return m_current;
                 }
+                else
+                {
+                    m_current = m_mapper->mapToItem(sourceItem, m_context);
+                    if (qIsForwardIteratorEnd(m_current))
+                    {
+                        continue; /* The mapper returned null, so continue with the next in the source. */
+                    }
+                    else
+                    {
+                        ++m_position;
+                        return m_current;
+                    }
+                }
             }
         }
 
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin