projectdiscovery / notify

Notify is a Go-based assistance package that enables you to stream the output of several tools (or read from a file) and publish it to a variety of supported platforms.

Home Page:https://projectdiscovery.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

notify silently fails given a line of more than 64KB

justinsteven opened this issue · comments

Notify version:

% ./notify -version

             __  _ ___
  ___  ___  / /_(_) _/_ __
 / _ \/ _ \/ __/ / _/ // /
/_//_/\___/\__/_/_/ \_, / v1.0.1
                   /___/

                projectdiscovery.io

Use with caution. You are responsible for your actions
Developers assume no liability and are not responsible for any misuse or damage.
[INF] Current Version: 1.0.1

Current Behavior:

notify, when given a line that is >= 64KB, silently fails to process the rest of the file

It's fine with a line of 65535 bytes:

% tmpfile=$(mktemp)

% python3 -c 'print("AAAA"); print("B"*65535); print("CCCC")' > $tmpfile

% ./notify -i $tmpfile 2>&1 | sed 's/BBBB\+/lots of B lol/g'

             __  _ ___
  ___  ___  / /_(_) _/_ __
 / _ \/ _ \/ __/ / _/ // /
/_//_/\___/\__/_/_/ \_, / v1.0.1
                   /___/

                projectdiscovery.io

Use with caution. You are responsible for your actions
Developers assume no liability and are not responsible for any misuse or damage.
Using default provider config: /home/justin/.config/notify/provider-config.yaml
AAAA
lots of B lol
CCCC

But it's not okay with a line of 65536 bytes:

% python3 -c 'print("AAAA"); print("B"*65536); print("CCCC")' > $tmpfile

% ./notify -i $tmpfile 2>&1 | sed 's/BBBB\+/lots of B lol/g'

             __  _ ___
  ___  ___  / /_(_) _/_ __
 / _ \/ _ \/ __/ / _/ // /
/_//_/\___/\__/_/_/ \_, / v1.0.1
                   /___/

                projectdiscovery.io

Use with caution. You are responsible for your actions
Developers assume no liability and are not responsible for any misuse or damage.
Using default provider config: /home/justin/.config/notify/provider-config.yaml
AAAA

Expected Behavior:

Given a line of more than 64KB, notify breaks it up as per -char-limit and handles it, and then handles the rest of the file.

Steps To Reproduce:

Anything else:

@justinsteven this is now fixed the in dev version of the project with #146