We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4da0b6e + 2412df4 commit 1169c76Copy full SHA for 1169c76
src/globals.c
@@ -1395,7 +1395,8 @@ void error(char *msg)
1395
start_idx = offset + 1;
1396
1397
for (offset = 0;
1398
- offset < MAX_SOURCE && SOURCE->elements[start_idx + offset] != '\n';
+ offset < MAX_SOURCE && (start_idx + offset) < SOURCE->size &&
1399
+ SOURCE->elements[start_idx + offset] != '\n';
1400
offset++) {
1401
diagnostic[i++] = SOURCE->elements[start_idx + offset];
1402
}
0 commit comments