mcuadros / go-syslog

Syslog server library for go.
http://godoc.org/gopkg.in/mcuadros/go-syslog.v2
MIT License
523 stars 143 forks source link

Fix panic when parsing line with only priority. #89

Open samuel opened 1 year ago

samuel commented 1 year ago

parseHeader was not checking that the end of the input hasn't been reached, and parseTimestamp and parseHostname assume that there's at least one character available. Avoid a panic by checking in parseHeader, and add a test to verify.