Comments (8)
moving it to below does indeed fix the issue, but another arises where close() does not update the buffer because of an issue with zip_source_read
always returning 0 even when the buffer has been altered. Also, ::New segfaults outright.
from libzippp.
Hi @Trico-Everfire,
Can you give the code location you're looking at ? Also, do you have a test case ?
from libzippp.
Hi @Trico-Everfire, Can you give the code location you're looking at ? Also, do you have a test case ?
https://github.com/ctabin/libzippp/blob/master/src/libzippp.cpp#L393-L443
from libzippp.
The test case is the example code you provide in the readme.
from libzippp.
same problem using similar to readme code
string path="some valid path";
const unsigned int folderSize=privateFunctions::dirSize(path);
void* buffer = calloc(folderSize, sizeof(char));
libzippp::ZipArchive* zip=libzippp::ZipArchive::fromWritableBuffer(&buffer, folderSize, libzippp::ZipArchive::New);
zip->addEntry(path);
zip->close(); //segfaults here
libzippp::ZipArchive::free(zip);
free(buffer);
from libzippp.
It's the same for everyone as zip->close() is crucial to the saving process, it will always crash in all use cases. I would go about fixing it myself, and the base problem is pretty fixable, the rest of the problem regarding the second problem I had with this leads all the way into zlib, so for the sake of my own sanity I wrote my own zip library that does not handle compression, just opening a zip and saving it to a buffer.
from libzippp.
Thanks for the feedback, I'll take a look at it asap. In the meantime, a PR is always welcome.
from libzippp.
It seems that ~ZipArchive
calls close
once again, which doesn't seem to be supported.
from libzippp.
Related Issues (20)
- Issue opening zip file (constructor or .open() call) HOT 3
- Minor: when the zip is aborted the percent is modified to 100% HOT 3
- Set compression method in addData
- ZipArchive::readEntry doesn't handle entries of zero size
- Add the possibility to set the compression level
- setCompressionMethod silently fail when the archive is not yet opened
- Is it possible to incrementally append data to a file already added to an archive? HOT 1
- Memory leak when archive `close` is not successful HOT 2
- Modification Time Not Updated for Overwritten Files in Zip Archive
- [macOS] After unzip archive binary file become text file HOT 1
- The install of libzippp.pc is not working HOT 1
- LIBZIPPP_ENABLE_ENCRYPTION does not set LIBZIPPP_WITH_ENCRYPTION in .pc file
- BUG: null pointer dereference after cancelling a `close()` HOT 2
- Issue when closing a zip HOT 3
- Extract have something wrong HOT 4
- Failed to build in Codespace HOT 8
- ZipArchive::addFile needs variant with std::wstring HOT 3
- Archive with encryption causes zip_fopen_index() to fail HOT 2
- Add data files and then delete other entries, abnormal data will appear in the zip archive. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libzippp.