GNU bug report logs - #20490
[PATCH] fixup: reference to uninitialized variable with invalid sequence

Previous Next

Package: sed;

Reported by: Jim Meyering <jim <at> meyering.net>

Date: Sun, 3 May 2015 02:10:05 UTC

Severity: normal

Tags: patch

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
Cc: bug-sed <at> gnu.org
Subject: Re: [PATCH] fixup: reference to uninitialized variable with invalid
 sequence
Date: Sat, 2 May 2015 19:09:16 -0700
[Message part 1 (text/plain, inline)]
On Wed, Nov 5, 2014 at 7:36 AM, Norihiro Tanaka <noritnk <at> kcn.ne.jp> wrote:
> Uninitialized variable are referred with invalid sequence in
> str_append_modified().
>
> When mbrtowc() returns (size_t) -1, wc is not changed, even if wc is
> uninitialized.  below may return unexpected result in order that the
> value is referred at a following position in source code.
>
>   $ echo a | LC_ALL=ja_JP.eucJP ./sed/sed -e 's/a/b\U\xb2c/'

Thank you for the patch and reproducer.
I've made some small improvements to the actual patch and
wrote a valgrind-using test that I'm adding to the test suite.
I've included your patch with an adjusted log, followed by
the changes I made to it in a separate commit. That commit
is separate solely to show what I've done; I will squash into your
commit before I push, followed by the test-adding commit.
[0001-sed-avoid-a-UMR-bug-when-processing-an-invalid-multi.patch (application/octet-stream, attachment)]
[0002-fixup-for-bug-fix-to-be-squashed.patch (application/octet-stream, attachment)]
[0003-tests-test-for-just-fixed-UMR-bug.patch (application/octet-stream, attachment)]

This bug report was last modified 10 years and 16 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.