nunocoracao / blowfish

Personal Website & Blog Theme for Hugo
https://blowfish.page
MIT License
1.53k stars 421 forks source link

Empty quote in markdown segfaults Hugo #1684

Closed ragibson closed 3 months ago

ragibson commented 3 months ago

Describe the bug Including an empty quote in a markdown file segfaults Hugo.

Indeed, I was able to replicate this on n9o.xyz by adding a single > in content/about/index.md.

To Reproduce Steps to reproduce the behavior:

  1. Create a markdown post with the following line in its content.
    > 
  2. Attempting to build the site will segfault Hugo in the goldmark renderer.
    
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x88 pc=0x10551e0]

goroutine 48 [running]: github.com/gohugoio/hugo/markup/goldmark/blockquotes.(htmlRenderer).renderBlockquote(0x5c7fea0, {0x443d6a0, 0xc000a93680}, {0xc00066eaa0, 0x27e7900?, 0x44}, {0x4459560?, 0xc001798280}, 0x0?) github.com/gohugoio/hugo/markup/goldmark/blockquotes/blockquotes.go:81 +0x260 github.com/yuin/goldmark/renderer.(renderer).Render.func2({0x4459560, 0xc001798280}, 0x0) github.com/yuin/goldmark@v1.7.4/renderer/renderer.go:166 +0xc8 github.com/yuin/goldmark/ast.walkHelper({0x4459560, 0xc001798280}, 0xc001f89848) github.com/yuin/goldmark@v1.7.4/ast/ast.go:503 +0xb1


**Expected behavior**
Don't segfault (and probably render nothing at all). This was apparently the behavior in earlier versions of Hugo/Blowfish.

**Desktop (please complete the following information):**
 - OS: Linux Mint 22
 - Browser [e.g. chrome, safari]: N/A, website fails to build

**Hugo & Blowfish versions**
Which version of Hugo and Blowfish are you using?

hugo v0.132.0+extended linux/amd64 BuildDate=2024-08-12T15:21:36Z VendorInfo=brew Blowfish v2.75.0

ragibson commented 3 months ago

Nevermind, I could replicate this in other themes, so it is probably a new Hugo bug rather than something in Blowfish.