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

Avoid NULL dereference when typing a dot in a file without tags #943

Merged
merged 1 commit into from Mar 7, 2016

Conversation

b4n
Copy link
Member

@b4n b4n commented Mar 7, 2016

@techee NULL check was removed in 292383c, was that really expected?
Other solution would be early return in autocomplete_scope() when doc->tm_file is NULL, but that would mean that there wouldn't be scope completion in unsaved files.

We need a fix ASAP, as it happens whenever typing . in an unsaved file, or a file with no tags parser. E.g. you can reproduce by opening a new geany geany -vi and typing a., boom.

@b4n b4n added this to the 1.27 milestone Mar 7, 2016
@b4n b4n added the bug label Mar 7, 2016
@techee
Copy link
Member

techee commented Mar 7, 2016

@b4n Ah, I assumed there's always a TMSourceFile available for any GeanyDocument (I assumed there would be a NONE type TMSourceFile for an untitled document). I just wanted to get rid of the -1 which correspons to LANG_AUTO that we shouldn't use. Using TM_PARSER_NONE is perfectly fine and logical in this case so your patch LGTM.

@b4n
Copy link
Member Author

b4n commented Mar 7, 2016

No, we only have a TMSourceFile when we actually have a parser setup. We don't even have a TMSourceFile before saving the first time (for now).

@b4n b4n merged commit 6818ba6 into geany:master Mar 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants