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

Empty line in log file causes event corruption #51

Closed
QMay opened this issue Sep 29, 2014 · 1 comment
Closed

Empty line in log file causes event corruption #51

QMay opened this issue Sep 29, 2014 · 1 comment
Assignees
Labels

Comments

@QMay
Copy link

QMay commented Sep 29, 2014

When a log file contains an empty line (regex: '^$') log-courier message lines become corrupted. Symptoms include messages beginning with '\n' or if using the multiline codec this can cause an anchored RegEx to fail.

The error is in 'linereader.go' line 59:

if n := bytes.IndexByte(lr.buf[lr.start:lr.end], '\n'); n > 0 {

should be:

if n := bytes.IndexByte(lr.buf[lr.start:lr.end], '\n'); n >= 0 {

'>' should be '>='

@driskell
Copy link
Owner

Quite right! I'll push a fix in a minute or two.

@driskell driskell self-assigned this Sep 29, 2014
dsmith pushed a commit to tinyspeck/log-courier that referenced this issue Oct 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants