Giter VIP home page Giter VIP logo

Comments (2)

kylefarris avatar kylefarris commented on May 24, 2024

@taietel Thanks again for the bug reporting. This is a scenario that I hadn't come across yet in my own usage of the module. The "simple" solution would be to provide this maxBuffer size option to the module, but, I think that might be rather confusing for some people--not very user-friendly in other words.

The problem is arising from running the following command through the execFile method of Node's child_process library:

find /path/to/your/directory

This would return a newline-delimited string to stdout (which has that aforementioned default buffer max size of 200 * 1024). I could obviously set that number to an artificially high 1024 * 1024 or something, but, what if the buffer exceeds that? I could allow devs to set their own number but what if they miscalculate? No need for senseless bugs.

I think the solution would be to not use child_process.execFile and instead use child_process.spawn and then chunk out that stream into 200 * 1024 bytes that could then be scanned a bit at a time. This will take a bit more effort, obviously, but will be a much more robust solution.

I'll see what I can do.

from clamscan.

kylefarris avatar kylefarris commented on May 24, 2024

Passing in file streams is no possible with the scanStream method. That should likely resolve this issue.

from clamscan.

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.