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

Robustness #7

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Robustness #7

wants to merge 8 commits into from

Conversation

jpcima
Copy link

@jpcima jpcima commented Jan 28, 2019

  • fix a buffer overflow in tempo change parsing. test case 16-elo_1977-birmingham_blues-[k].mid.gz
  • fix an assertion raised in the sysex size routine, also used by escape events (F7). fixed also a size check in escape events, which can allow the input to create an invalid size 0 event; unlike sysex, this one does not have an implied status byte. 01-pink_floyd_1975-shine_on_you_crazy_diamond_(part_1).mid.gz
  • fix the case of truncated files, where the track length will extend beyond the file buffer without a check, resulting in a buffer overflow. test case try_get_along.mid.gz
  • fix heap use after free, by stopping after the first track which fails parsing. same file as above
  • in a case when the track does not end with the EOT meta-event, the library can attempt to parse an event from a 0-length buffer, and raise an assertion. 04-mark_knopfler_&_chet_atkins_1990-just_on_time-[demo].mid.gz
  • fix the assertion is_sysex_byte(status) which raises when the sysex or escape event tries to use running status. this is non-standard and libsmf does not support it, so I enforced the check, however some files will use it anyway. test case tmm_Kag_Theme.mid.gz
  • fix the logic error which will let escape events through only if they are invalid.. although it's logical, this may degrade compatibility with non-standard files. if libsmf must support wider cases of escape events, it should implement proper support. test case Main_Lobby.mid.gz
  • fix a memory leak in case of failure in smf_load_from_memory

pauldavisthefirst pushed a commit to Ardour/ardour that referenced this pull request Jul 16, 2020
see also stump/libsmf#7

* Fix validity checks of escaped data
* Handle non-EOT-terminated tracks.
* Fix buffer overflow on tempo change event
* Fix memory leaks in case loading fails
* Fix a logic errors in extract_escaped_event()
* Fix the assertion problem `is_sysex_byte(status)`
* Make libsmf more tolerant to malformed MIDI files.
  (fixes import of files generated by NoteEdit)
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.

1 participant