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

Some ROMs can cause a corruption to ROM list and Menu Layout #257

Closed
intvsteve opened this Issue Feb 3, 2019 · 1 comment

Comments

1 participant
@intvsteve
Copy link
Owner

intvsteve commented Feb 3, 2019

Operating system version

Any

Program version (from About box)

1.0.0.3865

Expected behavior

It works - you can add a ROM and it doesn't corrupt your files.

Actual behavior

Adding certain ROM files can corrupt your ROM list and menu!

Steps to reproduce

Adding a certain kind of ROM can cause a corruption.

Crash log if available (paste or attach)

N/A

@intvsteve intvsteve added the bug label Feb 3, 2019

@intvsteve intvsteve self-assigned this Feb 3, 2019

@intvsteve intvsteve added this to New Bugs in Bug Fixes via automation Feb 3, 2019

@intvsteve

This comment has been minimized.

Copy link
Owner Author

intvsteve commented Feb 3, 2019

This happens due to multiple causes, chiefly being too trusting in metadata parsing and not fully adhering to all the rules regarding the LUIGI format.

Need to check ROM format metadata as well.

@intvsteve intvsteve moved this from New Bugs to Bugs In Work in Bug Fixes Feb 6, 2019

@intvsteve intvsteve moved this from Bugs In Work to Unreleased Fixes in Bug Fixes Feb 13, 2019

intvsteve added a commit that referenced this issue Feb 22, 2019

Fix Issue #257 for insane program names
This change replaces the Name and ShortName on ProgramDescription in XML serialization with the MetadataString class.  This fixes issue #257, which is a crash due to bad data being parsed from ROM metadata.

The contributing factors were:
1. Bug parsing metadata from scrambled ROMs (fixed previously)
2. Bad behaviors in XmlSerializer - valid UNICODE strings containing non-XML-safe characters can be serialized, but not de-serialized
3. intvname would pass along arbitrary bytes

These are addressed in different ways.
Item 1 was addressed in commit 5446f34.

Item 3 was fixed in jzintv as of SVN revision 1840, though subsequent changes have improved upon the UTF-8 support. Those changes in jzintv result in 'unusual' characters being escaped when written to to .cfg files or returned via the intvname utility.

Item 2 is addressed in this change, via the MetadataString class and the altering of how ProgramDescription is serialized via XML.

The Copy test for ProgramDescription was updated to include the new XmlName and XmlShortName properties, as well as setting a non-trivial ShortName that requires escaping the characters.

Also, the XmlSerializer parsing tests were updated to test strings that needed to be escaped.  These are somewhat redundant, in that MetadataString already covers serialization of itself.  The new tests here validate the behaviors not of the XML parsing, so much as the correct API surface of the ProgramDescription class itself -- namely that its Name and ShortName properties behave correctly.

Further validation was done with hand testing on a large, existing ROM and menu layout.

intvsteve added a commit that referenced this issue Feb 22, 2019

Merge pull request #279 from intvsteve/intvsteve-relax-invalid-charac…
…ter-rejection

Fix Issue #257 - Crash with badly formed ROM name metadata

@intvsteve intvsteve closed this Feb 22, 2019

Bug Fixes automation moved this from Unreleased Fixes to Fixed Bugs Feb 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.