From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61691 invoked by alias); 20 Nov 2015 02:41:27 -0000 Mailing-List: contact ecos-maintainers-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-maintainers-owner@ecos.sourceware.org Received: (qmail 61678 invoked by uid 89); 20 Nov 2015 02:41:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,FROM_STARTS_WITH_NUMS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wm0-f54.google.com Received: from mail-wm0-f54.google.com (HELO mail-wm0-f54.google.com) (74.125.82.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 20 Nov 2015 02:41:25 +0000 Received: by wmww144 with SMTP id w144so3197332wmw.1 for ; Thu, 19 Nov 2015 18:41:22 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.194.20.35 with SMTP id k3mr11796623wje.19.1447987282575; Thu, 19 Nov 2015 18:41:22 -0800 (PST) Received: by 10.27.51.19 with HTTP; Thu, 19 Nov 2015 18:41:22 -0800 (PST) Date: Fri, 20 Nov 2015 02:41:00 -0000 Message-ID: Subject: Bugs in vfscanf.cxx(eCos) From: =?UTF-8?B?6buO5Lyf5by6?= <414256we@gmail.com> To: ecos-maintainers Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-11/txt/msg00000.txt.bz2 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.