[dia] Bug 633430 - Memory corruption when exporting to Xfig



commit e7865c892be5afc814a3bd54ebfc9fc116354b3d
Author: Hans Breuer <hans breuer org>
Date:   Fri Oct 29 19:43:49 2010 +0200

    Bug 633430 - Memory corruption when exporting to Xfig
    
    (figText) : the escaping of backslash was not considered in new
    string calculation.

 plug-ins/xfig/xfig-export.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/plug-ins/xfig/xfig-export.c b/plug-ins/xfig/xfig-export.c
index 77af74c..ad63918 100644
--- a/plug-ins/xfig/xfig-export.c
+++ b/plug-ins/xfig/xfig-export.c
@@ -417,6 +417,8 @@ figText(XfigRenderer *renderer, const guchar *text)
   for (i = 0; i < len; i++) {
     if (text[i] > 127) {
       newlen += 3;
+    } else if ('\\'==text[i]) {
+      newlen += 1;
     }
   }
   returntext = g_malloc(sizeof(char)*(newlen+1));



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