* Bugs in vfscanf.cxx(eCos)
@ 2015-11-20 2:41 黎伟强
0 siblings, 0 replies; only message in thread
From: 黎伟强 @ 2015-11-20 2:41 UTC (permalink / raw)
To: ecos-maintainers
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, 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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-11-20 2:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-20 2:41 Bugs in vfscanf.cxx(eCos) 黎伟强
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).