From: Todd C. Miller Date: Sat, 15 Mar 2003 01:11:51 +0000 (+0000) Subject: regen X-Git-Tag: SUDO_1_6_7~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=37a1bfccd4883d557da0cb2c1e6578579da0a902;p=sudo regen --- diff --git a/lex.yy.c b/lex.yy.c index 122d59353..21a891624 100644 --- a/lex.yy.c +++ b/lex.yy.c @@ -2500,15 +2500,14 @@ fill_cmnd(s, len) { arg_len = arg_size = 0; - yylval.command.cmnd = (char *) malloc(len + 1); + yylval.command.cmnd = (char *) malloc(++len); if (yylval.command.cmnd == NULL) { yyerror("unable to allocate memory"); return; } /* copy the string and NULL-terminate it (escapes handled by fnmatch) */ - (void) strncpy(yylval.command.cmnd, s, len); - yylval.command.cmnd[len] = '\0'; + (void) strlcpy(yylval.command.cmnd, s, len); yylval.command.args = NULL; }