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 undefined behaviour when loading non-existant credentials #4674

Merged
merged 3 commits into from
Jun 10, 2023

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Jun 9, 2023

Description

If instance is an empty JSON-value (e.g. when credentails.json doesn't exist), object yields an empty object and thus calling find yields end which is basically a null-pointer-QJsonRef. Calling toString on it will cause an assertion to go off.

This function is called when you add an IRC server.

@pajlada pajlada self-requested a review June 9, 2023 11:59
@pajlada pajlada changed the title Fix UB in Credentials.cpp Fix undefined behaviour when loading non-existant credentials Jun 10, 2023
@pajlada pajlada enabled auto-merge (squash) June 10, 2023 09:29
@pajlada pajlada merged commit f0c4eb7 into Chatterino:master Jun 10, 2023
13 checks passed
@Nerixyz Nerixyz deleted the fix/ub branch June 10, 2023 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants