[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Infinite loop in __argp_get_display_len
From: |
Vladimir 'φ-coder/phcoder' Serbinenko |
Subject: |
Re: Infinite loop in __argp_get_display_len |
Date: |
Sun, 26 Feb 2012 20:16:34 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20120216 Icedove/8.0 |
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
address@hidden
https://lists.gnu.org/mailman/listinfo/grub-devel
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko