summaryrefslogtreecommitdiff
path: root/src/dfasearch.c
diff options
context:
space:
mode:
authorNorihiro Tanaka <noritnk@kcn.ne.jp>2015-08-11 00:37:00 +0900
committerJim Meyering <meyering@fb.com>2015-08-19 16:52:19 -0700
commit8a33cdeba4ba032f3d0efebf230b86971c27e158 (patch)
treecbaeae72fd2187b5df77518dcc2e188b17495f1a /src/dfasearch.c
parent936c904a79285c42adbfc67c508b27d5717c2936 (diff)
downloadgrep-8a33cdeba4ba032f3d0efebf230b86971c27e158.tar.gz
grep: avoid use of uninitialized variable
EGexecute would use "backref" uninitialized. While that could have no bearing on correctness, it could impact performance, via an unnecessary use of regexp. * src/dfasearch.c (EGexecute): Initialize backref. Reported as http://debbugs.gnu.org/21273 Introduced by commit v2.21-55-gea0ebaa.
Diffstat (limited to 'src/dfasearch.c')
-rw-r--r--src/dfasearch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dfasearch.c b/src/dfasearch.c
index 8b8af066..de513213 100644
--- a/src/dfasearch.c
+++ b/src/dfasearch.c
@@ -207,7 +207,6 @@ EGexecute (char const *buf, size_t size, size_t *match_size,
{
char const *buflim, *beg, *end, *ptr, *match, *best_match, *mb_start;
char eol = eolbyte;
- int backref;
regoff_t start;
size_t len, best_len;
struct kwsmatch kwsm;
@@ -227,6 +226,7 @@ EGexecute (char const *buf, size_t size, size_t *match_size,
char const *next_beg, *dfa_beg = beg;
size_t count = 0;
bool exact_kwset_match = false;
+ int backref = 0;
/* Try matching with KWset, if it's defined. */
if (kwset)