From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1S1jaQ-0003BM-FO for mharc-grub-devel@gnu.org; Sun, 26 Feb 2012 14:16:46 -0500 Received: from eggs.gnu.org ([208.118.235.92]:52908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1jaO-0003B4-C2 for grub-devel@gnu.org; Sun, 26 Feb 2012 14:16:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S1jaM-0001Yq-Eg for grub-devel@gnu.org; Sun, 26 Feb 2012 14:16:44 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:52371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1jaM-0001YT-8h for grub-devel@gnu.org; Sun, 26 Feb 2012 14:16:42 -0500 Received: by eeke53 with SMTP id e53so1367269eek.0 for ; Sun, 26 Feb 2012 11:16:40 -0800 (PST) Received-SPF: pass (google.com: domain of phcoder@gmail.com designates 10.14.203.200 as permitted sender) client-ip=10.14.203.200; Authentication-Results: mr.google.com; spf=pass (google.com: domain of phcoder@gmail.com designates 10.14.203.200 as permitted sender) smtp.mail=phcoder@gmail.com; dkim=pass header.i=phcoder@gmail.com Received: from mr.google.com ([10.14.203.200]) by 10.14.203.200 with SMTP id f48mr6187756eeo.30.1330283800275 (num_hops = 1); Sun, 26 Feb 2012 11:16:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=+m/0qKGEjCfQwWX3c80oeXCwSkeW7wn36IZXunNdy8k=; b=rmXfntBhrEeQk4jpm5Rk7pnWnzJ5LjuR4crP5Z/p08SBD9K/n3SYGDXoo9pt5NdR5Y aNulOHAETBSJrQhFs7JpEEU/p6LEao2CtNS0FfcDRwuXy7P3bszL9Tf+atqZixk+Px2w PFcT+OMIGn/Da4MYtBDGbNSco+qb1pqsgiryQ= Received: by 10.14.203.200 with SMTP id f48mr4668256eeo.30.1330283800066; Sun, 26 Feb 2012 11:16:40 -0800 (PST) Received: from debian.x201.phnet (51-234.197-178.cust.bluewin.ch. [178.197.234.51]) by mx.google.com with ESMTPS id o49sm48456998eeb.7.2012.02.26.11.16.37 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 26 Feb 2012 11:16:38 -0800 (PST) Message-ID: <4F4A8512.2040700@gmail.com> Date: Sun, 26 Feb 2012 20:16:34 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20120216 Icedove/8.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: Infinite loop in __argp_get_display_len References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.83.41 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 19:16:45 -0000 On 26.02.2012 20:12, Mike Gilbert wrote: > Running grub-mkimage --help triggers an infinite loop in > __argp_get_display_len. Backtrace attached. Yes, I've just noticed it. I have a fix, just testing it. > The following change seems to resolve it; I wonder if it should be > applied to the other functions in argp-fmtstream.c? > > === modified file 'grub-core/gnulib/argp-fmtstream.c' > --- grub-core/gnulib/argp-fmtstream.c 2012-02-26 18:07:59 +0000 > +++ grub-core/gnulib/argp-fmtstream.c 2012-02-26 19:04:10 +0000 > @@ -133,7 +133,7 @@ > size_t s; > > s = mbrtowc (&wc, ptr, end - ptr,&ps); > - if (s == (size_t) -1) > + if (s == 0 || s == (size_t) -1 || s == (size_t) -2) > break; > r += wcwidth (wc); > ptr += s; > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel -- Regards Vladimir 'φ-coder/phcoder' Serbinenko