Giter VIP home page Giter VIP logo

intruder-alert's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ricgrangeia

intruder-alert's Issues

If filesize is 0 an exception is thrown

Error when filesize is 0.

[intruder-alert] Processing /var/log/fail2ban.log.1 PHP Fatal error: Uncaught ValueError: fread(): Argument #2 ($length) must be greater than 0 in /var/www/html/intruder/backend/include/Helper/File.php:26 Stack trace: #0 /var/www/html/intruder/backend/include/Helper/File.php(26): fread() #1 /var/www/html/intruder/backend/include/Logs.php(64): IntruderAlert\Helper\File::read() #2 /var/www/html/intruder/backend/include/App.php(98): IntruderAlert\Logs->process() #3 /var/www/html/intruder/backend/include/App.php(38): IntruderAlert\App->processLogs() #4 /var/www/html/intruder/backend/cron.php(20): IntruderAlert\App->run() #5 {main} thrown in /var/www/html/intruder/backend/include/Helper/File.php on line 26

You can fix it by fixing File.php with checking the filesize:

` // end of function read in class File:

    if ($handle === false) {
        throw new AppException('File not opened: ' . $path);
    }
    if ((int) filesize($path) == 0) {
            return "";
    }
    $contents = fread($handle, (int) filesize($path));

    if ($contents === false) {
        throw new AppException('File not read: ' . $path);
    }

    fclose($handle);

    return $contents;
}`

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.