Commit Graph

5682 Commits

Author SHA1 Message Date
Luis Diaz Mas
eb306fdbae Substitute malloc/free with new/delete 2018-08-27 13:24:47 +02:00
Luis Diaz Mas
08cbb0c206 Use header guards instead of pragma once 2018-08-27 13:24:47 +02:00
Luis Diaz Mas
669ab49c43 New tests for Uri class 2018-08-27 13:24:47 +02:00
Luis Diaz Mas
ca290d870f New tests for base64 encode & decode 2018-08-27 13:24:47 +02:00
Luis Diaz Mas
5d76036af5 Add more tests for decoding and encoding URL functions 2018-08-27 13:24:47 +02:00
Luis Diaz Mas
eefee8125b to_hex and from_hex removed from API 2018-08-27 13:24:47 +02:00
Luis Diaz Mas
22d9ab82a7 Format futils.h for better readability (also pass clang-format to it) 2018-08-27 13:24:47 +02:00
Luis Diaz Mas
c82d875707 Use pragma once instead of guards 2018-08-27 13:24:47 +02:00
Luis Diaz Mas
a3c200a23e Remove useless header inclusions 2018-08-27 13:24:47 +02:00
Luis Diaz Mas
41499b8ecd Use snprintf instead of sprintf in TimeValue::copy
- Replaced assert by enforce
2018-08-27 13:02:56 +02:00
Luis Díaz Más
1128d8926a Appveyor: Run CI with VS 2015 and 2017.
In order to achieve this objective the following actions were taken:
- Do not use the Ninja Generator, since it is more difficult to choose
  VS toolset to be used.
- Use arch x64 for conan and the CMake Generators (by default)
- Do not create profiles dir manually
- Detect new default conan profile automatically
- Remove clcache from appveyor since it does not integrate well with VS generators
- VS2013 removed from the matrix since some integration tests fail there.
2018-08-26 19:00:45 +02:00
Luis Diaz Mas
0bc6fbcea7 Add stdexcept header in unit test files 2018-08-26 15:46:47 +02:00
Luis Diaz Mas
d96b619515 Add braces for the main functions in the new source files at samples 2018-08-26 09:23:08 +02:00
Luis Diaz Mas
7d8edbe781 Remove more dead code 2018-08-26 09:23:08 +02:00
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