Bug 2249 - _tiffSizeProc's error result doesn't match _tiffMapProc's expectation
: _tiffSizeProc's error result doesn't match _tiffMapProc's expectation
Status: RESOLVED LATER
: libtiff
default
: 3.9.0
: All All
: P2 normal
: ---
Assigned To:
: https://bugzilla.redhat.com/show_bug....
:
: migrated_to_gitlab
:
:
  Show dependency treegraph
 
Reported: 2010-07-16 10:43 by
Modified: 2019-10-01 14:19 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2010-07-16 10:43:19
In 3.9.4's tif_unix.c, I observe that _tiffSizeProc returns 0 on fstat()
failure, while _tiffMapProc thinks that -1 is its failure code.  So an fstat
failure would result in mapping a zero-size chunk of the file and doubtless
crashing soon thereafter.  Now an fstat failure is sufficiently unlikely that
this would seldom be an issue in practice, but I am suspicious that something
of the sort happened here: https://bugzilla.redhat.com/show_bug.cgi?id=614745

I haven't done the legwork to see what other callers of the sizeproc think the
failure result code is, so I'm not sure which function needs to change, but
clearly one of them does.

It might also be smart to inspect the other OS-specific modules for the same
problem.
------- Comment #1 From 2010-07-16 11:05:54 -------
Actually, on closer analysis this doesn't explain that Red Hat bug: if the file
were mapped zero length, it wouldn't have got as far as it did (see my comment
#11 there).  But it's still a bug, even if low probability.
------- Comment #2 From 2019-10-01 14:19:34 -------
Bugzilla is no longer used for tracking libtiff issues. Remaining open tickets,
such as this one, have been migrated to the libtiff GitLab instance at
https://gitlab.com/libtiff/libtiff/issues .

The migrated tickets have their summary prefixed with [BZ#XXXX] where XXXX is
the initial Bugzilla issue number.