Commit Graph

7555 Commits

Author SHA1 Message Date
Kevin Backhouse
a3e4efe6b4
Rename fuzz target 2021-07-12 10:53:04 +01:00
Kevin Backhouse
bf786f4cc6
Updates to make fuzzing work. 2021-07-11 21:14:08 +01:00
Jeka Pats
b2cdf2a535
Add libFuzzer integration + report bug
This commit places the basics for libFuzzer integration with one
fuzzer which fuzzes the readMetadata function. The fuzzer is
located at fuzz/read-metadata.

To add more fuzzers please add them to ./fuzz directory as
described in the README.

Also a memory corruption bug is found using this fuzzer which
might lead to additional bugs after fix is pushed.
2021-07-09 12:32:21 +01:00
Kevin Backhouse
c7757d7c08
Merge pull request #1768 from kevinbackhouse/codeql-null-iterator-deref
Add custom CodeQL query for null iterator deref
2021-07-09 10:12:24 +01:00
Kevin Backhouse
fb824ac052
Add custom CodeQL query for null iterator deref. 2021-07-08 16:50:55 +01:00
Kevin Backhouse
9b3ed3f956
Merge pull request #1756 from ffontaine/main
add BUILD_WITH_STACK_PROTECTOR option
2021-07-08 11:34:20 +01:00
Andrea Giudiceandrea
43fe7bbb98
Add Exif.Image.PageName tag (#1765)
* Add Exif.Image.PageName tag

* Add trailing punctuation mark to PageName and DocumentName tags description.

* Add XPosition and YPosition TIFF tags
2021-07-07 18:16:08 +02:00
Kevin Backhouse
ff00771425 Better bounds checking in Jp2Image::printStructure
(cherry picked from commit 0fcdde80997913dde284ea98f06f9305d06cb160)
2021-07-05 22:43:13 +02:00
Kevin Backhouse
e486a7313e Regression test for https://github.com/Exiv2/exiv2/security/advisories/GHSA-583f-w9pm-99r2
(cherry picked from commit 655495847bc39170bc4c06f9727483874fdc9c93)
2021-07-05 22:43:13 +02:00
Kevin Backhouse
c2b52119d4 Check that findKey didn't return end(). 2021-07-05 22:26:09 +02:00
Kevin Backhouse
98fb218475 Throw exception if lens info wasn't found. 2021-07-05 22:26:09 +02:00
Kevin Backhouse
ab0ce25fe0 Regression test for https://github.com/Exiv2/exiv2/security/advisories/GHSA-h9x9-4f77-336w 2021-07-05 22:26:09 +02:00
Fabrice Fontaine
f31c0eba09 add BUILD_WITH_STACK_PROTECTOR option
Add BUILD_WITH_STACK_PROTECTOR to avoid the following build failure with
toolchains that don't support stack-protector:

/home/buildroot/autobuild/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/9.3.0/../../../../mipsel-buildroot-linux-uclibc/bin/ld: utils.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag]+0xd0): undefined reference to `__stack_chk_fail'

Indeed, support for -fstack-protector-strong can't be detected through
check_cxx_compiler_flag as some toolchains need to link with -lssp to
enable SSP support

Fixes:
 - http://autobuild.buildroot.org/results/ae4635899124c602c70d2b342a76f95c34aa4a3d

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2021-07-01 19:44:40 +02:00
Kevin Backhouse
d30c95d07e fix incorrect loop condition (#1752) 2021-07-01 19:21:45 +02:00
Kevin Backhouse
5ab3f2b0c5 Defensive coding to avoid 0x80000000/0xFFFFFFFF FPE. 2021-07-01 19:20:46 +02:00
Kevin Backhouse
11a26fb0d4 Prevent divide-by-zero crash. 2021-07-01 19:20:46 +02:00
Kevin Backhouse
cdc0267afd Regression test for https://github.com/Exiv2/exiv2/security/advisories/GHSA-pvjp-m4f6-q984 2021-07-01 19:20:46 +02:00
Kevin Backhouse
8c4d67ca50 Defensive coding to avoid 0x80000000/0xFFFFFFFF FPE. 2021-06-30 18:14:39 +02:00
Kevin Backhouse
695d22c27a
feat: Codeql analysis (#1747)
* Create codeql-analysis.yml

* Add main branch.

* Update to latest boilerplate.

* Replace schedule with workflow_dispatch, so that it can be triggered manually.

Co-authored-by: Robin Mills <robin@clanmills.com>
2021-06-28 15:00:10 +02:00
Rosen Penev
3b2a1b9d84 clang-tidy: use braced init list
Found with modernize-return-braced-init-list

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-28 08:29:02 +02:00
Rosen Penev
52a9ed30cf clang-tidy: use nullptr
Found with modernize-use-nullptr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-28 08:27:55 +02:00
norbertwg
d5b7f99fbf Three tag descriptions corrected 2021-06-27 13:28:30 +02:00
Rosen Penev
7732b9308e clang-tidy: add explicit
Found with hicpp-explicit-conversions

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-27 10:30:42 +02:00
Rosen Penev
37fea97dd3 clang-tidy: use override
Found with modernize-use-override

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-27 10:29:52 +02:00
Rosen Penev
b84d8e9a44 clang-tidy: use auto
Found with modernize-use-auto

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-27 10:29:08 +02:00
Rosen Penev
9210fb85f9 clang-tidy: pass by value
Found with modernize-pass-by-value

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-27 10:28:36 +02:00
Kevin Backhouse
b16cd52b88 Replace sprintf with snprintf. 2021-06-27 10:27:54 +02:00
Rosen Penev
97cf02bf12 clang-tidy: remove redundant specifiers
Found with readability-redundant-access-specifiers

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-27 10:26:23 +02:00
Rosen Penev
430ff1c9b8 clang-tidy: replace throw with noexcept
Found with modernize-use-noexcept

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-27 10:25:52 +02:00
Rosen Penev
2fbf2e6b7c clang-tidy: remove dedundant initializer
Found with readability-redundant-member-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-27 10:24:31 +02:00
Kevin Backhouse
a4c5bdac19 fix: stricter date parsing in value.cpp (#1720)
* Regression test for issue 1713

* Stricter date parsing.

* Fix test failure caused by stdout mismatch.

(cherry picked from commit ab58026cff0e5edebc026261e9dc4b7db05b802d)
2021-06-27 10:21:38 +02:00
mergify[bot]
1d64f482ff
fix: use vector::at() rather than operator[] (backport #1735) (#1741)
* fix: use vector::at() rather than operator[] (#1735)

* Regression test for https://github.com/Exiv2/exiv2/issues/1706

* Use vector::at() rather than operator[].

* Print to stderr when exception is caught and EXIV2_DEBUG_MESSAGES is enabled.

* Check that it prints "Bad value" for the date.

(cherry picked from commit f4d3adbf91e6dc4e34aee5bac7b7fd9e127a5c00)

# Conflicts:
#	src/value.cpp

* fix merge conflicts from mergify backport

Co-authored-by: Kevin Backhouse <kevinbackhouse@github.com>
Co-authored-by: Christoph Hasse <hassec@users.noreply.github.com>
2021-06-27 09:33:56 +02:00
Kevin Backhouse
2b84f4bd64
fix: zero initialize local variables. (#1743)
* Zero initialize local variables.

* Initialize xmpID_
2021-06-27 08:56:31 +02:00
Robin Mills
fe83c739a2
Merge pull request #1738 from Exiv2/exifprint_lint2
exifprint_lint
2021-06-25 13:08:03 +01:00
Robin Mills
6e638e7a40 Fix python test code to run on Windows. 2021-06-25 08:11:47 +01:00
Robin Mills
6452a9ce36 Fixing typos. 2021-06-24 17:49:47 +01:00
Robin Mills
739673335c Forgive "SHORT or LONG" tags. Add test code. 2021-06-24 09:49:22 +01:00
Robin Mills
fd2ab89de5 exifprint_lint 2021-06-23 14:24:46 +01:00
Kevin Backhouse
3e099da7b7 Remove obsolete snprintf macros. 2021-06-22 18:25:52 +02:00
Christoph Hasse
2539e5dd7e fix: change duplicated Canon RF 100-500 2x into missing 1.4 teleconverter version 2021-06-22 09:47:02 +02:00
Christoph Hasse
704ee571de fix: allow for FX.Y syntax in aperture regex 2021-06-22 09:47:02 +02:00
Daniel Vogelbacher
fa78ab3593 Use official Canon RF lens model names
The new RF line is named F2.8L instead of f/2.8L (for example).

This patch makes the model names identically to the official
Canon lens names and the same names exiftool uses.
2021-06-22 09:47:02 +02:00
Rosen Penev
4a654e4266 clang-tidy: do not use 0 for bool
Found with modernize-use-bool-literals

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-21 21:00:05 +02:00
Rosen Penev
99823a526c clang-tidy: replace virtual with override
Found with modernize-use-override

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-21 20:59:48 +02:00
Christoph Hasse
653c5696d4
Merge pull request #1714 from attilaolah/patch-1
fix: compilation with -Wunused-variable
2021-06-21 20:24:52 +02:00
Antonio Rojas
c069e36605 Fix build with gtest 1.11
INSTANTIATE_TYPED_TEST_CASE_P requires a non-empty prefix now
2021-06-20 23:05:34 +02:00
Christoph Hasse
2f83b7e0f6
Merge pull request #1692 from Exiv2/hassec_canon_lens_test
New Canon Lens Identification + Automatic Test of all Lenses
2021-06-20 22:28:34 +02:00
andyrtr
cfeceee416
add lens: Olympus M.ZUIKO DIGITAL ED 12-45mm F4.0 PRO (#1725)
* add lens ID for Olympus M.Zuiko Digital ED 12-45mm F4.0 Pro #1723

* add test for #1723 checking the Olympus M.Zuiko Digital ED 12-45mm F4.0 Pro recognized correctly
2021-06-20 22:15:01 +02:00
Attila Oláh
33419c8dd1
Fix compilation with -Wunused-variable
When compiling with -Wunused-variable, `EXT_STRERROR_R_CHAR_P` gets undefined because of a failing compilation check.

An alternative would be to mark `c` as `__attribute__((undefined))`, but MSVC doesn't have `__attribute__((undefined))`.
2021-06-14 12:41:47 +00:00
Rosen Penev
19000cd53c con/destructor fixes
Added = delete to make it explicit. Also made them public.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-10 18:08:11 +02:00