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

[palm-unix-j:00212] patch for 0.99



Hi, 

I tried jpilot-0.99pre and found some problems:
   memory leaks or illegal access,
   incompleted internationalization(i18n)s, 
   some bugs in japanese convetion code,
and so on.

Please examine my patch.
the patch includes the work to po/ja.po by Mr. Kawashima.
you can get patch from http://www.da-cha.org/jpilot/ 
you also show the problem&fix list atached this mail as follows:


-----------------------------------------------------
   address.c: urgency=high, SEGV fault in libc,

     address_compare() called from qsort() has the problem in 
     the multilingual language. it use strncpy(), so it cannot
     determine multilingual charactor bound. then it chops multi-byte
     chars to half incomplete byte. it caused SEGV fault.
     
     solution: theres two type solution.
        a.  use strcpy and use buffer that has enough length. 
        b.  use multibyte_safe_strncpy() that I implemented in utils.c.
     I adopt (a.) in this case because the str length is short enough. 

-----------------------------------------------------

  datebook_gui.c: urgency=mid, unintelligible sequence of characters in cats widget,
     add translation code.

                : urgency=low, incomplete gettextize  
     change "Cats" to _("Cats") .

-----------------------------------------------------
  japanese.c: urgency=high, unintelligible argolism.

     there changes the length with some japanese code in code convertion, 
     it is at worst TWICE or half as a source string.
     (Some charcodes of Extend Unix code(EUC) that is 1byte in the Shift-JIS
       is 2byte: Japanese Kana)

     replace whole codes to one using Samba project.
      # I am a Samba JP localization developer.....

-----------------------------------------------------

  jpilot.c: urgency=mid, incompleted gettextize.

   1.  ' gettext("Help/About "PN) '  is not good idea. change it to 
    char *about = gettext("Help/About %s")
    sprintf(buf, about, PN);

   2.  gettextize 'char *text[]=("str1", "str2");print text[1];'
    to 'char *text[]=(gettext_noop("str1"),....);print gettext(text[1]);'
 
-----------------------------------------------------
  memo.c: urgency=high, SEGV fault.

    the promlem is same as address.c
    solution is (b).  please see description about address.c 
-----------------------------------------------------
    
  memo_gui.c: urgency=high, SEGV fault.

    it assumes memo has at least one '¥n'. But you make one liner memo.
    it easily happens memo == 'foo boo bar¥0'
    memccpy(str, memo, '/n', len) makes memory runnaway.

    calculate len exactly include this case.

    # there seems more problems yet.... 
    now i cannot test it in multibyte environment....
    additional infomation will be send....
  
            : urgency=high, SEGV fault.

      if category == CATEGORY_ALL, memo_app_info.category.name[category] 
      fails.   length of memo_app_info.category.name is 16, ...._ALL is 300.

-----------------------------------------------------
 
  sync.c: urgency=mid,  unintelligible sequence of characters in the log on palm device,

      add code convertion.

-----------------------------------------------------

  todo.c: urgency=mid, incomplete i18n,

      use strcoll() instead of strcmp()

            : urgency=high, SEGV fault.

      if category == CATEGORY_ALL, todo_app_info.category.name[category] 
      fails.   length of todo_app_info.category.name is less than 300.

-----------------------------------------------------

  utils.c: urgency=high, unintelligible sequence of characters in whole jpilot messages.

     gettextize. gtk function arguments.

  utils.c,utils.h: urgency=high, add function using memo.c.
 
     add multibyte_safe_strncpy().

-----------------------------------------------------
  po/jpilot.pot, po/*.po: update pot and po.

-----------------------------------------------------
-- 
Hiroshi Miura  --- http://www.momokuri.org/  http://www.Hokkaid.org/
http://lkh.linux.or.jp/  http://www.samba.gr.jp/ http://alsa.linux.or.jp/ 
http://www.blue.gr.jp/  TLUG, TLUC-Kanto, YLUG-Diet, CLUG, Palm<->Linux
Powered by Tankiyo, Danke, SuiSui, Kisuke, SterBucks, DE STEIL
CCNA, Oracle Silver Master, Network Specialist(JITEC)