From d539f227824950817e7b26a5637c9dfb85d8ffa1 Mon Sep 17 00:00:00 2001 From: Aaron Jones Date: Sun, 15 May 2016 00:57:16 +0000 Subject: [PATCH] ircd_lexer: fix another crash with the same cause --- ircd/ircd_lexer.l | 4 ++-- ircd/ircd_parser.y | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ircd/ircd_lexer.l b/ircd/ircd_lexer.l index 99ce22cd..46514cbf 100644 --- a/ircd/ircd_lexer.l +++ b/ircd/ircd_lexer.l @@ -94,7 +94,7 @@ include \.include{ws}(\<.*\>|\".*\") } else { - strcpy(yylval.string, yytext + 1); + rb_strlcpy(yylval.string, yytext + 1, 1024); if(yylval.string[yyleng-2] != '"') ilog(L_MAIN, "Unterminated character string"); else @@ -134,7 +134,7 @@ include \.include{ws}(\<.*\>|\".*\") loadmodule { return LOADMODULE; } {string} { - strcpy(yylval.string, yytext); + rb_strlcpy(yylval.string, yytext, 1024); yylval.string[yyleng] = '\0'; return STRING; } diff --git a/ircd/ircd_parser.y b/ircd/ircd_parser.y index f07c3f9a..d1dee1b2 100644 --- a/ircd/ircd_parser.y +++ b/ircd/ircd_parser.y @@ -160,7 +160,7 @@ static void add_cur_list(int type, char *str, int number) %union { int number; - char string[BUFSIZE + 1]; + char string[1024]; conf_parm_t * conf_parm; }