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>
This commit is contained in:
Yeshwanth Reddivari 2015-11-09 16:10:59 -08:00 committed by Cedric BAIL
parent 0cf357c029
commit a605bd8498
1 changed files with 2 additions and 1 deletions

View File

@ -1179,9 +1179,10 @@ register cset *cs;
register char *cp;
{
register char *fp = mcfind(cs, cp);
register size_t len = strlen(fp);
register size_t len;
assert(fp != NULL);
len = strlen(fp);
(void) memmove(fp, fp + len + 1,
cs->smultis - (fp + len + 1 - cs->multis));
cs->smultis -= len;