Commit Graph

5668 Commits

Author SHA1 Message Date
Luis Diaz Mas
00502eabdd Move mrwthumb to samples 2018-08-26 09:23:08 +02:00
Luis Diaz Mas
e9a6597a48 Move xmpdump to samples 2018-08-26 09:23:08 +02:00
Luis Diaz Mas
ac51fda7b5 Move crwparse to samples 2018-08-26 09:23:08 +02:00
Luis Diaz Mas
32b618b1c7 Move crwedit from exiv2lib to samples 2018-08-26 09:23:08 +02:00
Luis Diaz Mas
f9b2784055 Remove utiltest.cpp that is not compiled 2018-08-26 09:23:08 +02:00
Luis Diaz Mas
ad004498a2 Cleanup 'comparison between signed & unsigned integer' warning 2018-08-24 16:45:52 +02:00
Luis Diaz Mas
00f86a8df4 Cleanup unused variable warnings 2018-08-24 16:45:52 +02:00
Luis Diaz Mas
6e244f31d3 Cleanup fallthrough warning + clang-format parseCommonTargets function 2018-08-24 16:45:52 +02:00
Luis Diaz Mas
0d9065274e Remove redefinition of UNUSED 2018-08-24 16:45:52 +02:00
D4N
a93cb04361
Merge pull request #407 from D4N/fix_400
Fix issue #400 (overreads in PngChunk::parseTXTChunk())
2018-08-21 14:09:13 +02:00
Dan Čermák
dadd1d19f9 Add reproducer for #400 to the test suite 2018-08-21 13:46:53 +02:00
Dan Čermák
35b3e596ed Add overflow & overread checks to PngChunk::parseTXTChunk()
This function was creating a lot of new pointers and strings without
properly checking the array bounds. This commit adds several calls
to enforce(), making sure that the pointers stay within bounds.
Strings are now created using the helper function
string_from_unterminated() to prevent overreads in the constructor of
std::string.

This fixes #400
2018-08-21 13:46:53 +02:00
Dan Čermák
6da77e2c64 Add documentation for parameters of string_from_unterminated 2018-08-21 13:44:35 +02:00
Dan Čermák
b127354429 Simplify string_from_unterminated by using strnlen() 2018-08-21 13:44:35 +02:00
Luis Diaz Mas
2540981aae travis-osx: do not install libssh openssl (already installed) 2018-08-21 13:32:37 +02:00
Luis Diaz Mas
eedc4aef5f Add doc indicating how to consume exiv2 with CMake 2018-08-20 13:50:23 +02:00
Luis Diaz Mas
17ad919ec2 CMake: Add RPATH configuration for Linux/Solaris
Note that this RPATH setup is following a recommendation from the CMake
documentation:
https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling#recommendations
2018-08-17 10:28:08 +02:00
Luis Diaz Mas
cefe0e5b0a conan: Use the same conan version in all the platforms (1.6.1) 2018-08-15 15:01:15 +02:00
clanmills
ce516eddef Issue-374 2018-08-08 22:28:54 +02:00
Robin Mills
20d21ec3dc #350 2018-08-08 20:34:26 +02:00
Luis Diaz Mas
8ba9422ba3 travis: Enable coverage reports in gcc build
* I also had to update the conan version to fix some issues in CI.
* Codecov reports are now added to the README.md and to each PR.
2018-07-31 23:43:46 +02:00
Luis Diaz Mas
6521f7c4f9 cmake: new option to enable compilations with coverage flags
Note that this will only work with gcc and clang.
2018-07-31 23:43:46 +02:00
Luis Diaz Mas
3d35b93fc0 Skip test 1054 unless timezone is UTC 2018-07-31 18:18:14 +02:00
Luis Diaz Mas
59585fa3af [Travis] export TZ=UTC before running tests
This is needed in some tests which are using exiv2json.
It seems that during metadata conversion, the dates are converted from the
original timezone (which seems to be saved in xmp) into the local time zone.
2018-07-31 18:18:14 +02:00
Luis Diaz Mas
145f8fc456 Port redmine issues from the bash test suite to the python one.
* Port redmine issue 1024
 * Port redmine issue 1026
 * Port redmine issue 1040
 * Port redmine issue 1044
 * Port redmine issue 1053
 * Port redmine issue 1054 (not finished yet; I found some issues there)
 * Port redmine issue 1058
 * Port redmine issue 1062
 * Port redmine issue 1080
 * Port redmine issue 1108
 * Port redmine issue 1112
 * Port redmine issue 1114
 * Port redmine issue 1122
 * Port redmine issue 1140
 * Port redmine issue 1144
 * Port redmine issue 1145
 * Port redmine issue 1153
 * Port redmine issue 1155
 * Port redmine issue 1166
 * Port redmine issue 1167
 * Port redmine issue 1170
 * Replace escaped chars in 1054
 * Add brackets in exiv2json::main()
 * Link all sample apps against exiv2lib
 * Changes in 1054
 * test 1054: fix dates depending on Local time
 * Do not run make with VERBOSE=1
 * Use system_tests.path
 * Fix windows issues with quotes
 * Use system_tests.path
 * Use itertools to simplify test code
