public inbox for ecos-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug 1002106] New: Bugs in vfscanf.cxx to deal with utf-8
@ 2015-11-20  2:57 bugzilla-daemon
  2015-11-20  2:59 ` [Bug 1002106] " bugzilla-daemon
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: bugzilla-daemon @ 2015-11-20  2:57 UTC (permalink / raw)
  To: unassigned

Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1002106

            Bug ID: 1002106
           Summary: Bugs in vfscanf.cxx to deal with utf-8
           Product: eCos
           Version: 3.0
            Target: All
 Architecture/Host_ Other
                OS:
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: low
         Component: C library
          Assignee: unassigned@bugs.ecos.sourceware.org
          Reporter: 414256we@gmail.com
        QA Contact: ecos-bugs@ecos.sourceware.org
                CC: ecos-bugs@ecos.sourceware.org

Problem:
    vfscanf have problem to deal with string in utf-8 format. 
Analyze:
    In function:
        externC int
            vfscanf (FILE *fp, const char *fmt0, va_list ap) __THROW {
                        u_char *fmt = (u_char *) fmt0;

        It declared that:
            char ccltab[256];
            char curr_byte;
        When a byte's highest bit(the sign bit) is set(e.g. 0xe5), doing the
following conversion:
            (int)*CURR_POS
        it surely will generates an integer that is larger than 256( Recall,
signed bit extension).
        While try to combine it with:
            ccltab[(int)*CURR_POS]
        a fairly bug yields.

-- 
You are receiving this mail because:
You are the assignee for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug 1002106] Bugs in vfscanf.cxx to deal with utf-8
  2015-11-20  2:57 [Bug 1002106] New: Bugs in vfscanf.cxx to deal with utf-8 bugzilla-daemon
@ 2015-11-20  2:59 ` bugzilla-daemon
  2015-11-20  8:19 ` bugzilla-daemon
  2015-12-04  1:44 ` bugzilla-daemon
  2 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon @ 2015-11-20  2:59 UTC (permalink / raw)
  To: unassigned

Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1002106

--- Comment #1 from Lea <414256we@gmail.com> ---
Simply changed 
    char curr_byte;
to 
    unsigned char curr_byte;
will solve the problem.

-- 
You are receiving this mail because:
You are the assignee for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug 1002106] Bugs in vfscanf.cxx to deal with utf-8
  2015-11-20  2:57 [Bug 1002106] New: Bugs in vfscanf.cxx to deal with utf-8 bugzilla-daemon
  2015-11-20  2:59 ` [Bug 1002106] " bugzilla-daemon
@ 2015-11-20  8:19 ` bugzilla-daemon
  2015-12-04  1:44 ` bugzilla-daemon
  2 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon @ 2015-11-20  8:19 UTC (permalink / raw)
  To: unassigned

Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1002106

--- Comment #2 from Lea <414256we@gmail.com> ---
Since in vfscanf.cxx, it just:
    #if 0
    #define u_char unsigned char
    #endif
    #define u_char char
This will course the function:
    static u_char *
        __sccl (char *tab, u_char *fmt);
    to rise a segment fault(invalid write) in
        for (;;) {
                tab[c] = v;             /* take character c */
    while it try to handle utf-8 byte.

-- 
You are receiving this mail because:
You are the assignee for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug 1002106] Bugs in vfscanf.cxx to deal with utf-8
  2015-11-20  2:57 [Bug 1002106] New: Bugs in vfscanf.cxx to deal with utf-8 bugzilla-daemon
  2015-11-20  2:59 ` [Bug 1002106] " bugzilla-daemon
  2015-11-20  8:19 ` bugzilla-daemon
@ 2015-12-04  1:44 ` bugzilla-daemon
  2 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon @ 2015-12-04  1:44 UTC (permalink / raw)
  To: unassigned

Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1002106

Lea <414256we@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|low                         |high
           Severity|enhancement                 |critical

-- 
You are receiving this mail because:
You are the assignee for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug 1002106] Bugs in vfscanf.cxx to deal with utf-8
  2015-11-20  2:57 [Bug 1002106] New: " bugzilla-daemon
  2015-11-20  2:59 ` [Bug 1002106] " bugzilla-daemon
  2015-11-20  8:19 ` bugzilla-daemon
@ 2015-12-04  1:44 ` bugzilla-daemon
  2 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon @ 2015-12-04  1:44 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1002106

Lea <414256we@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|low                         |high
           Severity|enhancement                 |critical

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug 1002106] Bugs in vfscanf.cxx to deal with utf-8
  2015-11-20  2:57 [Bug 1002106] New: " bugzilla-daemon
  2015-11-20  2:59 ` [Bug 1002106] " bugzilla-daemon
@ 2015-11-20  8:19 ` bugzilla-daemon
  2015-12-04  1:44 ` bugzilla-daemon
  2 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon @ 2015-11-20  8:19 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1002106

--- Comment #2 from Lea <414256we@gmail.com> ---
Since in vfscanf.cxx, it just:
    #if 0
    #define u_char unsigned char
    #endif
    #define u_char char
This will course the function:
    static u_char *
        __sccl (char *tab, u_char *fmt);
    to rise a segment fault(invalid write) in
        for (;;) {
                tab[c] = v;             /* take character c */
    while it try to handle utf-8 byte.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug 1002106] Bugs in vfscanf.cxx to deal with utf-8
  2015-11-20  2:57 [Bug 1002106] New: " bugzilla-daemon
@ 2015-11-20  2:59 ` bugzilla-daemon
  2015-11-20  8:19 ` bugzilla-daemon
  2015-12-04  1:44 ` bugzilla-daemon
  2 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon @ 2015-11-20  2:59 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1002106

--- Comment #1 from Lea <414256we@gmail.com> ---
Simply changed 
    char curr_byte;
to 
    unsigned char curr_byte;
will solve the problem.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-12-04  1:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-20  2:57 [Bug 1002106] New: Bugs in vfscanf.cxx to deal with utf-8 bugzilla-daemon
2015-11-20  2:59 ` [Bug 1002106] " bugzilla-daemon
2015-11-20  8:19 ` bugzilla-daemon
2015-12-04  1:44 ` bugzilla-daemon
2015-11-20  2:57 [Bug 1002106] New: " bugzilla-daemon
2015-11-20  2:59 ` [Bug 1002106] " bugzilla-daemon
2015-11-20  8:19 ` bugzilla-daemon
2015-12-04  1:44 ` bugzilla-daemon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).