diff options
Diffstat (limited to 'ld/ldlex.l')
-rw-r--r-- | ld/ldlex.l | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -431,18 +431,10 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* } <SCRIPT,EXPRESSION,WILD,VERS_NODE,INPUTLIST>"\""[^\"]*"\"" { - /* No matter the state, quotes - give what's inside. */ - bfd_size_type len; - yylval.name = xstrdup (yytext + 1); - /* PR ld/20906. A corrupt input file - can contain bogus strings. */ - len = strlen (yylval.name); - if (len > (bfd_size_type) yyleng - 2) - len = yyleng - 2; - yylval.name[len] = 0; - return NAME; - } + /* No matter the state, quotes give what's inside. */ + yylval.name = xmemdup (yytext + 1, yyleng - 2, yyleng - 1); + return NAME; + } <SCRIPT,EXPRESSION,WILD,VERS_START,VERS_NODE,VERS_SCRIPT,INPUTLIST>"\n" { lineno++; } |