Skip to content

Commit f7ec17f

Browse files
committed
Fix bound check on #line directives
split[2] is used afterwards, so the minimum number of elements is 3 Fixes #233
1 parent ed140f4 commit f7ec17f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/arduino.cc/builder/filter_sketch_source.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func parseLineMarker(line string) string {
7979
// https://github.com/gcc-mirror/gcc/blob/edd716b6b1caa1a5cb320a8cd7f626f30198e098/gcc/c-family/c-ppoutput.c#L413-L415
8080

8181
split := strings.SplitN(line, " ", 3)
82-
if len(split) < 2 || split[0] != "#" {
82+
if len(split) < 3 || split[0] != "#" {
8383
return ""
8484
}
8585

0 commit comments

Comments
 (0)