-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
rb_version_sort_1 manually allocates/frees versions which doesn't play nice with exceptions.
This is reasonably hard to hit but can be triggered by:
VersionSorter.sort(["1"]) { |x| raise 'oh noes' }
which causes an exception to be throw by rb_yield:
version_sorter/ext/version_sorter/version_sorter.c
Lines 193 to 194 in fca9ae5
| if (rb_block_given_p()) | |
| rb_version_string = rb_yield(rb_version); |
and
VersionSorter.sort ["\0"]
which causes an exception to be thrown by StringValueCStr because it contains embedded NULs:
| versions[i] = parse_version_number(StringValueCStr(rb_version_string)); |
Metadata
Metadata
Assignees
Labels
No labels