Skip to content

Fix buffer overflow in GlobalParamsWin

==9552==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x00d4d1d0d72f at pc 0x7ff8db11c5eb bp 0x00d4d1d0cb90 sp 0x00d4d1d0cbd8
READ of size 1 at 0x00d4d1d0d72f thread T0
    #0 0x7ff8db11c5ea in strncmp (C:\msys64\clang64\bin\libclang_rt.asan_dynamic-x86_64.dll+0x18003c5ea)
    #1 0x7ff8d3d7731a in SysFontList::makeWindowsFont(char const*, int, char const*) C:/msys64/home/adrian/poppler/poppler/GlobalParamsWin.cc:287:19
    #2 0x7ff8d3d76e48 in SysFontList::scanWindowsFonts(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) C:/msys64
/home/adrian/poppler/poppler/GlobalParamsWin.cc:232:41
    #3 0x7ff8d3d6c2da in GlobalParams::setupBaseFonts(char const*) C:/msys64/home/adrian/poppler/poppler/GlobalParamsWin.cc:378:19
    #4 0x7ff8d3d6b501 in GlobalParams::findFontFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) C:/msys64/ho
me/adrian/poppler/poppler/GlobalParams.cc:892:5
    #5 0x7ff8d3cc6b55 in GfxFont::locateFont(XRef*, PSOutputDev*, GooString*) C:/msys64/home/adrian/poppler/poppler/GfxFont.cc:706:39
    #6 0x7ff8d3c46a2d in FontInfo::FontInfo(GfxFont*, XRef*) C:/msys64/home/adrian/poppler/poppler/FontInfo.cc:186:57
    #7 0x7ff8d3c45f34 in FontInfoScanner::scanFonts(XRef*, Dict*, std::__1::vector<FontInfo*, std::__1::allocator<FontInfo*>>*) C:/msys64/home/adrian/poppler/po
ppler/FontInfo.cc:122:46
    #8 0x7ff8d3c455d5 in FontInfoScanner::scan(int) C:/msys64/home/adrian/poppler/poppler/FontInfo.cc:82:13
    #9 0x7ff65f06498a in main C:/msys64/home/adrian/poppler/utils/pdffonts.cc:128:55
    #10 0x7ff65f061310 in __tmainCRTStartup C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:267:15
    #11 0x7ff65f061365 in .l_start C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:188:9
    #12 0x7ff92dfe7373  (C:\WINDOWS\System32\KERNEL32.DLL+0x180017373)
    #13 0x7ff92f33cc90  (C:\WINDOWS\SYSTEM32\ntdll.dll+0x18004cc90)

Address 0x00d4d1d0d72f is located in stack of thread T0 at offset 335 in frame
    #0 0x7ff8d3d766af in SysFontList::scanWindowsFonts(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) C:/msys64
/home/adrian/poppler/poppler/GlobalParamsWin.cc:186

Merge request reports

Loading