Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fmt: Printf loops on invalid verb spec #10674

Closed
dvyukov opened this issue May 3, 2015 · 2 comments
Closed

fmt: Printf loops on invalid verb spec #10674

dvyukov opened this issue May 3, 2015 · 2 comments
Milestone

Comments

@dvyukov
Copy link
Member

dvyukov commented May 3, 2015

The following program hangs in Execute.

package main

import (
    "text/template"
    "io/ioutil"
)

func main() {
    t, err := template.New("foo").Parse(data)
    if err != nil {
        return
    }
    t.Execute(ioutil.Discard, nil)
}

var data = "{{printf \"%017091901790959340919092959340919017929593813360\" 0}}"
SIGABRT: abort
goroutine 1 [running]:
    goroutine running on other thread; stack unavailable

go version devel +fbb4c74 Sat May 2 02:48:32 2015 +0000 darwin/amd64

@dvyukov dvyukov added this to the Go1.5 milestone May 3, 2015
@robpike
Copy link
Contributor

robpike commented May 4, 2015

This reproduces the hang.
package main

import "fmt"

func main() {
fmt.Printf("%017091901790959340919092959340919017929593813360", 0)
}

@robpike robpike changed the title text/template: hang on invalid input fmt: Printf loops on invalid verb spec May 4, 2015
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/9657 mentions this issue.

@robpike robpike closed this as completed in 660a682 May 4, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
@rsc rsc unassigned robpike Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants