X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/a9b809c796ca6f3fa174c204ae67979ae1706622..1ccc642277721bfb8b7108c2c05edf7c921acbfb:/ircd/ircd_lexer.l diff --git a/ircd/ircd_lexer.l b/ircd/ircd_lexer.l index 7112cc30..0268341a 100644 --- a/ircd/ircd_lexer.l +++ b/ircd/ircd_lexer.l @@ -58,7 +58,7 @@ char *current_file = conffilebuf; FILE *inc_fbfile_in[MAX_INCLUDE_DEPTH]; -char linebuf[512]; +char yy_linebuf[16384]; #undef YY_INPUT @@ -79,7 +79,7 @@ include \.include{ws}(\<.*\>|\".*\") %% {include} { cinclude(); } "/*" { ccomment(); } -\n.* { strcpy(linebuf, yytext+1); lineno++; yyless(1); } +\n.* { rb_strlcpy(yy_linebuf, yytext+1, sizeof(yy_linebuf)); lineno++; yyless(1); } {ws} ; {comment} { hashcomment(); } @@ -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; } @@ -196,7 +196,7 @@ void cinclude(void) /* if its not found in PREFIX, look in IRCD_PATH_ETC */ char fnamebuf[BUFSIZE]; - snprintf(fnamebuf, sizeof(fnamebuf), "%s%c%s", ircd_paths[IRCD_PATH_ETC], RB_PATH_SEPARATOR, c); + snprintf(fnamebuf, sizeof(fnamebuf), "%s/%s", ircd_paths[IRCD_PATH_ETC], c); tmp_fbfile_in = fopen(fnamebuf, "r"); /* wasnt found there either.. error. */ @@ -251,6 +251,6 @@ void hashcomment(void) if (strlen(yytext) < sizeof(INCLUDE) - 1) return; - if (!strncasecmp(yytext, INCLUDE, sizeof(INCLUDE) - 1)) + if (!rb_strncasecmp(yytext, INCLUDE, sizeof(INCLUDE) - 1)) yyerror("You probably meant '.include', skipping"); }