Skip to content

Fix bit shift overflow when reading cartridge size from header#2

Open
clobber wants to merge 1 commit into
gstanton:masterfrom
clobber:patch-2
Open

Fix bit shift overflow when reading cartridge size from header#2
clobber wants to merge 1 commit into
gstanton:masterfrom
clobber:patch-2

Conversation

@clobber

@clobber clobber commented Nov 21, 2019

Copy link
Copy Markdown

left shift count >= width of type

With optimization on, cartridge_size will result in garbage/undefined behavior and break loading of games not found in the database, because the size will always be > 131072 and wrongly identify cartridge_type as CARTRIDGE_TYPE_SUPERCART_LARGE

`left shift count >= width of type`

With optimization on, `cartridge_size` will result in garbage/undefined behavior and break loading of games not found in the database, because the size will always be > 131072 and wrongly identify `cartridge_type` as `CARTRIDGE_TYPE_SUPERCART_LARGE`
@JoeMatt

JoeMatt commented Jan 24, 2022

Copy link
Copy Markdown

Seems like this is dead, but I merged #1 and #2 into https://github.com/Provenance-Emu/ProSystem1_3

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.

2 participants