diff options
Diffstat (limited to 'plugins/sudoers/toke.c')
-rw-r--r-- | plugins/sudoers/toke.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/sudoers/toke.c b/plugins/sudoers/toke.c index e31badf10..074e54a99 100644 --- a/plugins/sudoers/toke.c +++ b/plugins/sudoers/toke.c @@ -148,7 +148,7 @@ extern FILE *yyin, *yyout; /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) @@ -4147,18 +4147,21 @@ _push_include(char *path, bool isdir) /* push current state onto stack */ if (idepth >= istacksize) { + struct include_stack *new_istack; + if (idepth > MAX_SUDOERS_DEPTH) { sudoerserror(N_("too many levels of includes")); debug_return_bool(false); } istacksize += SUDOERS_STACK_INCREMENT; - istack = (struct include_stack *) realloc(istack, + new_istack = (struct include_stack *) realloc(istack, sizeof(*istack) * istacksize); - if (istack == NULL) { + if (new_istack == NULL) { warning(NULL); sudoerserror(NULL); debug_return_bool(false); } + istack = new_istack; } SLIST_INIT(&istack[idepth].more); if (isdir) { |