-
Notifications
You must be signed in to change notification settings - Fork 255
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
#parse_buffer
unexpectedly modifies input buffer
#453
Comments
You see, I'm temped to NOT do anything about this issue in |
I confirmed that this issue is resolved with rubyzip 2.4.rc1. I hope to close this issue with an rubyzip official release and an upgrade of rubyzip's dependencies. |
Yes, I tried to update gems but rubyzip is not showing up as updated. I assume the reason is that it's RC and not released yet. Once it is, I will update dependencies. |
It has been nearly 5 months but the latest version on Rubygems is still |
Thank you for creating such a wonderful library.
I noticed that
RubyXL::Parser.parse_buffer
implicitly changes thebuffer
received as an argument.But considering the name
#parse_buffer
, I don't think the passed argumentbuffer
should be modifed.Below is the minimal example.
buffer
has been modified and increased in size.The cause was that when
Zip::File.open_buffer
was called with block, the supplied argumentbuffer
was changed.https://github.com/rubyzip/rubyzip/blob/73c8e110ed1dbcff08ffa48bb1b094abd0348502/lib/zip/file.rb#L122
I think we can fix this problem by not using block.
→ I also created a PR. #454
It's a minor problem, but I get it sometimes, so I think it would be nice if it could be fixed.
In my case, I discovered this problem because when I attached the parsed Excel file to an email, the Excel file was corrupted.
The text was updated successfully, but these errors were encountered: