[Poppler-bugs] [Bug 63067] New: Misuse of setjmp in DCTStream

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Apr 3 02:41:53 PDT 2013


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

          Priority: medium
            Bug ID: 63067
          Assignee: poppler-bugs at lists.freedesktop.org
           Summary: Misuse of setjmp in DCTStream
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: rodrigorivascosta at gmail.com
          Hardware: Other
            Status: NEW
           Version: unspecified
         Component: general
           Product: poppler

According to POSIX and the C spec, `setjmp` should only be used as the "entire
controlling expression" of a selection of iteration statement, possibly with
`!` or `== 0` or similar.

But in DCTStream.cc is the line:

    if (!setjmp(err.setjmp_buffer) && jpeg_read_header(&cinfo, TRUE) !=
JPEG_SUSPENDED)

If I'm not mistaken, that is undefined behavior. Not that it broke anything
yet...

Instead it should be:

    if (!setjmp(err.setjmp_buffer))
    {
      if (jpeg_read_header(&cinfo, TRUE) != JPEG_SUSPENDED)

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


More information about the Poppler-bugs mailing list