Coder Social home page Coder Social logo

Comments (8)

Trico-Everfire avatar Trico-Everfire commented on August 26, 2024

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.

ctabin avatar ctabin commented on August 26, 2024

Hi @Trico-Everfire,
Can you give the code location you're looking at ? Also, do you have a test case ?

from libzippp.

Trico-Everfire avatar Trico-Everfire commented on August 26, 2024

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.

Trico-Everfire avatar Trico-Everfire commented on August 26, 2024

The test case is the example code you provide in the readme.

from libzippp.

elliopitas avatar elliopitas commented on August 26, 2024

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.

Trico-Everfire avatar Trico-Everfire commented on August 26, 2024

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.

ctabin avatar ctabin commented on August 26, 2024

Thanks for the feedback, I'll take a look at it asap. In the meantime, a PR is always welcome.

from libzippp.

flomnes avatar flomnes commented on August 26, 2024

It seems that ~ZipArchive calls close once again, which doesn't seem to be supported.

from libzippp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.