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 crash in filetoMimeType and remove ancient Solaris hack #1318

Merged
merged 1 commit into from
Mar 16, 2021

Conversation

whorfin
Copy link
Contributor

@whorfin whorfin commented Mar 16, 2021

13 years ago in the original mediatomb, a hack was done to allow printf() of a NULL pointer to print "NULL" rather than crash, on Solaris
That was done by mapping *0=0 behind the scenes, which makes a null dereference no longer an immediate crash, which it otherwise is on Solaroid machines, and quite deliberately
No, just, no - a nullptr dereference is a bug
Removed
And then I rather quickly found a crash which was hiding behind a totally messed up stack otherwise
Mime::fileToMimeType was blindly dereferencing a nullptr to see if it pointed to an empty string

Fix null dereference in Mime::fileToMimeType
@whyman
Copy link
Member

whyman commented Mar 16, 2021

That was done by mapping *0=0 behind the scenes, which makes a null dereference no longer an immediate crash, which it otherwise is on Solaroid machines, and quite deliberately

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

3 participants