diff -Nru /tmp/UzwTMrmFMR/kdebase-3.5.6/debian/changelog /tmp/l3uyULRfnI/kdebase-3.5.6/debian/changelog --- /tmp/UzwTMrmFMR/kdebase-3.5.6/debian/changelog 2007-09-21 16:23:24.000000000 +0000 +++ /tmp/l3uyULRfnI/kdebase-3.5.6/debian/changelog 2007-09-21 16:23:36.000000000 +0000 @@ -1,3 +1,10 @@ +kdebase (4:3.5.6-0ubuntu20.3) feisty-proposed; urgency=low + + * Add kubuntu_9905_fix_konsole_forking.diff to close + https://bugs.launchpad.net/ubuntu/+source/python-kde3/+bug/117731 + + -- Jonathan Riddell Fri, 21 Sep 2007 16:15:46 +0000 + kdebase (4:3.5.6-0ubuntu20.2) feisty-security; urgency=low * SECURITY UPDATE: addressbar spoofing possible via trailing spaces or diff -Nru /tmp/UzwTMrmFMR/kdebase-3.5.6/debian/patches/kubuntu_9905_fix_konsole_forking.diff /tmp/l3uyULRfnI/kdebase-3.5.6/debian/patches/kubuntu_9905_fix_konsole_forking.diff --- /tmp/UzwTMrmFMR/kdebase-3.5.6/debian/patches/kubuntu_9905_fix_konsole_forking.diff 1970-01-01 00:00:00.000000000 +0000 +++ /tmp/l3uyULRfnI/kdebase-3.5.6/debian/patches/kubuntu_9905_fix_konsole_forking.diff 2007-09-21 16:23:36.000000000 +0000 @@ -0,0 +1,165 @@ +diff -Nur kdebase-3.5.7/konsole/konsole/TEHistory.cpp kdebase-3.5.7.new/konsole/konsole/TEHistory.cpp +--- kdebase-3.5.7/konsole/konsole/TEHistory.cpp 2007-09-15 23:58:14.000000000 +0100 ++++ kdebase-3.5.7.new/konsole/konsole/TEHistory.cpp 2007-09-15 23:59:14.000000000 +0100 +@@ -207,23 +207,24 @@ + // History Scroll Buffer ////////////////////////////////////// + HistoryScrollBuffer::HistoryScrollBuffer(unsigned int maxNbLines) + : HistoryScroll(new HistoryTypeBuffer(maxNbLines)), +- m_histBuffer(maxNbLines), +- m_wrappedLine(maxNbLines), + m_maxNbLines(maxNbLines), + m_nbLines(0), +- m_arrayIndex(maxNbLines - 1) ++ m_arrayIndex(0), ++ m_buffFilled(false) + { ++ m_histBuffer.setAutoDelete(true); ++ m_histBuffer.resize(maxNbLines); ++ m_wrappedLine.resize(maxNbLines); + } + + HistoryScrollBuffer::~HistoryScrollBuffer() + { +- for(size_t line = 0; line < m_nbLines; ++line) { +- delete m_histBuffer[adjustLineNb(line)]; +- } + } + + void HistoryScrollBuffer::addCells(ca a[], int count) + { ++ //unsigned int nbLines = countLines(bytes, len); ++ + histline* newLine = new histline; + + newLine->duplicate(a, count); +@@ -231,15 +232,45 @@ + ++m_arrayIndex; + if (m_arrayIndex >= m_maxNbLines) { + m_arrayIndex = 0; +- } ++ m_buffFilled = true; ++ } + +- if (m_nbLines < m_maxNbLines) ++m_nbLines; ++ // FIXME: See BR96605 ++ if (m_nbLines < m_maxNbLines - 1) ++m_nbLines; + +- delete m_histBuffer[m_arrayIndex]; ++ // m_histBuffer.remove(m_arrayIndex); // not necessary + m_histBuffer.insert(m_arrayIndex, newLine); + m_wrappedLine.clearBit(m_arrayIndex); + } + ++void HistoryScrollBuffer::normalize() ++{ ++ if (!m_buffFilled || !m_arrayIndex) return; ++ QPtrVector newHistBuffer; ++ newHistBuffer.resize(m_maxNbLines); ++ QBitArray newWrappedLine; ++ newWrappedLine.resize(m_maxNbLines); ++ for(int i = 0; i < (int) m_maxNbLines-2; i++) ++ { ++ int lineno = adjustLineNb(i); ++ newHistBuffer.insert(i+1, m_histBuffer[lineno]); ++ newWrappedLine.setBit(i+1, m_wrappedLine[lineno]); ++ } ++ m_histBuffer.setAutoDelete(false); ++ // Qt 2.3: QVector copy assignment is buggy :-( ++ // m_histBuffer = newHistBuffer; ++ for(int i = 0; i < (int) m_maxNbLines; i++) ++ { ++ m_histBuffer.insert(i, newHistBuffer[i]); ++ m_wrappedLine.setBit(i, newWrappedLine[i]); ++ } ++ m_histBuffer.setAutoDelete(true); ++ ++ m_arrayIndex = m_maxNbLines; ++ m_buffFilled = false; ++ m_nbLines = m_maxNbLines-2; ++} ++ + void HistoryScrollBuffer::addLine(bool previousWrapped) + { + m_wrappedLine.setBit(m_arrayIndex,previousWrapped); +@@ -284,40 +315,19 @@ + return; + } + +- assert(colno <= (int) l->size() - count); ++ assert((colno < (int) l->size()) || (count == 0)); + + memcpy(res, l->data() + colno, count * sizeof(ca)); + } + + void HistoryScrollBuffer::setMaxNbLines(unsigned int nbLines) + { +- QPtrVector newHistBuffer(nbLines); +- QBitArray newWrappedLine(nbLines); +- +- size_t preservedLines = (nbLines > m_nbLines ? m_nbLines : nbLines); //min +- +- // delete any lines that will be lost +- size_t lineOld; +- for(lineOld = 0; lineOld < m_nbLines - preservedLines; ++lineOld) { +- delete m_histBuffer[adjustLineNb(lineOld)]; +- } +- +- // copy the lines to new arrays +- size_t indexNew = 0; +- while(indexNew < preservedLines) { +- newHistBuffer.insert(indexNew, m_histBuffer[adjustLineNb(lineOld)]); +- newWrappedLine.setBit(indexNew, m_wrappedLine[adjustLineNb(lineOld)]); +- ++lineOld; +- ++indexNew; +- } +- m_arrayIndex = preservedLines - 1; +- +- m_histBuffer = newHistBuffer; +- m_wrappedLine = newWrappedLine; +- ++ normalize(); + m_maxNbLines = nbLines; +- if (m_nbLines > m_maxNbLines) +- m_nbLines = m_maxNbLines; ++ m_histBuffer.resize(m_maxNbLines); ++ m_wrappedLine.resize(m_maxNbLines); ++ if (m_nbLines > m_maxNbLines - 2) ++ m_nbLines = m_maxNbLines -2; + + delete m_histType; + m_histType = new HistoryTypeBuffer(nbLines); +@@ -325,10 +335,10 @@ + + int HistoryScrollBuffer::adjustLineNb(int lineno) + { +- // lineno = 0: oldest line +- // lineno = getLines() - 1: newest line +- +- return (m_arrayIndex + lineno - (m_nbLines - 1) + m_maxNbLines) % m_maxNbLines; ++ if (m_buffFilled) ++ return (lineno + m_arrayIndex + 2) % m_maxNbLines; ++ else ++ return lineno ? lineno + 1 : 0; + } + + +diff -Nur kdebase-3.5.7/konsole/konsole/TEHistory.h kdebase-3.5.7.new/konsole/konsole/TEHistory.h +--- kdebase-3.5.7/konsole/konsole/TEHistory.h 2007-09-15 23:58:14.000000000 +0100 ++++ kdebase-3.5.7.new/konsole/konsole/TEHistory.h 2007-09-15 23:59:14.000000000 +0100 +@@ -142,11 +142,16 @@ + private: + int adjustLineNb(int lineno); + ++ // Normalize buffer so that the size can be changed. ++ void normalize(); ++ ++ bool m_hasScroll; + QPtrVector m_histBuffer; + QBitArray m_wrappedLine; + unsigned int m_maxNbLines; + unsigned int m_nbLines; + unsigned int m_arrayIndex; ++ bool m_buffFilled; + + }; +