Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2629 commits
Select commit Hold shift + click to select a range
709de82
fix curl range
neheb Apr 25, 2025
bbe4bc6
copy in constructor instead of std::copy
neheb Apr 15, 2025
6bb801d
metadatum: remove deleted move operations
neheb Apr 1, 2025
7ad6dcb
clang-tidy: avoid warning with stringFormat
neheb Apr 25, 2025
c4e0458
remove Impl deleted function members
neheb Apr 24, 2025
5951e2f
use CTAD for array
neheb Apr 2, 2025
316cb55
use llround
neheb Apr 10, 2025
104fa10
move some headers out of hpp files
neheb Jun 22, 2025
decdbb7
change namespace Tag to enum
neheb Jun 23, 2025
4a79265
MSVC CI might be bugged here
neheb Jun 23, 2025
836aa01
Add new Canon model and RF lens IDs
kmilos Mar 27, 2025
c4b086f
Add Pentax KF model ID
kmilos Mar 31, 2025
4920778
Add new Sony model IDs
kmilos Apr 24, 2025
2b11b4e
Add new Nikon Z lens IDs
kmilos Jun 20, 2025
b1ba73e
move copy constructor to protected
neheb Apr 24, 2025
e4f1f21
replace constructor with using declaration
neheb Apr 25, 2025
38545e5
remove defaulted copy constructors
neheb Apr 25, 2025
ceee3dc
Indicate no translation for Nikon lenses
kmilos Apr 23, 2025
a3f628d
Convert Nikon Z lenses to an ordinary map
kmilos Apr 24, 2025
bcab647
make iccProfileDefined const
neheb Jun 23, 2025
ae6cb21
clang-tidy: avoid promotion warning
neheb Jun 24, 2025
2bcbf91
make some virtual functions const
neheb Jun 24, 2025
4c380a2
basicio: delete base class member funcs
neheb May 18, 2025
bff3b36
meson: add tests
neheb Mar 24, 2023
baa524a
Bump cygwin/cygwin-install-action from 5 to 6
dependabot[bot] Jul 7, 2025
3447f7d
fix most weak-vtable warnings
neheb Jul 10, 2025
5c960c4
remove unneeded default destructor
neheb Jul 11, 2025
db38c65
i18n: don't export _exvGettext
neheb Jul 14, 2025
0d1f4ee
CI: GCC 13 is now stable on Cygwin
kmilos Jul 24, 2025
0afeb2f
Add new fuzz target
kevinbackhouse Jul 29, 2025
2f86a55
Merge pull request #3313 from kevinbackhouse/fuzz-read-write
kevinbackhouse Jul 30, 2025
33fba21
slice: use auto and remove using declarations
neheb Apr 15, 2025
110ff45
remove some std::arrays
neheb Apr 2, 2025
481865f
gcc: fix -Wdouble-promotion
neheb Jun 26, 2025
4d4abca
cmake: remove ICONV_ACCEPTS_CONST_INPUT
neheb Jun 27, 2025
7c9bbd3
move basicio.hpp include away from header
neheb Jun 27, 2025
9d500e9
use UniquePtr
neheb Jun 27, 2025
81e92fc
change pointer parameter to unique_ptr
neheb Jun 27, 2025
312f1a1
clang-tidy: use LLVM style header guards
neheb Jun 27, 2025
128e739
clang-tidy: add nodiscard for getFileLength
neheb Jun 27, 2025
9a3cadf
clang-tidy: use parentheses for math
neheb Jun 27, 2025
468e016
replace function with lambda
neheb Jun 30, 2025
8469f94
use unqualified UniquePtr
neheb Jun 29, 2025
542b533
remove if constexpr in headers
neheb Aug 2, 2025
b4fa182
canonmn_int: use raw strings and simplified regex
neheb Jun 25, 2025
d518449
remove C++11 compatibility
neheb Aug 3, 2025
25c0bf9
Update for PLUS License Data Format rev. 2.0.1:
sarunasb Aug 1, 2025
a79ab52
Add missing plusDataMining to XmpPrintInfo[].
sarunasb Aug 5, 2025
96b0340
Trying to please the Clang Format Checker. Extra spaces?
sarunasb Aug 6, 2025
2384644
Bump actions/checkout from 4 to 5
dependabot[bot] Aug 12, 2025
e499392
Bump actions/download-artifact from 4 to 5
dependabot[bot] Aug 12, 2025
115efec
Forgive not having Exif header in PNG text chunk
kmilos Aug 13, 2025
d4900fc
simplify header inclusion in public headers
neheb Jun 23, 2025
76d684c
meson: remove cmake config and fix pkgconfig
neheb Jun 27, 2025
b3ef14e
meson: add app option
neheb Jun 27, 2025
7361eea
use isgreater
neheb Mar 6, 2025
4e28dc9
Remove obsolete comments about iconv on Windows.
kevinbackhouse Aug 13, 2025
a2f8eb3
Add missing find_dependency() calls to exiv2Config.cmake.in
amazingakai Aug 16, 2025
a4dbf05
Add new Sony model IDs
kmilos Jul 29, 2025
ea38c03
Add some Viltrox lenses for Z-mount
kmilos Aug 5, 2025
9073d04
Add new Sony model IDs
kmilos Aug 19, 2025
fdeb9ab
Add a variant of Yongnuo lens for Nikon
kmilos Aug 19, 2025
b062259
github CI: fix OmniOS
neheb Aug 19, 2025
472d55e
Add new method appendIccProfile to fix quadratic performance issue.
kevinbackhouse Aug 15, 2025
eceaa07
Fix docstring
kevinbackhouse Aug 18, 2025
4644a09
some more header inclusion reduction
neheb Jul 11, 2025
cf1015c
reintroduce if constexpr
neheb Aug 3, 2025
522b996
Fix brotli library linking order in FindBrotli.cmake
amazingakai Aug 20, 2025
3db3e4e
fix copy constructors
neheb Aug 14, 2025
a67c192
byteswap: add MSVC handling
neheb Mar 19, 2025
f3994b1
toAscii: replace logic with masking loop
neheb Apr 18, 2025
c624554
use Image::byteSwap
neheb Mar 19, 2025
ee3e9ad
use more bit_cast
neheb Mar 20, 2025
68977b0
asfvideo: replace memcpy and byteSwap
neheb Apr 18, 2025
d46b8b5
Add Sigma 150-600mm F5-6.3 DG OS HSM | C for Canon
kmilos Aug 20, 2025
d4838dd
Clear error when Brotli/inih not found for static builds in exiv2Config
amazingakai Aug 19, 2025
479d5e1
Update cmake/exiv2Config.cmake.in
amazingakai Aug 21, 2025
78557b6
avoid shadowing warning
neheb Mar 30, 2025
c8088b8
reanme files using Exif tags
norbertwg Oct 4, 2023
492d860
replace using Exif tags after date/time
norbertwg Oct 8, 2023
b0635be
fix error Ubuntu and MacOS;
norbertwg Oct 8, 2023
9515dfb
fix compile error Ubuntu and MacOS;
norbertwg Oct 9, 2023
1913452
change in recognize Mac;
norbertwg Oct 9, 2023
c42c755
invalid characters: differ only win32 and other
norbertwg Oct 9, 2023
d31fff2
update of documentation
norbertwg Oct 9, 2023
03802df
rename: path separator for new path based on old path
norbertwg Dec 6, 2024
eea87bf
Suggested changes from kevinbackhouse
norbertwg Aug 23, 2025
603c8cb
fix clang-format issue
norbertwg Aug 23, 2025
8993a40
Add comment for XmpText in section 'Exif/IPTC/XMP types'
norbertwg Aug 29, 2025
b6b2be5
Add Ricoh GR IV ID
kmilos Aug 28, 2025
8504a73
some non const reference removals
neheb Aug 22, 2025
cfd2856
Regression test for https://github.com/Exiv2/exiv2/security/advisorie…
kevinbackhouse Jul 29, 2025
82a05c8
Better bounds checking to fix https://github.com/Exiv2/exiv2/security…
kevinbackhouse Jul 29, 2025
a28a830
Fix test failure. Expected error message was wrong. It should be "Fai…
kevinbackhouse Aug 29, 2025
8c9e500
Release Exiv2 version 0.28.6
kevinbackhouse Aug 26, 2025
2b8889b
Prune table and add link to list of advisories
kevinbackhouse Aug 29, 2025
07b2fca
Fix release date
kevinbackhouse Aug 29, 2025
789b329
Make methods non-virtual
kevinbackhouse Aug 30, 2025
0a09ff1
Merge pull request #3375 from Exiv2/mergify/bp/main/pr-3366
kevinbackhouse Aug 31, 2025
4d959ed
geotag: use more std::filesysten
neheb Mar 17, 2025
7671300
Release Exiv2 version 0.28.7
kevinbackhouse Aug 30, 2025
a8e65f4
make more constructors constexpr
neheb Aug 16, 2025
ca29623
use _isatty on Windows
neheb Aug 23, 2025
513b1b0
remove pointless empty template parameters.
neheb Aug 19, 2025
de49e33
clang 9 compilation fixes
neheb Aug 20, 2025
1cb11d8
fmt: make minimum version 5.0.0
neheb Aug 20, 2025
89de153
remove exvGettext in favor of macro
neheb Sep 8, 2025
3294927
get rid of _exvGettext
neheb Sep 8, 2025
40e1fc7
meson: add required feature for brotli
neheb Sep 6, 2025
602d24a
meson: update subprojects
neheb Sep 6, 2025
c322cb4
remove _
neheb Sep 5, 2025
451ed7b
clang-tidy: use ifdef
neheb Aug 30, 2025
ab48f59
Bump actions/github-script from 7 to 8
dependabot[bot] Sep 8, 2025
223c33c
meson CI: install more packages for Ubuntu GCC
neheb Sep 8, 2025
8dab519
replace copy_n with constructor
neheb Sep 7, 2025
21d994d
remove const cast
neheb Sep 7, 2025
7c2b282
use const ref for updateDirEntry
neheb Sep 7, 2025
5f613ae
Revert "clang-tidy: use release() on dynamic_cast"
neheb Sep 9, 2025
21fa9ab
remove some functions
neheb Feb 11, 2025
b5c6513
slightly simplify print0x009e
neheb Sep 10, 2025
f935e99
Make DataValue::value_ public
jim-easterbrook Sep 8, 2025
c9cea75
change some unique to shared ptrs
neheb Sep 9, 2025
a93c091
github CI: use macOS 15 for x86
neheb Oct 2, 2025
ed82141
futils: use anonymous namespace
neheb Sep 28, 2025
68fdd17
futils: simplify getEnv slightly
neheb Sep 28, 2025
a513534
futils: use _dupenv_s
neheb Sep 28, 2025
fccc516
CI: update CentOS setup
kmilos Oct 3, 2025
4ade22f
Update install_dependencies.sh
kmilos Oct 3, 2025
40d63d1
remove various toString calls
neheb Apr 4, 2025
5089d9f
CI: fix inih install for CentOS
kmilos Oct 6, 2025
58483b0
meson subprojects: update
neheb Oct 7, 2025
c38342f
reenable stdin
neheb Jan 31, 2025
51dfe90
Bump github/codeql-action from 3 to 4
dependabot[bot] Oct 13, 2025
79e253f
Bump actions/download-artifact from 5 to 6
dependabot[bot] Oct 27, 2025
16ae221
Bump actions/upload-artifact from 4 to 5
dependabot[bot] Oct 27, 2025
b7186dd
github CI: meson: add arm64 windows
neheb Nov 3, 2025
30752b4
tags_int: reduce templates
neheb Oct 27, 2025
9982b41
more header reductions and forward declarations
neheb Oct 4, 2025
0ba1bb4
uninline constexpr constructors
neheb Oct 16, 2025
f45b67c
CI: skip installing ninja on macOS (#3420)
kmilos Nov 19, 2025
174c759
convert const TagInfo returns to constexpr
neheb Nov 18, 2025
e3bb91b
clang: fix -Wdocumentation warnings
neheb Oct 10, 2025
cc27b24
small upper/lower improvement
neheb Oct 10, 2025
3570da5
use auto return type
neheb Oct 11, 2025
2ac5eaf
coverity: add missing fmtflags
neheb Oct 13, 2025
74c816e
cppcheck: const additions
neheb Oct 17, 2025
8070188
clazy: trivial types to value
neheb Oct 9, 2025
3b6f27c
clazy: delete some polymorphic classes
neheb Oct 9, 2025
664ef6a
github CI: run through zimzor
neheb Oct 9, 2025
181ee38
easyaccess: back to normal templated function
neheb Mar 31, 2025
c01408a
Bump actions/checkout from 5 to 6
dependabot[bot] Nov 24, 2025
bbc5fb4
CI: remove libfmt from nightly dependencies
kmilos Nov 26, 2025
3c05bea
CI: remove libfmt from CodeQL action
kmilos Nov 26, 2025
fd1b148
fix reading mp4 url box nested in non video/audio track
nkming2 Nov 26, 2025
b869e81
use unique_ptr
neheb Nov 25, 2025
0e90364
use Blob instead of std::vector<byte>
neheb Nov 25, 2025
5172704
maybe Blob is better than unique_ptr
neheb Nov 25, 2025
7ac25bb
CI: add loongarch64
neheb Dec 6, 2025
ed60192
Bump actions/cache from 4 to 5
dependabot[bot] Dec 15, 2025
596417e
Bump actions/download-artifact from 6 to 7
dependabot[bot] Dec 15, 2025
81ce1b5
Bump actions/upload-artifact from 5 to 6
dependabot[bot] Dec 15, 2025
d17cfb6
fix: do not add target exiv2lib if the target already exists
nakrakiiya Dec 16, 2025
c58e1fb
simplify fmt/std format define
neheb Dec 18, 2025
f8c6d35
fix wrong timescale used to calculate fps
nkming2 Dec 17, 2025
6ce3f9d
fix the expected fps value in test cases
nkming2 Dec 18, 2025
a61ad46
meson: update subprojects
neheb Dec 21, 2025
872237d
Bump egor-tensin/setup-clang from 1 to 2
dependabot[bot] Dec 29, 2025
1ea4466
Bump egor-tensin/setup-gcc from 1 to 2
dependabot[bot] Jan 5, 2026
8922e1d
remove dynamic cast
neheb Jan 14, 2026
caab4d6
move signature_ out of line
neheb Nov 17, 2025
fcf5e81
header reductions
neheb Nov 17, 2025
77030e6
remove some ostringstream usages
neheb Jan 21, 2026
ed77c58
fix some MSVC warnings
neheb Nov 14, 2025
811417e
add implicit headers
neheb Apr 25, 2025
8c477ba
get rid of maybe_unused
neheb Sep 8, 2025
56a0413
std::max
neheb Oct 18, 2025
6db4f42
replace template with auto
neheb Oct 22, 2025
769dbb6
reduce some TagInfo indentation
neheb Nov 18, 2025
5e50903
Update and rename exiv2Config.cmake.in to exiv2-config.cmake.in
kmilos Jan 27, 2026
7fc8edf
CMake: use alternative exported config naming scheme
kmilos Jan 27, 2026
97cb92b
convert some ostreams to stringFormat
neheb Jun 26, 2025
02e6c5c
nikomn: simplify by returning os directly
neheb Jun 26, 2025
c9a883e
sonymn: return by ostream
neheb Apr 2, 2025
a14510a
replace templated prints with macros
neheb Jun 26, 2025
7516b53
Regression test for https://github.com/Exiv2/exiv2/issues/3455
kevinbackhouse Jan 29, 2026
40fe4dd
Add size checks to avoid large memory allocations.
kevinbackhouse Jan 29, 2026
0ae1584
Check that the string isn't empty before calling front().
kevinbackhouse Jan 29, 2026
85e13a1
Change size calculation in XmpTextValue::size().
kevinbackhouse Jan 29, 2026
acb8f97
Merge pull request #3457 from kevinbackhouse/fix-issue-3454
kevinbackhouse Jan 30, 2026
7dbdb18
Reduce indentation
kevinbackhouse Jan 30, 2026
63d518d
simplify
kevinbackhouse Jan 30, 2026
e87b148
Merge pull request #3456 from kevinbackhouse/fix-issue-3455
kevinbackhouse Jan 31, 2026
1071589
Add new Canon cameras and RF lenses
kmilos Dec 4, 2025
637a368
Add new Nikon Z lenses
kmilos Nov 24, 2025
f22a40e
Add new Sony camera
kmilos Dec 4, 2025
a6dbf5f
Refactor: Consolidate XMP Toolkit lifecycle management
serghov Feb 2, 2026
b4cae04
Refactor: Enforce XMP thread-safety using Witness Pattern
serghov Feb 4, 2026
8bea466
Tests: Add concurrent XMP regression tests
serghov Feb 2, 2026
ff9d26a
Stop this error message from happening:
kevinbackhouse Feb 7, 2026
6af336e
Update reference files
kevinbackhouse Feb 7, 2026
6e7600b
Merge pull request #3458 from kevinbackhouse/fix-issue-3443
kevinbackhouse Feb 8, 2026
da39818
Avoid calling std::find or std::string with an invalid (negative leng…
kevinbackhouse Feb 8, 2026
9407d21
Fix test names for URL parsing and decoding
kevinbackhouse Feb 9, 2026
2bb8da5
Fix test names for URL parsing tests
kevinbackhouse Feb 9, 2026
2bd118a
CI: ensure Cygwin Python is used
kmilos Feb 10, 2026
b8ba5b0
Refactor XmpKey::decomposeKey and XmpKey::Impl constructor to use Unl…
serghov Feb 11, 2026
a5ead4c
Merge pull request #3448 from serghov/xmp-locking-fix
kevinbackhouse Feb 11, 2026
1f6f7a4
meson: reduce linking
neheb Jun 28, 2025
62c2a3e
meson: fix iconv for freebsd
neheb Jan 28, 2026
c279204
meson: update to 0.63 minimum
neheb Jan 26, 2026
6a68147
Merge pull request #3469 from kevinbackhouse/fix-issue-3468
kevinbackhouse Feb 12, 2026
1d39f64
Nightly release is incompatible with immutable releases
kevinbackhouse Feb 14, 2026
e470408
Add quotes
kevinbackhouse Feb 15, 2026
4592be4
Remove CodeSee
kevinbackhouse Feb 15, 2026
e822c48
Upload crash files when fuzzing fails.
kevinbackhouse Feb 15, 2026
38b989a
Fix UBSAN false positive
kevinbackhouse Feb 15, 2026
1f3ae88
Add new Canon RF lenses
kmilos Feb 9, 2026
a6ae2e2
Add fuzzing crash file to corpus
kevinbackhouse Feb 15, 2026
2c3a18b
Use std::string::compare()
kevinbackhouse Feb 16, 2026
f27507d
Merge pull request #3484 from kevinbackhouse/detectCharset
kevinbackhouse Feb 16, 2026
f4e68fd
Merge pull request #3483 from kevinbackhouse/append-zero
kevinbackhouse Feb 16, 2026
11a1745
Merge pull request #3481 from kevinbackhouse/remove-codesee
kevinbackhouse Feb 16, 2026
7a30860
Merge branch 'main' into fix-mp4-fps
kevinbackhouse Feb 16, 2026
7841b98
Merge pull request #3482 from kevinbackhouse/fuzz-artifacts
kevinbackhouse Feb 16, 2026
17fd463
Merge pull request #3479 from kevinbackhouse/release
kevinbackhouse Feb 16, 2026
3f0be35
Regression test for https://github.com/Exiv2/exiv2/security/advisorie…
kevinbackhouse Feb 7, 2026
db014be
Fix out-of-bounds read.
kevinbackhouse Jan 31, 2026
c06807c
Merge pull request #3437 from nkming2/fix-mp4-fps
kevinbackhouse Feb 17, 2026
ed5bfc9
Fix regression in Canon lens detection
webmeister Dec 7, 2020
677e4cf
Remove nightly release vestiges
kmilos Feb 17, 2026
de515c7
Add Tamron 18-400mm on Nikon D90
byteit101 Feb 17, 2026
cfbeae2
conan: update dependencies
kmilos Feb 18, 2026
45c8b18
Add Ricoh GR IV HDF and Monochrome IDs
kmilos Feb 18, 2026
0f7528c
Add build provenance attestation.
kevinbackhouse Feb 22, 2026
d114ebb
Add fuzz target for previews
kevinbackhouse Feb 20, 2026
4a2d50d
Merge pull request #3504 from kevinbackhouse/build-attestation
kevinbackhouse Feb 23, 2026
dbef0ee
Merge pull request #3505 from kevinbackhouse/fuzz-preview
kevinbackhouse Feb 23, 2026
240395b
Update README.md
kmilos Feb 23, 2026
fe0d015
Regression test for https://github.com/Exiv2/exiv2/issues/3511
kevinbackhouse Feb 26, 2026
2cb728a
Check for integer overflow.
kevinbackhouse Feb 26, 2026
7adedce
Regression test for https://github.com/Exiv2/exiv2/issues/3513
kevinbackhouse Feb 26, 2026
68d3687
Update README.md
kmilos Feb 24, 2026
284b4e2
Check for integer overflow.
kevinbackhouse Feb 27, 2026
eaa9e21
Merge pull request #3512 from kevinbackhouse/fix-issue-3511
kevinbackhouse Feb 27, 2026
659db31
Merge pull request #3514 from kevinbackhouse/fix-issue-3513
kevinbackhouse Feb 27, 2026
3dc6c6b
Release Exiv2 version 0.28.8
kevinbackhouse Feb 28, 2026
390ab80
Bump actions/download-artifact from 7 to 8
dependabot[bot] Mar 2, 2026
09b2add
Bump actions/attest-build-provenance from 3.2.0 to 4.1.0
dependabot[bot] Mar 2, 2026
f9efd0e
Bump actions/upload-artifact from 6 to 7
dependabot[bot] Mar 2, 2026
5a23b00
tiffvisitor: fix uint32_t overflow in readTiffEntry offset check
blackcaesar0 Mar 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 24 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
# Indentation for all files
ColumnLimit: 120

# C++ Options
Language: Cpp
BasedOnStyle: Google

# Force pointers to the type for C++.
DerivePointerAlignment: false
PointerAlignment: Left

# Useful for sorting the project inclusions and standard library inclusions separately
IncludeBlocks: Preserve

# Constructor initializers better formatted in presence of preprocessor conditions (see image.cpp)
BreakConstructorInitializers: AfterColon

# Do not allow SingleLine statements (to improve coverage statistics)
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false

...
28 changes: 0 additions & 28 deletions .clang-format.optional

This file was deleted.

17 changes: 17 additions & 0 deletions .cmake-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
with section("format"):

# How wide to allow formatted cmake files
line_width = 150

# How many spaces to tab for indent
tab_size = 2

# If true, separate flow control names from their parentheses with a space
separate_ctrl_name_with_space = False

# If true, separate function names from parentheses with a space
separate_fn_name_with_space = False

# If a statement is wrapped to more than one line, than dangle the closing
# parenthesis on its own line.
dangle_parens = True
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[*]
charset = utf-8
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace=true
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# ignore global clang-format
30bf563f4d71ff284b5f42d45f77226200a2e571
# fic formatting followup from #2158
a3cb054746beed514679592ffec9378acc9e5d41
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

#### **Describe the bug**
A clear and concise description of the bug, including your use case for exiv2.

#### **To Reproduce**
Steps to reproduce the behavior:
1. Provide the file with which you observed the issue (commonly named PoC). Explain the status of the file (e.g., direct from camera, edited with darktable), whether you own the copyright and if you allow the file to be added to exiv2 under the [project's license](https://github.com/Exiv2/exiv2/blob/main/COPYING)
2. List the exact commands/functions to reproduce the issue and include any related output
3. Mention the branch and commit in which you observed the issue (e.g., `main, commit 9f721b40`, `0.27-maintenance, latest`)

#### **Expected behavior**
A short description of what you expected to happen.

#### **Desktop (please complete the following information):**
- OS and version: (e.g., Linux (Fedora 36), macOS 12.5, Windows 11)
- Exiv2 version and source: (e.g., 0.27.5 from exiv2.org)
- Compiler and version: (e.g., Gcc 12.2, Clang 14.0.0, MSVC 2022)
- Compilation mode and/or compiler flags: (e.g., debug, `-O3`)

#### **Additional context**
Add any other information about the problem here.
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: request
assignees: ''

---

#### **Is your feature request related to a problem?**
A clear and concise description of the problem, including your use case for exiv2 and any impact on your workflow.

#### **Describe the solution you would like**
A short description of what you want to happen.

#### **Describe alternatives you have considered**
A simple explanation of any alternative solutions (e.g., using ExifTool) or features you have considered (e.g., convert the file to JPEG).

#### **Desktop**
- OS and version: (e.g., Linux (Fedora 36), macOS 12.5, Windows 11)
- Exiv2 version and source: (e.g., 0.27.5 from exiv2.org)
- Any software using exiv2 and source: (e.g., darktable 4.0 from darktable.org)

#### **Additional context**
Add any other information about the feature request here (e.g. screenshots, URLs, test files).
3 changes: 3 additions & 0 deletions .github/codeql-queries/exiv2-code-scanning.qls
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Reusing existing QL Pack
- import: codeql-suites/cpp-code-scanning.qls
from: codeql-cpp
23 changes: 23 additions & 0 deletions .github/codeql-queries/exiv2-cpp-queries/null_iterator_deref.qhelp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE qhelp SYSTEM "qhelp.dtd">
<qhelp>
<overview>
<p>
A C++ iterator is a lot like a C pointer: if you dereference it without
first checking that it's valid then it can cause a crash.
</p>
</overview>
<recommendation>
<p>
Always check that the iterator is valid before derefencing it.
</p>
</recommendation>
<example>
<p>
<a href="https://github.com/Exiv2/exiv2/issues/1763">Issue 1763</a> was caused by
<a href="https://github.com/Exiv2/exiv2/blob/9b3ed3f9564b4ea51b43c78671435bde6b862e08/src/canonmn_int.cpp#L2755">this
dereference</a> of the iterator <tt>pos</tt>.
The bug was <a href="https://github.com/Exiv2/exiv2/pull/1767">fixed</a> by not dereferencing
<tt>pos</tt> if <tt>pos == metadata->end()</tt>.
</p>
</example>
</qhelp>
47 changes: 47 additions & 0 deletions .github/codeql-queries/exiv2-cpp-queries/null_iterator_deref.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* @name NULL iterator deref
* @description Dereferencing an iterator without checking that it's valid could cause a crash.
* @kind problem
* @problem.severity warning
* @id cpp/null-iterator-deref
* @tags security
* external/cwe/cwe-476
*/

import cpp
import semmle.code.cpp.controlflow.Guards
import semmle.code.cpp.dataflow.DataFlow

// Holds if `cond` is a condition like `use == table.end()`.
// `eq_is_true` is `true` for `==`, `false` for '!=`.
// Note: the `==` is actually an overloaded `operator==`.
predicate end_condition(GuardCondition cond, Expr use, FunctionCall endCall, boolean eq_is_true) {
exists(FunctionCall eq |
exists(string opName | eq.getTarget().getName() = opName |
opName = "operator==" and eq_is_true = true
or
opName = "operator!=" and eq_is_true = false
) and
DataFlow::localExprFlow(use, eq.getAnArgument()) and
DataFlow::localExprFlow(endCall, eq.getAnArgument()) and
endCall.getTarget().getName() = "end" and
DataFlow::localExprFlow(eq, cond)
)
}

from FunctionCall call, Expr use
where
call.getTarget().getName() = "findKey" and
DataFlow::localExprFlow(call, use) and
use != call and
not use.(AssignExpr).getRValue() = call and
not end_condition(_, use, _, _) and
not exists(
Expr cond_use, FunctionCall endCall, GuardCondition cond, BasicBlock block, boolean branch
|
end_condition(cond, cond_use, endCall, branch) and
DataFlow::localExprFlow(call, cond_use) and
cond.controls(block, branch.booleanNot()) and
block.contains(use)
)
select call, "Iterator returned by findKey might cause a null deref $@.", use, "here"
65 changes: 65 additions & 0 deletions .github/codeql-queries/exiv2-cpp-queries/null_metadata_in_print.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
* @name Null metadata in print function
* @description Print functions need to check that the metadata isn't null before calling methods on it.
* @kind problem
* @problem.severity warning
* @id cpp/null-metadata-in-print
*/

import cpp
import semmle.code.cpp.controlflow.Guards
import semmle.code.cpp.controlflow.Nullness
import semmle.code.cpp.rangeanalysis.RangeAnalysisUtils

// Find all the print functions by looking for TagInfo initializers
// like this one:
// https://github.com/Exiv2/exiv2/blob/6b186a4cd276ac11b3ea69951c2112f4c4814b9a/src/canonmn_int.cpp#L660-L679
class PrintFunction extends Function {
PrintFunction() {
exists(Initializer i, Field f |
i.getExpr().(ArrayAggregateLiteral).getAChild().(ClassAggregateLiteral).getAFieldExpr(f) =
this.getAnAccess() and
f.getName() = "printFct_"
)
}
}

predicate metadataDeref(Expr metadata) {
exists(Call call | call.getQualifier() = metadata)
or
exists(FunctionCall call, int argIndex, Function f |
call.getArgument(argIndex) = metadata and
f = call.getTarget() and
metadataDeref(f.getParameter(argIndex).getAnAccess())
)
}

predicate unsafePointerParam(Function f, int paramIndex, Expr use) {
exists(Parameter p |
p = f.getParameter(paramIndex) and
use = p.getAnAccess() and
unsafePointerExpr(use) and
not exists(GuardCondition nonNullCheck, BasicBlock block, boolean branch |
validCheckExpr(nonNullCheck, p) and
nonNullCheck.controls(block, branch) and
block.contains(use)
)
)
}

predicate unsafePointerExpr(Expr e) {
exists(Call call |
call.getQualifier() = e and
e.getType().getUnspecifiedType() instanceof PointerType
)
or
exists(FunctionCall call, int argIndex, Function f |
call.getArgument(argIndex) = e and
f = call.getTarget() and
unsafePointerParam(f, argIndex, _)
)
}

from PrintFunction printfcn, Parameter p, Expr metadata
where unsafePointerParam(printfcn, 2, metadata)
select metadata, "Print functions need to check that the metadata isn't null."
4 changes: 4 additions & 0 deletions .github/codeql-queries/exiv2-cpp-queries/qlpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: exiv2-cpp-queries
version: 0.0.0
libraryPathDependencies: codeql-cpp
suites: exiv2-cpp-suite
24 changes: 24 additions & 0 deletions .github/codeql-queries/exiv2-cpp-queries/signed_shift.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* @name Signed shift
* @description Shifting a negative number is undefined behavior,
* so it is risky to shift a signed number.
* @kind problem
* @problem.severity warning
* @id cpp/signed-shift
* @tags security
* external/cwe/cwe-758
*/

// See the "Bitwise shift operators" section here:
// https://en.cppreference.com/w/cpp/language/operator_arithmetic
import cpp
import semmle.code.cpp.rangeanalysis.SimpleRangeAnalysis

from BinaryBitwiseOperation shift, Expr lhs
where
(shift instanceof LShiftExpr or shift instanceof RShiftExpr) and
lhs = shift.getLeftOperand().getFullyConverted() and
lowerBound(lhs) < 0
select shift,
"This signed shift could cause undefined behavior if the value is negative. Type of lhs: " +
lhs.getType().toString()
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE qhelp SYSTEM "qhelp.dtd">
<qhelp>
<overview>
<p>
The <a href="https://en.cppreference.com/w/cpp/container/vector/operator_at"><tt>operator[]</tt></a> method of <a href="https://en.cppreference.com/w/cpp/container/vector"><tt>std::vector</tt></a> does not do any bounds checking on the index. It is safer to use the <a href="https://en.cppreference.com/w/cpp/container/vector/at"><tt>at()</tt></a> method, which does do bounds checking.
</p>
</overview>
<recommendation>
<p>
Use the <a href="https://en.cppreference.com/w/cpp/container/vector/at"><tt>at()</tt></a> method, rather than <a href="https://en.cppreference.com/w/cpp/container/vector/operator_at"><tt>operator[]</tt></a>.
</p>
<p>
Some uses of <a href="https://en.cppreference.com/w/cpp/container/vector/operator_at"><tt>operator[]</tt></a> are safe because they are protected by a bounds check. The query recognises the following safe coding patterns:
</p>
<ul>
<li><tt>if (!x.empty()) { ...x[0]... }</tt></li>
<li><tt>if (x.length()) { ...x[0]... }</tt></li>
<li><tt>if (x.size() > 2) { ...x[2]... }</tt></li>
<li><tt>if (x.size() == 2) { ...x[1]... }</tt></li>
<li><tt>if (x.size() != 0) { ...x[0]... }</tt></li>
<li><tt>if (i < x.size()) { ... x[i] ... }</tt></li>
<li><tt>if (!x.empty()) { ... x[x.size() - 1] ... }</tt></li>
</ul>
</recommendation>
<example>
<p>
<a href="https://github.com/Exiv2/exiv2/issues/1706">#1706</a> was caused by a lack of bounds-checking on <a href="https://github.com/Exiv2/exiv2/blob/15098f4ef50cc721ad0018218acab2ff06e60beb/include/exiv2/value.hpp#L1639">this array access</a>. The bug was <a href="https://github.com/Exiv2/exiv2/pull/1735">fixed</a> calling the <a href="https://en.cppreference.com/w/cpp/container/vector/at"><tt>at()</tt></a> method instead.
</p>
</example>
</qhelp>
Loading