Skip to content

Commit cb407ee

Browse files
committed
Perl: limit the acceptable characters used in heredoc markers
Signed-off-by: Masatake YAMATO <[email protected]>
1 parent 6427caf commit cb407ee

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

parsers/perl.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -547,11 +547,6 @@ static const unsigned char *collectHereDocMarker (struct hereDocMarkerManager *m
547547
if (*cp == '\0')
548548
return NULL;
549549

550-
/* Is shift operator? */
551-
if (isdigit (*cp))
552-
/* Scan the rest of the string. */
553-
return cp + 1;
554-
555550
if (*cp == '~') {
556551
if (space_seen)
557552
return cp + 1;
@@ -578,6 +573,8 @@ static const unsigned char *collectHereDocMarker (struct hereDocMarkerManager *m
578573
return NULL;
579574
break;
580575
default:
576+
if (!isIdentifier1(*cp))
577+
return cp;
581578
if (space_seen)
582579
return cp;
583580
break;

0 commit comments

Comments
 (0)