[SCM] Calligra suite packaging branch, wheezy, updated. debian/2.4.4-1-7-gef08794

Adrien Grellier adrien-guest at alioth.debian.org
Fri Mar 15 21:00:55 UTC 2013


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-std/calligra.git;a=commitdiff;h=85b3f71

The following commit has been merged in the wheezy branch:
commit 85b3f71e7dc4b3c31a8c88cda9c322510fcc5390
Author: Adrien Grellier <adrien.grellier at laposte.net>
Date:   Fri Mar 15 21:44:35 2013 +0100

    import patch fix_tokenizing_of_invalid_formulas.patch from upstream
    
    it close bug #702824.
    It prevent a important crash when entering some special characters in formula.
---
 debian/changelog                                   |    8 +++
 .../fix_tokenizing_of_invalid_formulas.patch       |   53 ++++++++++++++++++++
 debian/patches/series                              |    1 +
 3 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index dae5de8..ae2bafe 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+calligra (1:2.4.4-3) UNRELEASED; urgency=low
+
+  * import patch fix_tokenizing_of_invalid_formulas.patch from upstream
+    (Closes: #702824). It prevent a important crash when entering some special
+    characters in formula.
+
+ -- Adrien Grellier <adrien.grellier at laposte.net>  Fri, 15 Mar 2013 17:49:12 +0100
+
 calligra (1:2.4.4-2) unstable; urgency=low
 
   [ Lisandro Damián Nicanor Pérez Meyer ]
diff --git a/debian/patches/fix_tokenizing_of_invalid_formulas.patch b/debian/patches/fix_tokenizing_of_invalid_formulas.patch
new file mode 100644
index 0000000..9b70ec9
--- /dev/null
+++ b/debian/patches/fix_tokenizing_of_invalid_formulas.patch
@@ -0,0 +1,53 @@
+--- a/sheets/Formula.cpp
++++ b/sheets/Formula.cpp
+@@ -656,7 +656,8 @@
+     tokens.reserve(50);
+ 
+     ++data;
+-    const QChar *start = data;
++    const QChar * const start = data;
++    const QChar * const end = start + expr.length();
+     const QChar *tokenStart = data;
+     const QChar *cellStart = data;
+ 
+@@ -667,9 +668,9 @@
+     QString token(length, QChar());
+     token.reserve(length); // needed to not realloc at the resize at the end
+     QChar * out = token.data();
+-    QChar * outStart = token.data();
+-
+-    while (state != Finish) {
++    QChar * const outStart = token.data();
++
++    while (state != Finish && data < end) {
+         switch (state) {
+         case Start:
+             tokenStart = data;
+@@ -1060,7 +1061,7 @@
+     }
+ 
+     // parse error if any text remains
+-    if (!data->isNull())  {
++    if (data+1 < end)  {
+         tokens.append(Token(Token::Unknown, expr.mid(tokenStart - start), tokenStart - start));
+         parseError = true;
+     }
+
+--- a/sheets/tests/TestFormula.cpp
++++ b/sheets/tests/TestFormula.cpp
+@@ -177,9 +177,13 @@
+     // invalid formulas, can't be parsed correctly
+     CHECK_TOKENIZE("+1.23E", QString());
+ 
++    // incomplete formulas
++    CHECK_TOKENIZE("COMPARE(\"", "xo");
++    CHECK_TOKENIZE("SHEETS(Sheet2!", "");
++
+     // empty parameter
+     CHECK_TOKENIZE("IF(A1;A2;)", "xococoo");
+-    CHECK_TOKENIZE("=OFFSET(Sheet2'!B7;0;0)", "");
++    CHECK_TOKENIZE("OFFSET(Sheet2'!B7;0;0)", "");
+ 
+     // function cascade
+     CHECK_TOKENIZE("SUM(ABS(-1);ABS(-1))", "xoxooiooxooioo");
+
diff --git a/debian/patches/series b/debian/patches/series
index 7dc314a..d5655fc 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 do_not_link_blas.diff
+fix_tokenizing_of_invalid_formulas.patch

-- 
Calligra suite packaging



More information about the pkg-kde-commits mailing list