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

erlang: Fix crash parsing directives longer than 31 characters #3726

Merged
merged 1 commit into from
May 20, 2023

Conversation

b4n
Copy link
Member

@b4n b4n commented May 15, 2023

Even if they might not exist, fix the code not to crash on them.

The issue was that the pointer to the vString buffer holding the directive name was cached at its value right after the vString creation, yet that buffer might get realloc()ated if it grows past the initial length of 32, possibly making the initial pointer invalid.

Fix this by simply getting the pointer to the value later on.

Even if they might not exist, fix the code not to crash on them.

The issue was that the pointer to the vString buffer holding the
directive name was cached at its value right after the vString
creation, yet that buffer might get realloc()ated if it grows past the
initial length of 32, possibly making the initial pointer invalid.

Fix this by simply getting the pointer to the value later on.
@masatake masatake added this to the 6.1 milestone May 15, 2023
@masatake masatake merged commit dfabddc into universal-ctags:master May 20, 2023
@masatake
Copy link
Member

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants