[Poppler-bugs] [Bug 106072] New: use-of-uninitialized-value in GfxDeviceRGBColorSpace::getRGB

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Apr 16 09:31:25 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=106072

            Bug ID: 106072
           Summary: use-of-uninitialized-value in
                    GfxDeviceRGBColorSpace::getRGB
           Product: poppler
           Version: unspecified
          Hardware: x86 (IA32)
                OS: Linux (All)
            Status: NEW
          Severity: minor
          Priority: medium
         Component: general
          Assignee: poppler-bugs at lists.freedesktop.org
          Reporter: pdknsk at gmail.com

The code is as follows.

  double c[gfxColorMaxComps]; // 32

  ...

    func->transform(&x, c); // sets c[0] only
    for (i = 0; i < alt->getNComps(); ++i) { // 3
      color2.c[i] = dblToCol(c[i]); // reads c[1], c[2]
    }
    alt->getRGB(&color2, rgb); // uses c[1]

And the report.

==10363==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x1525417 in clip01(int) poppler/poppler/GfxState_helpers.h:26:10
    #1 0x153286c in GfxDeviceRGBColorSpace::getRGB(GfxColor*, GfxRGB*)
poppler/poppler/GfxState.cc:984:12
    #2 0x1571f27 in GfxSeparationColorSpace::getRGB(GfxColor*, GfxRGB*)
poppler/poppler/GfxState.cc:2818:10
    #3 0x18788b0 in GfxState::getStrokeRGB(GfxRGB*)
poppler/poppler/GfxState.h:1471:25
    #4 0x1b7105b in SplashOutputDev::updateStrokeColor(GfxState*)
poppler/poppler/SplashOutputDev.cc:1727:12
    #5 0x13dd6ec in Gfx::opSetStrokeColorSpace(Object*, int)
poppler/poppler/Gfx.cc:1550:10
    #6 0x144079a in Gfx::execOp(Object*, Object*, int)
poppler/poppler/Gfx.cc:884:3
    #7 0x143c5bf in Gfx::go(bool) poppler/poppler/Gfx.cc:747:7
    #8 0x143ab18 in Gfx::display(Object*, bool) poppler/poppler/Gfx.cc:709:3
    #9 0x16e5ff1 in Page::displaySlice(OutputDev*, double, double, int, bool,
bool, int, int, int, int, bool, bool (*)(void*), void*, bool (*)(Annot*,
void*), void*, bool) poppler/poppler/Page.cc:560:10
    #10 0x110f743 in PDFDoc::displayPageSlice(OutputDev*, int, double, double,
int, bool, bool, bool, int, int, int, int, bool (*)(void*), void*, bool
(*)(Annot*, void*), void*, bool) poppler/poppler/PDFDoc.cc:550:20
    #11 0x1b4b1ab in poppler::page_renderer::render_page(poppler::page const*,
double, double, int, int, int, int, poppler::rotation_enum) const
poppler/cpp/poppler-page-renderer.cpp:180:13

  Uninitialized value was stored to memory at
    #0 0x152e951 in dblToCol(double) poppler/poppler/GfxState.h:107
    #1 0x1571c16 in GfxSeparationColorSpace::getRGB(GfxColor*, GfxRGB*)
poppler/poppler/GfxState.cc:2816:21
    #2 0x18788b0 in GfxState::getStrokeRGB(GfxRGB*)
poppler/poppler/GfxState.h:1471:25
    #3 0x1b7105b in SplashOutputDev::updateStrokeColor(GfxState*)
poppler/poppler/SplashOutputDev.cc:1727:12
    #4 0x13dd6ec in Gfx::opSetStrokeColorSpace(Object*, int)
poppler/poppler/Gfx.cc:1550:10
    #5 0x144079a in Gfx::execOp(Object*, Object*, int)
poppler/poppler/Gfx.cc:884:3
    #6 0x143c5bf in Gfx::go(bool) poppler/poppler/Gfx.cc:747:7
    #7 0x143ab18 in Gfx::display(Object*, bool) poppler/poppler/Gfx.cc:709:3
    #8 0x16e5ff1 in Page::displaySlice(OutputDev*, double, double, int, bool,
bool, int, int, int, int, bool, bool (*)(void*), void*, bool (*)(Annot*,
void*), void*, bool) poppler/poppler/Page.cc:560:10
    #9 0x110f743 in PDFDoc::displayPageSlice(OutputDev*, int, double, double,
int, bool, bool, bool, int, int, int, int, bool (*)(void*), void*, bool
(*)(Annot*, void*), void*, bool) poppler/poppler/PDFDoc.cc:550:20
    #10 0x1b4b1ab in poppler::page_renderer::render_page(poppler::page const*,
double, double, int, int, int, int, poppler::rotation_enum) const
poppler/cpp/poppler-page-renderer.cpp:180:13

  Uninitialized value was created by an allocation of 'c' in the stack frame of
function '_ZN23GfxSeparationColorSpace6getRGBEP8GfxColorP6GfxRGB'
    #0 0x1570840 in GfxSeparationColorSpace::getRGB(GfxColor*, GfxRGB*)
poppler/poppler/GfxState.cc:2802

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20180416/a163984f/attachment.html>


More information about the Poppler-bugs mailing list