Skip to content

Conversation

@mzxrules
Copy link
Contributor

@mzxrules mzxrules commented Jun 4, 2025

Contributions made in this pr are licensed under CC0

@Dragorn421 Dragorn421 added the One approval Has one approval, can be merged in 48 hours if nothing else comes up label Jun 6, 2025
@fig02 fig02 added the Waiting for author There are requested changes that have not been addressed label Jun 6, 2025
//! @bug fbIdx is a signed integer that can overflow into the negatives. When compiled with a C99+ compiler or IDO,
//! the remainder operator will yield -1 for odd negative values of fbIdx.
//! This results in an out of bounds array access in SysCfb_GetFbPtr due to the negative index value,
//! which will crash the game.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest something like

Suggested change
//! which will crash the game.
//! which will most likely read an invalid pointer (a NULL pointer in the case of all matching versions) and crash the game when trying to render to that "framebuffer".

to not make it sound like it's the OoB access which directly crashes the game

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea this is why i didn't bother stating that it crashes the game. It should be pretty obvious that fetching the color framebuffer pointer from an unintended memory address would lead to devastating consequences.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may as well not leave things up to interpretation though, right

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me, there isn't a good reason to explain what happens past the OOBs read. When you go beyond that point, there are so many different possible outcomes to consider, none of which are consistent, and none of which are important if your goal is to fix the bug.

Where I think I could be clearer is I could state that the oobs read happens when trying to retrieve the next framebuffer pointer. I think knowing that the color framebuffer pointer is being set to a garbage value is enough on it's own to hint that bad things are going to happen soon.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont see why we have to "hint" at anything. Its perfectly okay to say what will probably happen.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I don't know what would "probably" happen once the framebuffer ptr is assigned to garbage data.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what dragorn wrote is fine.

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

Labels

One approval Has one approval, can be merged in 48 hours if nothing else comes up Waiting for author There are requested changes that have not been addressed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants