Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for empty bytes being written by file write channel #696

Merged
merged 1 commit into from
Apr 13, 2021
Merged

Add check for empty bytes being written by file write channel #696

merged 1 commit into from
Apr 13, 2021

Conversation

grantseltzer
Copy link
Contributor

This is to handle #690

The "EOF" error is printed as a result of the File Write Channel sending empty raw data. I believe the reason for this has to do with allocating memory for []byte{} that'd be send over the file_write channel, but nothing ever being written, leading it to being drained in this way.

This will skip over empty raw data that's been sent. Alternatively we can add a check for err == io.EOF and ignore it specifically.

Signed-off-by: grantseltzer grantseltzer@gmail.com

…leWrChannel

Signed-off-by: grantseltzer <grantseltzer@gmail.com>
Copy link
Collaborator

@itaysk itaysk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need the same in decodeRawEvent ?

@grantseltzer
Copy link
Contributor Author

No I don't believe so, this is specifically related to the file write channel.

@grantseltzer grantseltzer merged commit d606972 into aquasecurity:main Apr 13, 2021
@yanivagman
Copy link
Collaborator

Note that this doesn't fix the root cause of the bug.
Why can there be events of 0 bytes in the file write channel?
The callback shouldn't have been called in that case...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants