russross / blackfriday

Blackfriday: a markdown processor for Go
Other
5.45k stars 602 forks source link

panic: block input is missing terminating newline #717

Open pwnhacker0x18 opened 9 months ago

pwnhacker0x18 commented 9 months ago

log:

goroutine 1 [running]:
github.com/russross/blackfriday.(*parser).block(0xc000154000?, 0xc00001c1c0?, {0xc00001c200?, 0x40?, 0x38?})
    /home/dolphinfuzz/go/pkg/mod/github.com/russross/blackfriday@v1.6.0/block.go:27 +0xd1f
github.com/russross/blackfriday.(*parser).quote(0xc000154000, 0xc00001c1c0?, {0xc00001c1c0, 0xa, 0x40})
    /home/dolphinfuzz/go/pkg/mod/github.com/russross/blackfriday@v1.6.0/block.go:967 +0x32e
github.com/russross/blackfriday.(*parser).block(0xc000154000, 0xc00001c180?, {0xc00001c1c0?, 0x40?, 0x37?})
    /home/dolphinfuzz/go/pkg/mod/github.com/russross/blackfriday@v1.6.0/block.go:132 +0xaf0
github.com/russross/blackfriday.(*parser).quote(0xc000154000, 0xc00001c180?, {0xc00001c180, 0x10, 0x40})
    /home/dolphinfuzz/go/pkg/mod/github.com/russross/blackfriday@v1.6.0/block.go:967 +0x32e
github.com/russross/blackfriday.(*parser).block(0xc000154000, 0x3?, {0xc00001c180?, 0xd?, 0x7fa25261000d?})
    /home/dolphinfuzz/go/pkg/mod/github.com/russross/blackfriday@v1.6.0/block.go:132 +0xaf0
github.com/russross/blackfriday.secondPass(0xc000154000, {0xc00001c180, 0x10, 0x40})
    /home/dolphinfuzz/go/pkg/mod/github.com/russross/blackfriday@v1.6.0/markdown.go:461 +0x87
github.com/russross/blackfriday.MarkdownOptions({0x7fa252610000, 0x10, 0x10}, {0x4f56c0, 0x5ba880}, {0x9?, 0x0?})
    /home/dolphinfuzz/go/pkg/mod/github.com/russross/blackfriday@v1.6.0/markdown.go:391 +0x405
github.com/russross/blackfriday.Markdown(...)
    /home/dolphinfuzz/go/pkg/mod/github.com/russross/blackfriday@v1.6.0/markdown.go:345
github.com/openshift/oc/tools/genman/md2man.Render({0x7fa252610000?, 0xc000147e58?, 0x4618cf?})
exit status 2

Wrapper func:

package md2man

import (
    "github.com/russross/blackfriday"
)

func Render(doc []byte) []byte {
    renderer := RoffRenderer(0)
    extensions := 0
    extensions |= blackfriday.EXTENSION_NO_INTRA_EMPHASIS
    extensions |= blackfriday.EXTENSION_TABLES
    extensions |= blackfriday.EXTENSION_FENCED_CODE
    extensions |= blackfriday.EXTENSION_AUTOLINK
    extensions |= blackfriday.EXTENSION_SPACE_HEADERS
    extensions |= blackfriday.EXTENSION_FOOTNOTES
    extensions |= blackfriday.EXTENSION_TITLEBLOCK

    return blackfriday.Markdown(doc, renderer, extensions)
}

pocs.zip