rpms/anthy/devel anthy-9100e-fix-segfault-vu.patch, NONE, 1.1 anthy.spec, 1.47, 1.48

Akira TAGOH (tagoh) fedora-extras-commits at redhat.com
Fri Jun 27 09:41:26 UTC 2008


Author: tagoh

Update of /cvs/pkgs/rpms/anthy/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv7532

Modified Files:
	anthy.spec 
Added Files:
	anthy-9100e-fix-segfault-vu.patch 
Log Message:
* Fri Jun 27 2008 Akira TAGOH <tagoh at redhat.com> - 9100e-3
- Fix a segfault with some words containing vu. (#452779)

anthy-9100e-fix-segfault-vu.patch:

--- NEW FILE anthy-9100e-fix-segfault-vu.patch ---
diff -pruN anthy-9100e.orig/src-splitter/metaword.c anthy-9100e/src-splitter/metaword.c
--- anthy-9100e.orig/src-splitter/metaword.c	2007-06-18 08:27:38.000000000 +0900
+++ anthy-9100e/src-splitter/metaword.c	2008-06-27 11:53:55.000000000 +0900
@@ -17,6 +17,7 @@
 
 #include <anthy/record.h>
 #include <anthy/splitter.h>
+#include <anthy/xchar.h>
 #include <anthy/xstr.h>
 #include <anthy/segment.h>
 #include <anthy/segclass.h>
@@ -158,6 +159,18 @@ get_surrounding_text(struct splitter_con
     xs_post->len = post_len;
 }
 
+static int
+count_vu(xstr *xs)
+{
+  int i, r = 0;
+  for (i = 0; i < xs->len; i++) {
+    if (xs->str[i] == KK_VU) {
+      r++;
+    }
+  }
+  return r;
+}
+
 /*
  * Ê£¹ç¸ì¤Ç¤¢¤ëwl¤«¤énÈÖ¤á¤ÎÉôʬ¤ò¼è¤ê½Ð¤·¤Æmw¤Ë¤¹¤ë
  */
@@ -177,8 +190,12 @@ make_compound_nth_metaword(struct splitt
   get_surrounding_text(sc, wl, &xs_pre, &xs_post);
 
   for (i = 0; i <= nth; ++i) {
+    xstr part;
     from += len;
     len = anthy_compound_get_nth_segment_len(ce, i);
+    part.str = sc->ce[from].c;
+    part.len = len;
+    len -= count_vu(&part);
     if (i == 0) {
       len += xs_pre.len;
     }
@@ -742,7 +759,11 @@ make_metaword_with_depchar(struct splitt
   int len = mw ? mw->len : 0;
 
   /* metaword¤Îľ¸å¤Îʸ»ú¤Î¼ïÎà¤òÄ´¤Ù¤ë */
-  int type = anthy_get_xchar_type(*sc->ce[from + len].c);
+  int type;
+  if (sc->char_count <= from + len) {
+    return;
+  }
+  type = anthy_get_xchar_type(*sc->ce[from + len].c);
   if (!(type & XCT_SYMBOL) &&
       !(type & XCT_PART)) {
     return;


Index: anthy.spec
===================================================================
RCS file: /cvs/pkgs/rpms/anthy/devel/anthy.spec,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- anthy.spec	12 Feb 2008 08:11:06 -0000	1.47
+++ anthy.spec	27 Jun 2008 09:40:39 -0000	1.48
@@ -11,6 +11,7 @@
 
 Source0:	http://prdownloads.sourceforge.jp/anthy/29142/anthy-%{version}.tar.gz
 Source1:	anthy-init.el
+Patch0:		anthy-9100e-fix-segfault-vu.patch
 
 Summary:	Japanese character set input library
 Group:		System Environment/Libraries
@@ -50,6 +51,7 @@
 
 %prep
 %setup -q #-a 2
+%patch0 -p1 -b 0-vu
 #cp alt-cannadic-%{altcannadicver}/* alt-cannadic/
 
 %build
@@ -112,6 +114,9 @@
 %{_datadir}/xemacs/site-packages/lisp/site-start.d/anthy-init.el
 
 %changelog
+* Fri Jun 27 2008 Akira TAGOH <tagoh at redhat.com> - 9100e-3
+- Fix a segfault with some words containing vu. (#452779)
+
 * Tue Feb 12 2008 Akira TAGOH <tagoh at redhat.com> - 9100e-2
 - Rebuild for gcc-4.3.
 




More information about the fedora-extras-commits mailing list