Skip to content

Commit

Permalink
cfg parser: Fix underflow with an empty mpath
Browse files Browse the repository at this point in the history
(cherry picked from commit 9e07f3f)
  • Loading branch information
liviuchircu committed Jul 3, 2017
1 parent 8c35fc4 commit eaafc9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cfg.y
Expand Up @@ -1082,7 +1082,7 @@ assign_stm: DEBUG EQUAL snumber
| TOS EQUAL error { yyerror("number expected"); }
| MPATH EQUAL STRING { mpath=$3; strcpy(mpath_buf, $3);
mpath_len=strlen($3);
if(mpath_buf[mpath_len-1]!='/') {
if(mpath_len==0 || mpath_buf[mpath_len-1]!='/') {
mpath_buf[mpath_len]='/';
mpath_len++;
mpath_buf[mpath_len]='\0';
Expand Down

0 comments on commit eaafc9b

Please sign in to comment.