m17n-list
[Top][All Lists]
Advanced

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

[m17n-list] Fix for a crash in m17n-lib


From: Mike FABIAN
Subject: [m17n-list] Fix for a crash in m17n-lib
Date: Thu, 27 Aug 2015 11:59:40 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

A crash happens in m17n-lib when trying to transliterate
using /usr/share/m17n/mr-itrans.mim from Python3 via libtranslit.

See:

https://bugzilla.redhat.com/show_bug.cgi?id=1256244

The attached patch seems to fix the problem.
Is that patch correct?

(Actually the first hunk of the patch is not needed to fix the
problem, I just added that because there seems to be a similar
error than the one causing the crash).

-- 
Mike FABIAN <address@hidden>
睡眠不足はいい仕事の敵だ。

>From 868093b0b0504da6693f5e868e7deb468009b5af Mon Sep 17 00:00:00 2001
From: Mike FABIAN <address@hidden>
Date: Wed, 26 Aug 2015 15:42:28 +0200
Subject: [PATCH] Bug 1256244 - Transliteration not working on Marathi language

---
 src/input.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/input.c b/src/input.c
index 1160085..5a86b10 100644
--- a/src/input.c
+++ b/src/input.c
@@ -1083,7 +1083,7 @@ load_translation (MIMMap *map, MPlist *keylist, MPlist 
*map_actions,
       len = MPLIST_LENGTH (elt);
       if (MFAILP (len > 0))
        return -1;
-      keyseq = (MSymbol *) alloca (sizeof (int) * len);
+      keyseq = (MSymbol *) alloca (sizeof (MSymbol) * len);
       for (i = 0; i < len; i++, elt = MPLIST_NEXT (elt))
        {
          if (MPLIST_INTEGER_P (elt))
@@ -4264,7 +4264,7 @@ filter (MInputContext *ic, MSymbol key, void *arg)
   if (ic_info->commit_key_head > 0)
     {
       memmove (ic_info->keys, ic_info->keys + ic_info->commit_key_head,
-              sizeof (int) * (ic_info->used - ic_info->commit_key_head));
+              sizeof (MSymbol *) * (ic_info->used - ic_info->commit_key_head));
       ic_info->used -= ic_info->commit_key_head;
       ic_info->key_head -= ic_info->commit_key_head;
       ic_info->state_key_head -= ic_info->commit_key_head;
@@ -4278,7 +4278,7 @@ filter (MInputContext *ic, MSymbol key, void *arg)
       if (ic_info->key_head > 0)
        {
          memmove (ic_info->keys, ic_info->keys + ic_info->key_head,
-                  sizeof (int) * (ic_info->used - ic_info->key_head));
+                  sizeof (MSymbol *) * (ic_info->used - ic_info->key_head));
          ic_info->used -= ic_info->key_head;
          ic_info->key_head = ic_info->state_key_head
            = ic_info->commit_key_head = 0;
-- 
2.4.3


reply via email to

[Prev in Thread] Current Thread [Next in Thread]