io_delimited_ios_hotpatch.cr v0.2.0
io_delimited_ios_hotpatch
Recent versions of Crystal -- 1.12.2, at least, though maybe other versions, as well -- have a bug that can be exposed by doing a file upload with a multipart form, from an iOS platform. The problem is still be isolated in specific detail, but the failure is related to a Slice overrun. Something about how iOS is returning the data triggers an execution path that results in IO::Delimited#read_with_peek attempting to copy more data into a buffer than there is space for it.
This current fix doesn't address the root problem, but it does address the symptom. It adds a check to IO::Delimited#read_with_peek to ensure that the buffer has enough space for the data that is being copied into it. If it doesn't, the buffer is resized to be large enough.
Installation
-
Add the dependency to your
shard.yml
:dependencies: io_delimited_ios_hotpatch: github: wyhaines/io_delimited_ios_hotpatch.cr
-
Run
shards install
Usage
require "io_delimited_ios_hotpatch"
Contributing
- Fork it (https://github.com/wyhaines/io_delimited_ios_hotpatch/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Kirk Haines - creator and maintainer
io_delimited_ios_hotpatch.cr
- 0
- 0
- 0
- 0
- 0
- 2 months ago
- June 27, 2024
MIT License
Sun, 15 Sep 2024 08:58:23 GMT