sudipshil9862 / whichfont

Querying fontconfig for certain code point
GNU General Public License v3.0
1 stars 1 forks source link

segfaults when given 
 U+2028 LINE SEPARATOR as input #3

Closed mike-fabian closed 1 year ago

mike-fabian commented 1 year ago

$ ./.builddir/whichfont -u $(echo -e "\xe2\x80\xa8")

Segmentation fault (core dumped)

"\xe2\x80\xa8" is the UTF-8 encoding of U+2028

mike-fabian commented 1 year ago

It also segfaults when getting unassigned Unicode code points like U+1FFF (does not exist) as input:

First give ☺ U+263A WHITE SMILING FACE as a test that my use of iconv is OK:

mfabian@hathi:/local/mfabian/src/whichfont (main)
$ .builddir/whichfont -u $(echo -n -e "\x26\x3a" | iconv -f utf16be -t utf-8)

"☺" unicode: U+263A
DejaVuSans.ttf: "DejaVu Sans" "Regular"
mfabian@hathi:/local/mfabian/src/whichfont (main)
$

Good, now U+2028 LINE SEPARATOR and the unassigned U+1FFF:

$ .builddir/whichfont -u $(echo -n -e "\x20\x28" | iconv -f utf16be -t utf-8)

Segmentation fault (core dumped)
mfabian@hathi:/local/mfabian/src/whichfont (main)
$ .builddir/whichfont -u $(echo -n -e "\x1f\xff" | iconv -f utf16be -t utf-8)

Segmentation fault (core dumped)
mfabian@hathi:/local/mfabian/src/whichfont (main)
$