[Uim-bugs] [Bug 14812] New: Crash because of misusing iconv (uim-1.4.2 and older)

View: New views
4 Messages — Rating Filter:   Alert me  

[Uim-bugs] [Bug 14812] New: Crash because of misusing iconv (uim-1.4.2 and older)

by Bugzilla from bugzilla-daemon@freedesktop.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugs.freedesktop.org/show_bug.cgi?id=14812

           Summary: Crash because of misusing iconv (uim-1.4.2 and older)
           Product: UIM
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: medium
         Component: bridge: XIM
        AssignedTo: uim-bugs@...
        ReportedBy: g-hal+bugs.freedesktop.org@...


Created an attachment (id=14821)
 --> (http://bugs.freedesktop.org/attachment.cgi?id=14821)
patch, for fix the problem.

uim-xim sometimes cause crash, because of misuse of iconv.
Relevant version is uim-1.4.2 and older versions.

1)
A string returned by iconv() is not ASCIIZ.
The end of string is not a charactor '\x0'.

2)
It is required that calling iconv() with inbuf = NULL, inbytesleft = NULL to
finish a session of conversion.


--
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
uim-bugs mailing list
uim-bugs@...
http://lists.freedesktop.org/mailman/listinfo/uim-bugs

[Uim-bugs] [Bug 14812] Crash because of misusing iconv (uim-1.4.2 and older)

by Bugzilla from bugzilla-daemon@freedesktop.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugs.freedesktop.org/show_bug.cgi?id=14812


Etsushi Kato <ek.kato@...> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




--- Comment #1 from Etsushi Kato <ek.kato@...>  2008-03-04 20:53:47 PST ---
Thanks for the report.  I've forgot to backport the termination issue of
uim-xim to 1.4.2, sorry.

But I'm just curious to know that is resetting iconv state really needed?  I'm
too ignorant about iconv(3).  Any pointer about this?


--
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
uim-bugs mailing list
uim-bugs@...
http://lists.freedesktop.org/mailman/listinfo/uim-bugs

[Uim-bugs] [Bug 14812] Crash because of misusing iconv (uim-1.4.2 and older)

by Bugzilla from bugzilla-daemon@freedesktop.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugs.freedesktop.org/show_bug.cgi?id=14812





--- Comment #2 from G-HAL <g-hal+bugs.freedesktop.org@...>  2008-03-05 15:02:07 PST ---
Sorry, I make a mistake.
If uim use only UTF-8, EUC-JP and ShiftJIS(cp932),
resetting the state is specially unnecessary, probably.
I forgot to check whether it was able to be applied to uim or not.
Ummm...
Excuse me but I have no idea that there are any OS or emacs-el that uses
ISO-2022-JP for locale in OS or encoding in emacs-el.


Anyway, in generally, resetting a state is required when using iconv.
I do not found a document clearly described.
But some documents said implicitly.

In libiconv-1.11, testing code and command-line tool.
libiconv-1.11/tests/table-from.c: line from 56 to 58
libiconv-1.11/tests/table-to.c: line from 70 to 72
libiconv-1.11/src/iconv.c: ... so many, snip.

Sun docs, man pages section 3 iconv(3c).
In example, resetting a state using INIT_SHIFT_STATE() macro.
http://docs.sun.com/app/docs/doc/819-2243/iconv-3c?l=ja&a=view


Thank you.


--
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
uim-bugs mailing list
uim-bugs@...
http://lists.freedesktop.org/mailman/listinfo/uim-bugs

[Uim-bugs] [Bug 14812] Crash because of misusing iconv (uim-1.4.2 and older)

by Bugzilla from bugzilla-daemon@freedesktop.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugs.freedesktop.org/show_bug.cgi?id=14812


Etsushi Kato <ek.kato@...> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED




--- Comment #3 from Etsushi Kato <ek.kato@...>  2008-03-06 06:40:05 PST ---
Thanks, libiconv's example is interesting.  And now the patch is applied to svn
trunk.


--
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
uim-bugs mailing list
uim-bugs@...
http://lists.freedesktop.org/mailman/listinfo/uim-bugs