ircd_lexer: fix crash with very large config option strings
This commit is contained in:
parent
96129f7d4d
commit
f55078bdc7
2 changed files with 4 additions and 4 deletions
|
@ -62,7 +62,7 @@ char *current_file = conffilebuf;
|
||||||
|
|
||||||
FILE *inc_fbfile_in[MAX_INCLUDE_DEPTH];
|
FILE *inc_fbfile_in[MAX_INCLUDE_DEPTH];
|
||||||
|
|
||||||
char linebuf[512];
|
char yy_linebuf[16384];
|
||||||
|
|
||||||
#undef YY_INPUT
|
#undef YY_INPUT
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ include \.include{ws}(\<.*\>|\".*\")
|
||||||
%%
|
%%
|
||||||
{include} { cinclude(); }
|
{include} { cinclude(); }
|
||||||
"/*" { ccomment(); }
|
"/*" { ccomment(); }
|
||||||
\n.* { strcpy(linebuf, yytext+1); lineno++; yyless(1); }
|
\n.* { rb_strlcpy(yy_linebuf, yytext+1, sizeof(yy_linebuf)); lineno++; yyless(1); }
|
||||||
|
|
||||||
{ws} ;
|
{ws} ;
|
||||||
{comment} { hashcomment(); }
|
{comment} { hashcomment(); }
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
struct config_server_hide ConfigServerHide;
|
struct config_server_hide ConfigServerHide;
|
||||||
|
|
||||||
extern int yyparse(void); /* defined in y.tab.c */
|
extern int yyparse(void); /* defined in y.tab.c */
|
||||||
extern char linebuf[];
|
extern char yy_linebuf[16384]; /* defined in ircd_lexer.l */
|
||||||
|
|
||||||
#ifndef INADDR_NONE
|
#ifndef INADDR_NONE
|
||||||
#define INADDR_NONE ((unsigned int) 0xffffffff)
|
#define INADDR_NONE ((unsigned int) 0xffffffff)
|
||||||
|
@ -1647,7 +1647,7 @@ yyerror(const char *msg)
|
||||||
{
|
{
|
||||||
char newlinebuf[BUFSIZE];
|
char newlinebuf[BUFSIZE];
|
||||||
|
|
||||||
strip_tabs(newlinebuf, linebuf, strlen(linebuf));
|
strip_tabs(newlinebuf, yy_linebuf, strlen(yy_linebuf));
|
||||||
|
|
||||||
ierror("\"%s\", line %d: %s at '%s'", conffilebuf, lineno + 1, msg, newlinebuf);
|
ierror("\"%s\", line %d: %s at '%s'", conffilebuf, lineno + 1, msg, newlinebuf);
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL, "\"%s\", line %d: %s at '%s'",
|
sendto_realops_snomask(SNO_GENERAL, L_ALL, "\"%s\", line %d: %s at '%s'",
|
||||||
|
|
Loading…
Reference in a new issue