From 275568816c7ad9c70e140b1dfabfc234da685f2f Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Thu, 9 Feb 2012 14:24:55 +0100 Subject: [PATCH] * grub-core/lib/posix_wrap/wchar.h (mbrtowc): Set pwc to zero to avoid uninited variable. --- ChangeLog | 5 +++++ grub-core/lib/posix_wrap/wchar.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6be07c37e..1e3176e63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-02-09 Vladimir Serbinenko + + * grub-core/lib/posix_wrap/wchar.h (mbrtowc): Set pwc to zero to avoid + uninited variable. + 2012-02-08 Vladimir Serbinenko * util/grub-mknetdir.in: Use . rather than source for POSIX diff --git a/grub-core/lib/posix_wrap/wchar.h b/grub-core/lib/posix_wrap/wchar.h index 371133880..fb90cc044 100644 --- a/grub-core/lib/posix_wrap/wchar.h +++ b/grub-core/lib/posix_wrap/wchar.h @@ -51,6 +51,9 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) n = 1; } + if (pwc) + *pwc = 0; + for (ptr = s; ptr < s + n; ptr++) { if (!grub_utf8_process (*ptr, &ps->code, &ps->count))