Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e140e6e

Browse filesBrowse files
[3.13] gh-132769: Refactor possible read-out-of-bounds in lexer.c (GH-132770) (#132788)
gh-132769: Refactor possible read-out-of-bounds in `lexer.c` (GH-132770) (cherry picked from commit ea8ec95) Co-authored-by: sobolevn <mail@sobolevn.me>
1 parent cdabbc1 commit e140e6e
Copy full SHA for e140e6e

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎Parser/lexer/lexer.c

Copy file name to clipboardExpand all lines: Parser/lexer/lexer.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ set_fstring_expr(struct tok_state* tok, struct token *token, char c) {
140140
for (i = 0, j = 0; i < input_length; i++) {
141141
if (tok_mode->last_expr_buffer[i] == '#') {
142142
// Skip characters until newline or end of string
143-
while (tok_mode->last_expr_buffer[i] != '\0' && i < input_length) {
143+
while (i < input_length && tok_mode->last_expr_buffer[i] != '\0') {
144144
if (tok_mode->last_expr_buffer[i] == '\n') {
145145
result[j++] = tok_mode->last_expr_buffer[i];
146146
break;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.