2018-07-31 18:18:14 +02:00
Robin Mills
4e47c20f97
Merge pull request #389 from piponazo/clcache
Enable clcache usage and use it in appveyor
2018-07-30 21:18:27 +01:00
Luis Díaz Más
5eee072089 Enable clcache usage and use it in appveyor
* [appveyor] Install clcache with nuget
* [appveyor] Keep clcache in the appveyor jobs
* [appveyor] Print clcache stats after compiling the project
* Use CLCACHE_PATH env variable to find clcache
2018-07-30 21:31:23 +02:00
Dan Čermák
e67910a669 [tests] Change name of test for #365 and #366
Issues got a CVE assigned
2018-07-30 00:32:07 +02:00
D4N
24ef91fcf9
Merge pull request #380 from D4N/misc_issues_fix
Fix various memory issues and enable ASAN for the test suite
2018-07-29 21:11:32 +02:00
Dan Čermák
664e93c057 [travis] Enable ASAN for the test suite 2018-07-29 00:20:43 +02:00
Dan Čermák
b12a868454 Add EXV_WARN_UNUSED_RESULT macro & add it to DataBuf::release()
EXV_WARN_UNUSED_RESULT is a conditional macro that expands to either
__attribute__((warn_unused_result)) on gcc & clang or to _Check_return
for MSVC
=> Compiler warns if the return value is ignored
2018-07-29 00:20:43 +02:00
Dan Čermák
1ab921cb83 Add two padding bytes to exifLongHeader to prevent overreads
in the following call:
getHeaderOffset (payload.pData_, payload.size_, (byte*)&exifLongHeader, 6);

getHeaderOffset would read 6 bytes from exifLongHeader, reading beyond the
bounds of the array => add 2 padding bytes to prevent overreads
2018-07-29 00:20:43 +02:00
Dan Čermák
dbf90b976f Fix overread in memcmp in PngImage::doWriteMetadata()
memcmp() compares the read data from key with the provided string, but when
key.pData_ is shorter than the provided length, then memcmp can read beyond the
bounds of key.pData_
=> add custom compare function, which ensures that we never read more than
key.size_
2018-07-29 00:20:43 +02:00
Dan Čermák
8d5a3c7dd9 Remove buffer overread in tExtToDataBuf
The pointer p is advanced in the while loop to step over three '\n'.
However, its length is never reduced accordingly. => the length check in the
following for loop is invalid, as it permits overreading by the number of
characters that p was advanced by.
2018-07-29 00:20:30 +02:00
Dan Čermák
67dc3e691f [IptcData::printStructure] clang-format function 2018-07-29 00:00:52 +02:00
Dan Čermák
b2c3b61abc [IptcData::printStructure] Remove buffer overrun
The loop condition will perform a range check correctly, but it will always
dereference bytes[i], even if i is too large and fails the second check.
=> move the bytes[i] == 0x1c check into a if, after the range check was
successfull
2018-07-28 23:50:33 +02:00
Dan Čermák
39399ac5e8 Remove memory leak in SshIo::SshImpl::getDataByRange
The buffer array is not deleted, when an exception is thrown
(happens for nBytes< 0).
=> use std::vector<char> instead
2018-07-28 23:50:33 +02:00
Dan Čermák
607b19111c [DataBuf] Replace wrong usage of release() with free() 2018-07-28 23:50:33 +02:00
Dan Čermák
1b74db8f51 [types] Add DataBuf::free()
DataBuf::release() easily cause memory leaks, when the return value is
ignored. free() provides the desired behavior, when the internal data should
just be deleted and not used further.
2018-07-28 23:50:33 +02:00
D4N
505e2417e4
Merge pull request #379 from D4N/fix_378
Fix for #378
2018-07-17 00:10:20 +02:00
Dan Čermák
81b6d36c90 [webp] Enforce minimum read size in decodeChunks
The size parameter is only checked for upper bounds, but not for lower.
If it is too small, then created dataBuf will be too small and overflow in one
of the subsequent memcpy() calls.

This fixes #378 / CVE-2018-14046
2018-07-16 23:40:56 +02:00
Dan Čermák
f522cbf460 [testsuite] Add reproducer for #378/CVE-2018-14046 to the testsuite 2018-07-16 23:40:23 +02:00
Luis Díaz Más
6a203c70c0 Include missing unused.h header in convert.cpp 2018-07-09 22:17:47 +02:00
Luis Díaz Más
bb9ce23e76 Set EXV_HAVE_XMP_TOOLKIT correctly. set() does not accept logical operators 2018-07-09 22:17:47 +02:00
AndreasMartin72
33c0416bc8 Bugfix for build error (Win7, msvc)
Ref: https://github.com/Exiv2/exiv2/issues/371#issuecomment-401319696
2018-07-05 18:28:26 +02:00
D4N
341de4500a
Merge pull request #368 from D4N/fix_issue_365
Fix #365 and #366
2018-06-11 23:29:54 +02:00
Dan Čermák
b761c6d056 Remove useless casts in preview.cpp 2018-06-11 22:55:49 +02:00
Dan Čermák
b517f2e13b Add regression test for #366 to the testsuite 2018-06-11 22:55:49 +02:00
Dan Čermák
fe70939f54 Fix addition overflows in range checks in LoaderTiff::getData
Several checks for extracted values performed no overflow checks on the
addition. They can be tricked into passing, albeit the individual summands are
too large.
=> use Safe::add() which now aborts when an overflow occurs
This fixes #366
2018-06-11 22:55:49 +02:00
Dan Čermák
9b08354aca Add reproducer for #365 to the testsuite 2018-06-11 22:55:49 +02:00