Skip to content

Commit 32c7ba5

Browse files
vixnsmcuadros
authored andcommitted
prevent crash on empty message
1 parent 20bf196 commit 32c7ba5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

rfc5424/rfc5424.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,10 @@ func parseStructuredData(buff []byte, cursor *int, l int) (string, error) {
530530
var sdData string
531531
var found bool
532532

533+
if *cursor >= l {
534+
return "-", nil
535+
}
536+
533537
if buff[*cursor] == NILVALUE {
534538
*cursor++
535539
return "-", nil

0 commit comments

Comments
 (0)