Skip to content

Commit 3a6cd7f

Browse files
committed
Fix: missing out-of-bounds check in parse_sequence
1 parent de5ee13 commit 3a6cd7f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/fpm_source_parsing.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ function parse_sequence(string,t1,t2,t3,t4) result(found)
614614
select case(token_n)
615615
case(1)
616616
incr = len(t1)
617+
if (pos+incr-1>n) return
617618
match = string(pos:pos+incr-1) == t1
618619
case(2)
619620
if (.not.present(t2)) exit

0 commit comments

Comments
 (0)