Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix segmentation fault caused by findMatchedDelim unsafe NULL pointer #1094

Merged
merged 1 commit into from
May 20, 2020
Merged

Fix segmentation fault caused by findMatchedDelim unsafe NULL pointer #1094

merged 1 commit into from
May 20, 2020

Conversation

ddelemeny
Copy link

built on current master.

In the code editor, trying to highlight a matching delimiter in the following code will cause segmentation fault.

func())))))

findMatchedDelim may return NULL, which should instantaneously break out of the loop and avoid dereferencing a NULL pointer when checking for the loop condition.

Also, the current pointer should probably be bound by TIC_CODE_SIZE (it currently isn't and looks like it can go outside of the code memory segment).

@ddelemeny ddelemeny changed the title findMatchedDelim unsafe NULL pointer causes segmentation fault Fix segmentation fault caused by findMatchedDelim unsafe NULL pointer May 20, 2020
Copy link
Owner

@nesbox nesbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@nesbox nesbox merged commit a2e8aa7 into nesbox:master May 20, 2020
@nesbox nesbox added this to the 0.80.0 milestone May 20, 2020
@nesbox nesbox added bug editor: code Issues related to code editor labels May 20, 2020
@ddelemeny ddelemeny deleted the bugfix-find-delim-segfault branch May 21, 2020 09:53
@nesbox nesbox removed this from the 0.80.0 milestone Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug editor: code Issues related to code editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants