[gnumeric] xml: fix backslash handling.



commit 8519d192860a4b0116643db34a0ff54756747745
Author: Morten Welinder <terra gnome org>
Date:   Thu Feb 18 19:39:43 2016 -0500

    xml: fix backslash handling.

 ChangeLog        |    5 +++++
 NEWS             |    2 +-
 src/parse-util.c |    9 +++++----
 3 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b50e252..4bd8b3b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-02-18  Morten Welinder  <terra gnome org>
+
+       * src/parse-util.c (unquote): Properly account backslashes.  Fixes
+       #762278.
+
 2016-02-12  Morten Welinder  <terra gnome org>
 
        * src/complex.h: Add a direct-value interface.
diff --git a/NEWS b/NEWS
index 197b6e9..175c66d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,7 @@
 Gnumeric 1.12.28
 
 Morten:
-       * Fuzzed file fixes.  [#761663] [#761727]
+       * Fuzzed file fixes.  [#761663] [#761727] [#762278]
        * Plug leaks.
        * Fix problems with ssconvert to lp/cplex formats.
        * Add sensitivity report to solver.
diff --git a/src/parse-util.c b/src/parse-util.c
index 9c6da94..42c0101 100644
--- a/src/parse-util.c
+++ b/src/parse-util.c
@@ -882,10 +882,11 @@ unquote (char *dst, char const *src, int n)
 {
        while (n-- > 0)
                if (*src == '\\' && src[1]) {
-                       int n = g_utf8_skip [*(guchar *)(++src)];
-                       strncpy (dst, src, n);
-                       dst += n;
-                       src += n;
+                       int l = g_utf8_skip [*(guchar *)(++src)];
+                       strncpy (dst, src, l);
+                       dst += l;
+                       src += l;
+                       n -= l;
                } else
                        *dst++ = *src++;
        *dst = 0;


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