summaryrefslogtreecommitdiffstats
path: root/src/read_config_lex.l
diff options
context:
space:
mode:
authorAsh Hughes <sehguh.hsa@gmail.com>2019-05-30 21:49:56 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2019-07-03 01:58:59 +0200
commitc12fa8df76752b0a011430f069677b52e4dad164 (patch)
tree9542c103c42b94ee1aa307f3c1a3c8758beb0b85 /src/read_config_lex.l
parent5ededc4476f27e74f49f37ce646dabc1def7d4dc (diff)
conntrackd: Use strdup in lexer
Use strdup in the config file lexer to copy strings to yylval.string. This should solve the "[ERROR] unknown layer 3 protocol" problem here: https://www.spinics.net/lists/netfilter/msg58628.html. Signed-off-by: Ash Hughes <sehguh.hsa@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/read_config_lex.l')
-rw-r--r--src/read_config_lex.l8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/read_config_lex.l b/src/read_config_lex.l
index 120bc00..b0d9e61 100644
--- a/src/read_config_lex.l
+++ b/src/read_config_lex.l
@@ -142,9 +142,9 @@ notrack [N|n][O|o][T|t][R|r][A|a][C|c][K|k]
{is_off} { return T_OFF; }
{integer} { yylval.val = atoi(yytext); return T_NUMBER; }
{signed_integer} { yylval.val = atoi(yytext); return T_SIGNED_NUMBER; }
-{ip4} { yylval.string = yytext; return T_IP; }
-{ip6} { yylval.string = yytext; return T_IP; }
-{path} { yylval.string = yytext; return T_PATH_VAL; }
+{ip4} { yylval.string = strdup(yytext); return T_IP; }
+{ip6} { yylval.string = strdup(yytext); return T_IP; }
+{path} { yylval.string = strdup(yytext); return T_PATH_VAL; }
{alarm} { return T_ALARM; }
{persistent} { dlog(LOG_WARNING, "Now `persistent' mode "
"is called `alarm'. Please, update "
@@ -156,7 +156,7 @@ notrack [N|n][O|o][T|t][R|r][A|a][C|c][K|k]
"your conntrackd.conf file.\n");
return T_FTFW; }
{notrack} { return T_NOTRACK; }
-{string} { yylval.string = yytext; return T_STRING; }
+{string} { yylval.string = strdup(yytext); return T_STRING; }
{comment} ;
{ws} ;