summaryrefslogtreecommitdiff
path: root/src/pcresearch.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-06-19 22:49:07 +0200
committerJim Meyering <meyering@redhat.com>2011-06-19 22:54:16 +0200
commitf97bf2652b87a094b1e6cf6dcd2f4f7526c35cc2 (patch)
treef144e3460c9f50eabc5f5bf4f7ae152f82db583c /src/pcresearch.c
parent2c6e32fdd2fb64dd6a6cbd18617bcde4b255484c (diff)
downloadgrep-f97bf2652b87a094b1e6cf6dcd2f4f7526c35cc2.tar.gz
dfa: avoid possibility of overflow
* src/dfa.c (REALLOC_IF_NECESSARY, CALLOC, MALLOC, REALLOC): Use functions from xalloc.h to avoid overflow. * src/dfasearch.c (GEAcompile): Use xnrealloc rather than realloc. * src/pcresearch.c (Pcompile): Use xnmalloc, not xmalloc.
Diffstat (limited to 'src/pcresearch.c')
-rw-r--r--src/pcresearch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pcresearch.c b/src/pcresearch.c
index 52db9878..e8c7f4b3 100644
--- a/src/pcresearch.c
+++ b/src/pcresearch.c
@@ -44,7 +44,7 @@ Pcompile (char const *pattern, size_t size)
#else
int e;
char const *ep;
- char *re = xmalloc (4 * size + 7);
+ char *re = xnmalloc (4, size + 7);
int flags = PCRE_MULTILINE | (match_icase ? PCRE_CASELESS : 0);
char const *patlim = pattern + size;
char *n = re;