summaryrefslogtreecommitdiff
path: root/src/lib/evil
diff options
context:
space:
mode:
authorYeshwanth Reddivari <r.yeshwanth@samsung.com>2015-11-09 16:10:59 -0800
committerCedric BAIL <cedric@osg.samsung.com>2015-11-09 16:11:01 -0800
commita605bd8498ead542405941c1f722b3b4080ad6ed (patch)
treeb897686dea6c4b44848fe0849fb09d11300fe491 /src/lib/evil
parent0cf357c0296f9e2b2dc59e523551f87fbf34d7e4 (diff)
evil: avoid SIGSEV while using strlen function
Summary: Assertion of (fp!=NULL) should be done before passing fp to strlen funcion Reviewers: singh.amitesh, Hermet, alok25, mvsovani, vtorri Subscribers: sachin.dev, cedric Differential Revision: https://phab.enlightenment.org/D3274 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/evil')
-rw-r--r--src/lib/evil/regex/regcomp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/evil/regex/regcomp.c b/src/lib/evil/regex/regcomp.c
index 080d292700..c1b7850504 100644
--- a/src/lib/evil/regex/regcomp.c
+++ b/src/lib/evil/regex/regcomp.c
@@ -1179,9 +1179,10 @@ register cset *cs;
1179register char *cp; 1179register char *cp;
1180{ 1180{
1181 register char *fp = mcfind(cs, cp); 1181 register char *fp = mcfind(cs, cp);
1182 register size_t len = strlen(fp); 1182 register size_t len;
1183 1183
1184 assert(fp != NULL); 1184 assert(fp != NULL);
1185 len = strlen(fp);
1185 (void) memmove(fp, fp + len + 1, 1186 (void) memmove(fp, fp + len + 1,
1186 cs->smultis - (fp + len + 1 - cs->multis)); 1187 cs->smultis - (fp + len + 1 - cs->multis));
1187 cs->smultis -= len; 1188 cs->smultis -= len;