Skip to content

net/mail: ParseAddress/String corrupt address #11292

Description

@dvyukov

The following program fails the panic:

package main

import (
    "fmt"
    "net/mail"
)

func main() {
    data := "\"\\\x1f,\"<0@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: "\"\\\x1f,\"<0@0>" -> "=?utf-8?q?=1F,?= <0@0>"
panic: mail: no angle-addr

ParseAddress must handle result of Address.String, or else first ParseAddress must fail.

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions