2648 Commits (f7a403d8d995d683b1cde7cadf211d7f7907a69d)

Author SHA1 Message Date
Andreas Sturmlechner 57883ee664
Fix build with EXIV2_BUILD_EXIV2_COMMAND=OFF 8 years ago
Dan Čermák c686843e20 Added exception throw on Value pointer being null
v can be null if the typeId is invalid => throw an exception notifying
the user that his file is corrupted instead of the assertion
8 years ago
Dan Čermák 75940da0a6 Added check for overflows in calculation of size 8 years ago
Dan Čermák 8a586c74bb Fix for CVE-2017-14864, CVE-2017-14862 and CVE-2017-14859
The invalid memory dereference in
Exiv2::getULong()/Exiv2::StringValueBase::read()/Exiv2::DataValue::read()
is caused further up the call-stack, by
v->read(pData, size, byteOrder) in TiffReader::readTiffEntry()
passing an invalid pData pointer (pData points outside of the Tiff
file). pData can be set out of bounds in the (size > 4) branch where
baseOffset() and offset are added to pData_ without checking whether
the result is still in the file. As offset comes from an untrusted
source, an attacker can craft an arbitrarily large offset into the
file.

This commit adds a check into the problematic branch, whether the
result of the addition would be out of bounds of the Tiff
file. Furthermore the whole operation is checked for possible
overflows.
8 years ago
Dan Čermák 6c1ba331b9 Added arithmetic operation overflow error 8 years ago
Dan Čermák ff18fec24b Fix for CVE-2017-14860
A heap buffer overflow could occur in memcpy when icc.size_ is larger
than data.size_ - pad, as then memcpy would read out of bounds of data.

This commit adds a sanity check to iccLength (= icc.size_): if it is
larger than data.size_ - pad (i.e. an overflow would be caused) an
exception is thrown.

This fixes #71.
8 years ago
Dan Čermák 65f45a3505 Added new error message to warn about corrupted metadata 8 years ago
Luis Díaz Más 4beb08e219 Merge pull request #105 from Kicer86/bigtiff
Work in progress - improvements for bigtiff
8 years ago
Luis Díaz Más 8e4aff29c2 Merge pull request #107 from D4N/tiffvisitor_nullptr_check
Use nullptr check instead of assertion, by Raphaël Hertzog
8 years ago
Michał Walenciak 2402a693fd adding missing include for numeric_limits 8 years ago
Luis Díaz Más 93bbf0cab1 Merge pull request #104 from piponazo/removeCpp11Feature
Remove cpp11 features
8 years ago
Dan Čermák e026160556 Use nullptr check instead of assertion, by Raphaël Hertzog
Source:
https://github.com/Exiv2/exiv2/issues/57#issuecomment-333086302

tc can be a null pointer when the TIFF tag is unknown (the factory
then returns an auto_ptr(0)) => as this can happen for corrupted
files, an explicit check should be used because an assertion can be
turned of in release mode (with NDEBUG defined)

This also fixes #57
8 years ago
Luis Díaz Más bef6dad6c5 Merge pull request #103 from AdelieLinux/master
Amend fix for #9 to apply to other Unix systems
8 years ago
Michał Walenciak b1a5d615c5 removing debug message 8 years ago
Michał Walenciak 64e05c0a7a improving fixes for #55 and #56 8 years ago
Luis Díaz Más 1a1a61b63d Remove reference to regex & c++11 from the man page 8 years ago
Luis Díaz Más 5b8894908b Remove all references to EXV_HAVE_REGEX and related code 8 years ago
Luis Díaz Más bfd61bd0f1 Merge pull request #96 from Kicer86/master
Adding comment for issue #56
8 years ago
A. Wilcox d775683f57
Amend fix for #9 to apply to other Unix systems
At least the musl libc on Linux has the same issue as Mac OS X: the
PTHREAD_RECURSIVE_* static initialiser does not exist.  This is a
documented and purposeful omission:

http://www.openwall.com/lists/musl/2017/02/20/3

This commit uses similar logic to the Apple test on other Unixes.
8 years ago
Luis Diaz Mas 2784b1f7f7 Remove EXIV2_ENABLE_LIBXMP variable, always build static XMP library, remove cmake OBJECT library 8 years ago
Michał Walenciak 7e90668011 Adding comment for issue #56 8 years ago
Luis Díaz Más df3c77516c Merge pull request #94 from piponazo/configFileInBuildDirectory
Generate exv_conf.h file out of the source tree.
8 years ago
Luis Díaz Más a9e3f17f31 Generate exv_conf.h file out of the source tree. Install it in the include folder. 8 years ago
Luis Díaz Más 686edde5ef Provide exiv2Config file automatically generated by CMake 8 years ago
clanmills 327b3f6c4d Fix https://github.com/Exiv2/exiv2/issues/83 8 years ago
Robin Mills 2f0104879a Merge pull request #81 from piponazo/robinChanges
Robin changes
8 years ago
clanmills d43cd82002 Fix #80 8 years ago
Luis Díaz Más 8ad49f6d73 Robin changes in sync with master changes 8 years ago
Dan Čermák 74cb5bab13 Fixed wrong brackets: size*count + pad can overflow before the cast
=> Should fix #76 (most of the work has been done by Robin Mills in
   6e3855aed7)

The problem with #76 is the contents of the 26th IFD, with the
following contents:
tag: 0x8649
type: 0x1
count: 0xffff ffff
offset: 0x4974

The issue is the size of count (uint32_t), as adding anything to it
causes an overflow. Especially the expression:
(size*count + pad+20)
results in an overflow and gives 20 as a result instead of
0x100000014, thus the condition in the if in the next line is false
and the program continues to run (until it crashes at io.read).

To properly account for the overflow, the brackets have to be removed,
as then the result is saved in the correctly sized type and not cast
after being calculated in the smaller type.

The brackets have also been removed from bigtiffimage.cpp, where the
same issue is present.
8 years ago
Robin Mills d8ae4484ae msvc support for bigtiffimage.cpp 8 years ago
Robin Mills e1948c7ff9 msvc/bigtiffimage support 8 years ago
clanmills 6e3855aed7 Fix https://github.com/Exiv2/exiv2/issues/55 8 years ago
Robin Mills 197375dfa4 Merge pull request #72 from Kicer86/bigtiff
Some improvements, crash fix.
8 years ago
Michał Walenciak 9acc1c56a7 adding ifd8 and long longs to is8ByteType() 8 years ago
Michał Walenciak 4837d8cf58 changing header + some warning fix 8 years ago
Robin Mills 6fd0bc9e10 Adding ./configure support for bigtiffimage.cpp 8 years ago
clanmills 678e2b8517 Explicitly list files to be processed CMake generated builds [remove file(GLOB...)] 8 years ago
Michał Walenciak 734a2c3d57 fixing TODO 8 years ago
Michał Walenciak e3ff1ba694 fixing indent 8 years ago
Michał Walenciak 4629227358 fix for IPTCNAA
dir_offset was used instead of offset
8 years ago
Michał Walenciak 4f6f5b4946 removing conditional_byte_swap* functions 8 years ago
Michał Walenciak b6e79357de Adding 8-byte swap functions + consts 8 years ago
Michał Walenciak f96d84ba8c dropping dead code 8 years ago
Michał Walenciak 50ecf672b5 using Internal::indent() 8 years ago
Michał Walenciak f8ac7a5dc3 renaming Tiff to StandardTiff 8 years ago
Michał Walenciak d460bbdb3f fix for standard tiff case 8 years ago
Michał Walenciak 81aa8828e0 applying dff941ad7f 8 years ago
Michał Walenciak 874daede53 fixing broken print for 'offset' column 8 years ago
Michał Walenciak 8b07982bf2 variable names cleanup 8 years ago
Michał Walenciak 1a1dc3afd4 simplifying code 8 years ago