gofpdf icon indicating copy to clipboard operation
gofpdf copied to clipboard

panic on SplitText with Arial font

Open kris-watts-gravwell opened this issue 2 years ago • 0 comments

If splittext is called with an active Arial font and the text contains an "En Dash" UTF character 8211/0x2013 there is a panic:

github.com/phpdave11/gofpdf.(*Fpdf).SplitText(0x1?, {0xc0000e0210?, 0xc0000d7090?}, 0x3ff0000000000000?)
	~/mygo/pkg/mod/github.com/phpdave11/[email protected]/splittext.go:28 +0x4c5

Looks like it doesn't check the offset on the font size slice here: https://github.com/phpdave11/gofpdf/blob/v1.4.2/splittext.go#L28

kris-watts-gravwell avatar Sep 08 '22 16:09 kris-watts-gravwell