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

handle null chars in dxorg.cpp:getValueFromSysFsFile() #280

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

emerge-e-world
Copy link

QString truncates strings after the first null character. If a sysfs file contains null chars in the middle of its contents, the output of getValueFromSysFsFile() is incomplete.

This fix replaces all occurrences of null chars in the QByteArray returned from QFile::readAll() before converting it to a QString.

This fixes segfaults on startup when incomplete pp_od_clk_voltage tables are being parsed (#279).

QString truncates strings after the first occurance of a null character. If a sysfs file contains null characters in the middle of the contents, the output of getValueFromSysFsFile() is incomplete.

This replaces all occurances of null chars in the QByteArray returned from QFile::readAll() before converting it to a QString.
This also fixes segfaults on startup when incomplete pp_od_clk_voltage tables are being parsed.
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

1 participant