Skip to content

net/mail: parses invalid address #11293

Closed
@dvyukov

Description

@dvyukov

The following program fails with the panic:

package main

import (
    "fmt"
    "net/mail"
)

func main() {
    data := "\"\"@0"
    addr, err := mail.ParseAddress(data)
    if err != nil {
        return
    }
    _, err = mail.ParseAddress(addr.String())
    if err != nil {
        fmt.Printf("failed to parse addr: %q -> %q\n", data, addr)
        panic(err)
    }
}
failed to parse addr: "\"\"@0" -> "<@0>"
panic: mail: invalid string

I guess that address should have not been parsed in the first place.

go version devel +514014c Thu Jun 18 15:54:35 2015 +0200 linux/amd64

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions