go-guerrilla icon indicating copy to clipboard operation
go-guerrilla copied to clipboard

Address parser hangs

Open 4k7 opened this issue 5 years ago • 2 comments

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.

4k7 avatar Aug 13 '20 02:08 4k7

Thanks!

On Thu, 13 Aug 2020, 11:09 int01, [email protected] 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 .

flashmob avatar Aug 14 '20 08:08 flashmob

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

nullbio avatar Dec 15 '20 01:12 nullbio