flashmob / go-guerrilla

Mini SMTP server written in golang
MIT License
2.77k stars 365 forks source link

Address parser hangs #212

Open 4k7 opened 4 years ago

4k7 commented 4 years ago

Hi,

The address parser (mail/rfc5321/parse.go) hangs in some cases.

This code will hang.

package main

import (
    "github.com/flashmob/go-guerrilla/mail"
)

func main() {
    mail.NewAddress("test")
}

You need to fix next() function.

func (s *Parser) next() byte {
    if s.pos+1 < len(s.buf) {
        s.pos++
        s.ch = s.buf[s.pos]
    } else {
        s.ch = 0
    }
    return s.ch
}

Thanks.

flashmob commented 4 years ago

Thanks!

On Thu, 13 Aug 2020, 11:09 int01, notifications@github.com wrote:

Hi,

The address parser (mail/rfc5321/parse.go) hangs in some cases.

This code will hangs.

package main

import ( "github.com/flashmob/go-guerrilla/mail" )

func main() { mail.NewAddress("test") }

You need to fix next() function.

func (s *Parser) next() byte { if s.pos+1 < len(s.buf) { s.pos++ s.ch = s.buf[s.pos] } else { s.ch = 0 } return s.ch }

Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/flashmob/go-guerrilla/issues/212, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE6MPZPUIK2IF6JOVLFMPTSANDMNANCNFSM4P5TURRA .

nullbio commented 3 years ago

Is this merged anywhere? Getting hit by this bug as well, causing OOM system hangups.