From 2b3431017de1e8ae5bb71b02b3abac2ebba6fcde Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sun, 26 Feb 2012 20:32:37 +0100 Subject: [PATCH] * grub-core/gnulib/argp-fmtstream.c (__argp_get_display_len): Stop on \0. (add_length): Likewise. --- ChangeLog | 6 ++++++ grub-core/gnulib/argp-fmtstream.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 64c5c5e8b..11af20921 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-02-26 Vladimir Serbinenko + + * grub-core/gnulib/argp-fmtstream.c (__argp_get_display_len): Stop on + \0. + (add_length): Likewise. + 2012-02-26 Vladimir Serbinenko 2012-02-26 Lubomir Kundrak diff --git a/grub-core/gnulib/argp-fmtstream.c b/grub-core/gnulib/argp-fmtstream.c index f0ceade28..01e7a478f 100644 --- a/grub-core/gnulib/argp-fmtstream.c +++ b/grub-core/gnulib/argp-fmtstream.c @@ -127,7 +127,7 @@ __argp_get_display_len (char *beg, char *end) memset (&ps, 0, sizeof (ps)); - for (ptr = beg; ptr < end; ) + for (ptr = beg; ptr < end && *ptr; ) { wchar_t wc; size_t s; @@ -148,7 +148,7 @@ add_length (char *ptr, char *end, size_t l) memset (&ps, 0, sizeof (ps)); - while (ptr < end) + while (ptr < end && *ptr) { wchar_t wc; size_t s, k;