diff options
author | Jim Meyering <meyering@fb.com> | 2015-01-01 14:59:00 -0800 |
---|---|---|
committer | Jim Meyering <meyering@fb.com> | 2015-01-08 13:41:37 -0800 |
commit | 9aedd79729193d57939dd171850eb2d44d28eecb (patch) | |
tree | 0094f05544bdaea5d13d5018c898768b681c5597 /src | |
parent | c2d0489c43264b25f063058c4c34a66e2445abae (diff) | |
download | grep-9aedd79729193d57939dd171850eb2d44d28eecb.tar.gz |
grep: avoid false-positive UMR
For some inputs, valgrind would report an uninitialized
memory read error, but it was harmless.
* src/grep.c (fillbuf): Initialize those trailing bytes.
Diffstat (limited to 'src')
-rw-r--r-- | src/grep.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -810,6 +810,12 @@ fillbuf (size_t save, struct stat const *st) fillsize = undossify_input (readbuf, fillsize); buflim = readbuf + fillsize; + + /* Initialize the following word, because skip_easy_bytes and some + matchers read (but do not use) those bytes. This avoids false + positive reports of these bytes being used uninitialized. */ + memset (buflim, 0, sizeof (uword)); + return cc; } |