platform/upstream/libexif.git
14 months agoriscv64: Update config.sub and config.guess 60/287960/1 accepted/tizen_8.0_unified accepted/tizen_unified tizen tizen_8.0 accepted/tizen/8.0/unified/20231005.095038 accepted/tizen/unified/20230222.161520 tizen_8.0_m2_release
Marek Pikuła [Wed, 8 Feb 2023 08:06:38 +0000 (09:06 +0100)]
riscv64: Update config.sub and config.guess

Change-Id: Ibbce3ec52409156aa976733cf836ba2deb22130c
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
3 years agoUpgrage to 0.6.22 84/246084/3 accepted/tizen_6.5_unified accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix tizen_6.5 tizen_7.0 tizen_7.0_hotfix accepted/tizen/6.5/unified/20211029.013555 accepted/tizen/7.0/unified/20221110.063417 accepted/tizen/7.0/unified/hotfix/20221116.110951 accepted/tizen/unified/20201028.123852 submit/tizen/20201026.023621 submit/tizen_6.5/20211028.163501 tizen_6.5.m2_release tizen_7.0_m2_release
Jeongmo Yang [Fri, 23 Oct 2020 06:49:41 +0000 (15:49 +0900)]
Upgrage to 0.6.22

Change-Id: I19b63acfb173b87854929a93779071e580f8bb98
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
3 years agoEnsure the MakerNote data pointers are initialized with NULL. 94/235594/2 accepted/tizen_6.0_unified accepted/tizen_6.0_unified_hotfix tizen_6.0 tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.110329 accepted/tizen/6.0/unified/hotfix/20201102.233921 accepted/tizen/6.0/unified/hotfix/20201103.050952 accepted/tizen/unified/20200609.153652 submit/tizen/20200608.074032 submit/tizen_6.0/20201029.205502 submit/tizen_6.0_hotfix/20201102.192902 submit/tizen_6.0_hotfix/20201103.115102 tizen_6.0.m2_release
Dan Fandrich [Sat, 16 May 2020 17:29:21 +0000 (19:29 +0200)]
Ensure the MakerNote data pointers are initialized with NULL.

This ensures that an uninitialized pointer isn't dereferenced later in
the case where the number of components (and therefore size) is 0.

This fixes the second issue reported at
https://sourceforge.net/p/libexif/bugs/125/

CVE-2020-13113

Change-Id: I93a19b0d66ef34b22a4485a492be92836711eb0a
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
3 years agoFix MakerNote tag size overflow issues at read time. 93/235593/1
Dan Fandrich [Sat, 16 May 2020 15:32:28 +0000 (17:32 +0200)]
Fix MakerNote tag size overflow issues at read time.

Check for a size overflow while reading tags, which ensures that the
size is always consistent for the given components and type of the
entry, making checking further down superfluous.

This provides an alternate fix for
https://sourceforge.net/p/libexif/bugs/125/ CVE-2016-6328 and for all
the MakerNote types. Likely, this makes both commits 41bd0423 and
89e5b1c1 redundant as it ensures that MakerNote entries are well-formed
when they're populated.

Some improvements on top by Marcus Meissner <marcus@jet.franken.de>

CVE-2020-13112

Change-Id: I334efda3fbf2b0bae831f74e8fa866303d0ec93b
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
3 years ago0.6.22 release libexif-0_6_22-release
Marcus Meissner [Mon, 18 May 2020 15:58:47 +0000 (17:58 +0200)]
0.6.22 release

fixes https://github.com/libexif/libexif/issues/12

3 years agoSECURITY.md added to EXTRA_DIST, make distcheck otherwise does not like it
Marcus Meissner [Mon, 18 May 2020 15:53:45 +0000 (17:53 +0200)]
SECURITY.md added to EXTRA_DIST, make distcheck otherwise does not like it

3 years agofirst update
Marcus Meissner [Sun, 17 May 2020 16:33:19 +0000 (18:33 +0200)]
first update

3 years agoadded me, some security related work
Marcus Meissner [Sun, 17 May 2020 16:24:07 +0000 (18:24 +0200)]
added me, some security related work

3 years agohandle illegal offsets earlier
Marcus Meissner [Sun, 17 May 2020 08:20:15 +0000 (10:20 +0200)]
handle illegal offsets earlier

Bail out if an offset runs over the datasize.

fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20065&q=libexif&can=2

3 years agoAdd support for Composite Image tags from Exif 2.32 (#40)
Woodrow Douglass [Sun, 17 May 2020 07:03:45 +0000 (03:03 -0400)]
Add support for Composite Image tags from Exif 2.32 (#40)

3 years agoRename 'binary' directory to 'binary-dist' (#43)
Hugh McMaster [Sun, 17 May 2020 06:49:31 +0000 (16:49 +1000)]
Rename 'binary' directory to 'binary-dist' (#43)

* Rename 'binary' directory to 'binary-dist'

Debian invokes a 'binary' target in its build process. The presence of
the 'binary' directory breaks the automated build, as 'make' thinks the
target has already been invoked.

* Use substitution variable for 'mkdir -p' instead of hard-coding the command

3 years agoFix an unused variable warning.
Dan Fandrich [Sat, 16 May 2020 21:15:37 +0000 (23:15 +0200)]
Fix an unused variable warning.

3 years agoAdd a failsafe on the maximum number of Canon MakerNote subtags.
Dan Fandrich [Sat, 16 May 2020 17:32:30 +0000 (19:32 +0200)]
Add a failsafe on the maximum number of Canon MakerNote subtags.

A malicious file could be crafted to cause extremely large values in some
tags without tripping any buffer range checks.  This is bad with the libexif
representation of Canon MakerNotes because some arrays are turned into
individual tags that the application must loop around.

The largest value I've seen for failsafe_size in a (very small) sample of valid
Canon files is <5000.  The limit is set two orders of magnitude larger to avoid
tripping up falsely in case some models use much larger values.

Patch from Google.

CVE-2020-13114

3 years agoFix stack buffer overflows in exif_content_dump and exif_entry_dump.
Dan Fandrich [Wed, 25 Sep 2019 14:02:08 +0000 (16:02 +0200)]
Fix stack buffer overflows in exif_content_dump and exif_entry_dump.

If too large an indent is given, a local buffer will overflow. This
can't happen when called through exif_data_dump (which is likely the
most common case) and since they are documented as being for diagnostic
purposes only, this shouldn't pose too big a security risk in the wild.

Reported-by: jonnygrant.
(not exploitable by malicious data)

3 years agoEnsure the MakerNote data pointers are initialized with NULL.
Dan Fandrich [Sat, 16 May 2020 17:29:21 +0000 (19:29 +0200)]
Ensure the MakerNote data pointers are initialized with NULL.

This ensures that an uninitialized pointer isn't dereferenced later in
the case where the number of components (and therefore size) is 0.

This fixes the second issue reported at
https://sourceforge.net/p/libexif/bugs/125/

CVE-2020-13113

3 years agoFix MakerNote tag size overflow issues at read time.
Dan Fandrich [Sat, 16 May 2020 15:32:28 +0000 (17:32 +0200)]
Fix MakerNote tag size overflow issues at read time.

Check for a size overflow while reading tags, which ensures that the
size is always consistent for the given components and type of the
entry, making checking further down superfluous.

This provides an alternate fix for
https://sourceforge.net/p/libexif/bugs/125/ CVE-2016-6328 and for all
the MakerNote types. Likely, this makes both commits 41bd0423 and
89e5b1c1 redundant as it ensures that MakerNote entries are well-formed
when they're populated.

Some improvements on top by Marcus Meissner <marcus@jet.franken.de>

CVE-2020-13112

3 years agoreduce code in fuzzer
Marcus Meissner [Sat, 16 May 2020 14:17:42 +0000 (16:17 +0200)]
reduce code in fuzzer

3 years agoadd extern "C" wrapper
Marcus Meissner [Sat, 16 May 2020 15:20:53 +0000 (17:20 +0200)]
add extern "C" wrapper

fixes https://github.com/libexif/libexif/issues/41

3 years agolibexif: Fix read buffer overflow (CVE-2020-0093)
Marcus Meissner [Sat, 16 May 2020 14:47:42 +0000 (16:47 +0200)]
libexif: Fix read buffer overflow (CVE-2020-0093)

Make sure the number of bytes being copied from doesn't exceed the
source buffer size.

From Android repo:
https://android.googlesource.com/platform/external/libexif/+/0335ffc17f9b9a4831c242bb08ea92f605fde7a6%5E%21/#F0

Test: testPocBug_148705132
Bug: 148705132

fixes https://github.com/libexif/libexif/issues/42

3 years agoSwitch to sourceline syntax for the toolchain PPA in Travis.
Dan Fandrich [Sun, 26 Apr 2020 15:41:18 +0000 (17:41 +0200)]
Switch to sourceline syntax for the toolchain PPA in Travis.

3 years agoReorganize some Travis builds.
Dan Fandrich [Sat, 25 Apr 2020 21:24:05 +0000 (23:24 +0200)]
Reorganize some Travis builds.

Travis defaults to xenial these days, so some builds were redundant.
Add gcc9, clang9 and clang10 builds. Switch the sanitize build to
clang10. Add a PPC build.

4 years agoadd a SECURITY.md, describe attack surface and valid attack scenarios
Marcus Meissner [Sat, 29 Feb 2020 20:12:26 +0000 (21:12 +0100)]
add a SECURITY.md, describe attack surface and valid attack scenarios

4 years agoUpdate the exif-entry.c (#32)
orangesnn [Mon, 24 Feb 2020 07:16:02 +0000 (15:16 +0800)]
Update the exif-entry.c (#32)

dividing by zero

4 years agobugfix: change 0xa000 tag name (#38)
Crane [Mon, 24 Feb 2020 06:50:06 +0000 (14:50 +0800)]
bugfix: change 0xa000 tag name (#38)

According to DC-08-2012
FlashPixVersion shoule be  FlashpixVersion

4 years agoUpdate exif-loader.c (#33)
orangesnn [Sun, 23 Feb 2020 09:28:19 +0000 (17:28 +0800)]
Update exif-loader.c (#33)

undefined behaviour : cannot be represented in type 'int'

4 years agocast to unsigned int before shifting left
Marcus Meissner [Sat, 18 Jan 2020 18:50:38 +0000 (19:50 +0100)]
cast to unsigned int before shifting left

(weird integer promotion, a unsigned char will be first tried to be promoted to "int" apparently,
so we need to cast it to avoid implicit behaviour)

fixes https://github.com/libexif/libexif/issues/20

4 years agofix CVE-2019-9278
Marcus Meissner [Sat, 18 Jan 2020 08:29:42 +0000 (09:29 +0100)]
fix CVE-2019-9278

avoid the use of unsafe integer overflow checking constructs (unsigned integer operations cannot overflow, so "u1 + u2 > u1" can be optimized away)

check for the actual sizes, which should also handle the overflows
document other places google patched, but do not seem relevant due to other restrictions

fixes https://github.com/libexif/libexif/issues/26

4 years agocirrus: Switch the FreeBSD 12.x build to 12.1 and drop 10.4.
Dan Fandrich [Fri, 13 Dec 2019 07:46:51 +0000 (08:46 +0100)]
cirrus: Switch the FreeBSD 12.x build to 12.1 and drop 10.4.

Upstream support for 10.4 ended a year ago, and it looks like the image
is now gone, too.
[skip ci]

4 years agoFix decoding of Windows XP proprietary tags on big-endian machines.
Dan Fandrich [Tue, 5 Nov 2019 15:18:02 +0000 (16:18 +0100)]
Fix decoding of Windows XP proprietary tags on big-endian machines.

Reported by Thorsten Otto.  Fixes #22.

4 years agoFix a buffer read overflow in exif_entry_get_value
Dan Fandrich [Wed, 4 Jul 2018 09:06:09 +0000 (11:06 +0200)]
Fix a buffer read overflow in exif_entry_get_value

While parsing EXIF_TAG_FOCAL_LENGTH it was possible to read 8 bytes past
the end of a heap buffer. This was detected by the OSS Fuzz project.
Patch from Google.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7344 and
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14543

4 years agoEXIF_TAG_GAMMA is found in Exif 2.3
Dan Fandrich [Fri, 19 Jul 2019 10:36:01 +0000 (12:36 +0200)]
EXIF_TAG_GAMMA is found in Exif 2.3

4 years agoIncrease the git clone depth.
Dan Fandrich [Thu, 17 Oct 2019 04:52:47 +0000 (06:52 +0200)]
Increase the git clone depth.

If more commits are submitted to master between the time of triggering
the first Cirrus build and the time the final build gets started, the
desired commit is no longer at HEAD and the build will error out.
[skip ci]

4 years agoAdd an ARM64 build on Travis.
Dan Fandrich [Wed, 16 Oct 2019 20:26:04 +0000 (22:26 +0200)]
Add an ARM64 build on Travis.

4 years agoSwitch the Cirrus FreeBSD 11.x build to 11.3 and add a 13.0 build.
Dan Fandrich [Wed, 11 Sep 2019 08:06:12 +0000 (10:06 +0200)]
Switch the Cirrus FreeBSD 11.x build to 11.3 and add a 13.0 build.

Also, select the images using image_family to get the latest snapshots
automatically.
[skip ci]

4 years agoRelicensed my contributions to stdint.m4 under LGPL.
Dan Fandrich [Fri, 9 Aug 2019 09:26:03 +0000 (11:26 +0200)]
Relicensed my contributions to stdint.m4 under LGPL.

This brings the file under the same license as the rest of the project
by default, and eliminates the ambiguous (but well-intentioned) license
under which it was supplied.
[skip ci]

4 years agoEnabled -Werror on some Travis builds.
Dan Fandrich [Wed, 31 Jul 2019 13:00:29 +0000 (15:00 +0200)]
Enabled -Werror on some Travis builds.

This will cause any compiler warnings to be treated as errors and fail
the CI build. A couple of warnings are grandfathered in until they are
fixed in the code.

The -Werror switch can't be added to the CFLAGS on the configure command
because it causes some autoconf tests to fail. Instead, it's appended to
the existing flags at make time.

4 years agoFixed a couple of compiler warnings.
Dan Fandrich [Wed, 31 Jul 2019 17:03:10 +0000 (19:03 +0200)]
Fixed a couple of compiler warnings.

4 years agoMake failmalloc disable itself on program exit.
Dan Fandrich [Wed, 31 Jul 2019 22:09:34 +0000 (00:09 +0200)]
Make failmalloc disable itself on program exit.

Something in the Travis build environment has changed recently to cause
failmalloc runs to crash while exiting due to a NULL pointer dereference
in the coverage writing code. This fix causes failmalloc to
automatically disable itself once main() exits so subsequent memory
requests always succeed. Since the application (and library) have no
control over what happens during exit cleanup anyway, this does not
affect its functionality.

4 years agoSwitched a few builds to use the slightly more modern Xenial.
Dan Fandrich [Wed, 31 Jul 2019 14:39:11 +0000 (16:39 +0200)]
Switched a few builds to use the slightly more modern Xenial.

This fixes the clang6 build since the Trusty environment has started
complaining that libjsoncpp0 doesn't exist when trying to install
clang-6.0.

4 years agoAdd a few more NULL pointer checks.
Dan Fandrich [Thu, 25 Jul 2019 13:31:42 +0000 (15:31 +0200)]
Add a few more NULL pointer checks.

Extended test-null.c to verify them.
Fixes #19 (reported by jonnygrant@).

4 years agoGerman translation for new Exif 2.3 tags
Dirk Farin [Mon, 1 Jul 2019 14:08:14 +0000 (16:08 +0200)]
German translation for new Exif 2.3 tags

4 years agoadd new tags from Exif 2.3 specification
Dirk Farin [Mon, 1 Jul 2019 13:52:33 +0000 (15:52 +0200)]
add new tags from Exif 2.3 specification

4 years agoDocumented some return values in the case of errors.
Dan Fandrich [Fri, 19 Jul 2019 16:33:11 +0000 (18:33 +0200)]
Documented some return values in the case of errors.

Also, added docs for a few functions that were missing them.
Fixes issue #18.
[skip ci]

4 years agoStopped printing some values as int in exif_mnote_data_get_value
Dan Fandrich [Wed, 17 Jul 2019 13:26:32 +0000 (15:26 +0200)]
Stopped printing some values as int in exif_mnote_data_get_value

This is the same change as the previous one but for the MakerNotes.
Patch from Google.

4 years agoStopped printing some values as int in exif_entry_get_value
Dan Fandrich [Fri, 12 Jul 2019 16:01:47 +0000 (18:01 +0200)]
Stopped printing some values as int in exif_entry_get_value

By leaving them as double, it avoids undefined behaviour when the values
are out of the range of an int.  This also has the side effect of
rounding some values to the nearest integer, improving display accuracy.
Patch from Google.

4 years agoAdded a comment regarding malformed UTF-16 strings.
Dan Fandrich [Fri, 18 May 2018 16:09:24 +0000 (18:09 +0200)]
Added a comment regarding malformed UTF-16 strings.

4 years agoAvoid OOB read on short buffer in various Olympus-like MakerNotes.
Dan Fandrich [Mon, 18 Jun 2018 10:41:15 +0000 (12:41 +0200)]
Avoid OOB read on short buffer in various Olympus-like MakerNotes.

A sanity check on entry to the block ensures a minimum buffer size, so a few
other checks were redundant and could actually be removed. This improves
on commit a0c04d9c.
Fixes https://sourceforge.net/p/libexif/bugs/132/ found by the Google
Autofuzz project.  Patch from Google.

4 years agofixed a buffer overread (OSS-Fuzz)
Marcus Meissner [Sat, 15 Jun 2019 16:40:48 +0000 (18:40 +0200)]
fixed a buffer overread (OSS-Fuzz)
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8884

4 years agoIncrease git clone depth in Travis.
Dan Fandrich [Tue, 21 May 2019 13:16:32 +0000 (15:16 +0200)]
Increase git clone depth in Travis.

The value of 1 caused problems when more than one commit was pushed but
the most recent commit(s) had a "skip ci" note. Travis would try to
build from a prior new commit without the tag but it would fail because
only the most recent was available.

4 years agoRemoved some extraneous space characters from translations.
Dan Fandrich [Tue, 21 May 2019 13:15:56 +0000 (15:15 +0200)]
Removed some extraneous space characters from translations.

[skip ci]

4 years agoAdded some missing Language: tags in some .po files.
Dan Fandrich [Fri, 10 May 2019 14:10:34 +0000 (16:10 +0200)]
Added some missing Language: tags in some .po files.

[skip ci]

4 years agoAdded two new strings for translation to all the .po files.
Dan Fandrich [Fri, 10 May 2019 14:01:31 +0000 (16:01 +0200)]
Added two new strings for translation to all the .po files.

All the line numbering and wrapping changes were dropped to avoid
needless churn.

4 years agoChanged some printf specifiers in translation files to match.
Dan Fandrich [Fri, 10 May 2019 11:02:01 +0000 (13:02 +0200)]
Changed some printf specifiers in translation files to match.

This was done blindly to a bunch of .po files to remove some fuzzy
translation specifiers after a few type changes.

4 years agoAdded test-null to check that the API handles NULL arguments.
Dan Fandrich [Sat, 27 Apr 2019 17:28:47 +0000 (19:28 +0200)]
Added test-null to check that the API handles NULL arguments.

4 years agoDon't crash if exif_content_ref/unref is passed NULL.
Dan Fandrich [Sat, 27 Apr 2019 17:30:01 +0000 (19:30 +0200)]
Don't crash if exif_content_ref/unref is passed NULL.

The rest of the API functions already handle NULL values.

5 years agoTravis build updates.
Dan Fandrich [Thu, 11 Apr 2019 08:36:13 +0000 (10:36 +0200)]
Travis build updates.

Added a clang-8 build configuration and switched the sanitize
configuration to also use clang-8.  Removed the clang7 build since
that's the version already used in bionic and xenial.  Enabled LSAN leak
checker on the sanitize build.

5 years agoImprove deep recursion detection in exif_data_load_data_content. 67/203467/1 accepted/tizen_5.5_unified accepted/tizen_5.5_unified_mobile_hotfix accepted/tizen_5.5_unified_wearable_hotfix tizen_5.5 tizen_5.5_mobile_hotfix tizen_5.5_tv tizen_5.5_wearable_hotfix accepted/tizen/5.5/unified/20191031.011749 accepted/tizen/5.5/unified/mobile/hotfix/20201027.074220 accepted/tizen/5.5/unified/wearable/hotfix/20201027.100532 accepted/tizen/unified/20190416.071505 submit/tizen/20190415.103526 submit/tizen_5.5/20191031.000007 submit/tizen_5.5_mobile_hotfix/20201026.185107 submit/tizen_5.5_wearable_hotfix/20201026.184307 tizen_5.5.m2_release
Dan Fandrich [Fri, 12 Oct 2018 14:01:45 +0000 (16:01 +0200)]
Improve deep recursion detection in exif_data_load_data_content.

The existing detection was still vulnerable to pathological cases
causing DoS by wasting CPU. The new algorithm takes the number of tags
into account to make it harder to abuse by cases using shallow recursion
but with a very large number of tags.  This improves on commit 5d28011c
which wasn't sufficient to counter this kind of case.

The limitation in the previous fix was discovered by Laurent Delosieres,
Secunia Research at Flexera (Secunia Advisory SA84652) and is assigned
the identifier CVE-2018-20030.

Change-Id: I0ea69965f94d762c4f43c587504469259108456f
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
5 years agoAdded Travis builds on Ubuntu xenial and bionic.
Dan Fandrich [Tue, 9 Apr 2019 12:38:04 +0000 (14:38 +0200)]
Added Travis builds on Ubuntu xenial and bionic.

5 years agoIgnore return value of bindtextdomain() to silence "result unused" warnings.
Dan Fandrich [Mon, 8 Apr 2019 13:06:12 +0000 (15:06 +0200)]
Ignore return value of bindtextdomain() to silence "result unused" warnings.

Patch from Google.

5 years agoAdded a Travis build with --disable-nls
Dan Fandrich [Mon, 8 Apr 2019 12:25:55 +0000 (14:25 +0200)]
Added a Travis build with --disable-nls

5 years agoRemove several unused macro files
Hugh McMaster [Fri, 29 Mar 2019 10:35:50 +0000 (21:35 +1100)]
Remove several unused macro files

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
5 years agoUpdate Doxyfile templates to prevent compile-time warnings
Hugh McMaster [Thu, 28 Mar 2019 12:24:22 +0000 (23:24 +1100)]
Update Doxyfile templates to prevent compile-time warnings

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
5 years agoAdded a clang-7 Travis build configuration.
Dan Fandrich [Mon, 11 Mar 2019 21:48:20 +0000 (22:48 +0100)]
Added a clang-7 Travis build configuration.

Also, switched the sanitize configuration to use clang-7.

5 years agoAdded stricter ASAN checks in the Travis sanitize build.
Dan Fandrich [Fri, 1 Mar 2019 11:01:34 +0000 (12:01 +0100)]
Added stricter ASAN checks in the Travis sanitize build.

5 years agoMention that Portuguese translations now come from Translation Project.
Dan Fandrich [Thu, 28 Feb 2019 23:46:40 +0000 (00:46 +0100)]
Mention that Portuguese translations now come from Translation Project.

[skip ci]

5 years agoConfigure CI builds with --disable-dependency-tracking to speed them up.
Dan Fandrich [Thu, 28 Feb 2019 14:53:07 +0000 (15:53 +0100)]
Configure CI builds with --disable-dependency-tracking to speed them up.

5 years agoFixed typo in last commit.
Dan Fandrich [Sat, 23 Feb 2019 15:23:20 +0000 (16:23 +0100)]
Fixed typo in last commit.

5 years agoFixed a potential NPE in exif_mnote_data_pentax_save
Dan Fandrich [Sat, 23 Feb 2019 14:36:37 +0000 (15:36 +0100)]
Fixed a potential NPE in exif_mnote_data_pentax_save

Found by Coverity.

5 years agoAdded test-extract.c and a new regression test extract-parse.sh.
Dan Fandrich [Fri, 22 Feb 2019 15:17:01 +0000 (16:17 +0100)]
Added test-extract.c and a new regression test extract-parse.sh.

This extracts the EXIF tags from an image then compares the parsed value
of the extracted tags with those of the original file. This ensures that
the tags are written properly, without change in tag data. The MakerNote
tag sometimes has a harmless, slight difference in size because of
padding being removed.

However, in developing this test, I found that the Olympus variant 4
MakerNote has a huge size difference. This might be harmless (there
might just be a lot of padding removed) but it's also possible that
these MakerNotes aren't being properly parsed.  This discrepancy should
be investigated.

The exif_data_save_data() function is also returning some JPEG markers
at the end of the buffer which I wasn't expecting.  This also should be
investigated.

The test is enabled anyway in the meantime to reduce the chance of
regressions in the remaining tags.

5 years agoFixed a compiler warning in test-fuzzer
Dan Fandrich [Fri, 22 Feb 2019 15:51:27 +0000 (16:51 +0100)]
Fixed a compiler warning in test-fuzzer

5 years agoImprove deep recursion detection in exif_data_load_data_content.
Dan Fandrich [Fri, 12 Oct 2018 14:01:45 +0000 (16:01 +0200)]
Improve deep recursion detection in exif_data_load_data_content.

The existing detection was still vulnerable to pathological cases
causing DoS by wasting CPU. The new algorithm takes the number of tags
into account to make it harder to abuse by cases using shallow recursion
but with a very large number of tags.  This improves on commit 5d28011c
which wasn't sufficient to counter this kind of case.

The limitation in the previous fix was discovered by Laurent Delosieres,
Secunia Research at Flexera (Secunia Advisory SA84652) and is assigned
the identifier CVE-2018-20030.

5 years agoRetry on error when downloading failmalloc in the Travis build.
Dan Fandrich [Thu, 7 Feb 2019 11:01:32 +0000 (12:01 +0100)]
Retry on error when downloading failmalloc in the Travis build.

5 years agoSet the buffer size to 0 to indicate an error in exif_loader_get_buf.
Dan Fandrich [Tue, 5 Feb 2019 10:09:58 +0000 (11:09 +0100)]
Set the buffer size to 0 to indicate an error in exif_loader_get_buf.

Otherwise, the caller has no way of knowing an error occurred, such as the NULL
check done in the previous commit.

5 years agoFixed a potential NULL pointer dereference in exif_loader_get_buf.
Dan Fandrich [Mon, 4 Feb 2019 15:27:17 +0000 (16:27 +0100)]
Fixed a potential NULL pointer dereference in exif_loader_get_buf.

This would only happen if given a NULL pointer by the application.
Found by Clang scan-build.

5 years agoAdded FreeBSD builds on Cirrus CI.
Dan Fandrich [Sat, 2 Feb 2019 19:01:49 +0000 (20:01 +0100)]
Added FreeBSD builds on Cirrus CI.

Build results will be at
https://cirrus-ci.com/github/libexif/libexif

5 years agohandle non-0 terminated value returns as failure
Marcus Meissner [Sat, 2 Feb 2019 18:04:59 +0000 (19:04 +0100)]
handle non-0 terminated value returns as failure

5 years agothe USERCOMMENT field should be returned \0 terminated (AFL)
Marcus Meissner [Sat, 2 Feb 2019 18:04:29 +0000 (19:04 +0100)]
the USERCOMMENT field should be returned \0 terminated (AFL)

5 years agoabort early... we can get a very high number and this does not help
Marcus Meissner [Sat, 2 Feb 2019 17:52:28 +0000 (18:52 +0100)]
abort early... we can get a very high number and this does not help

5 years agoAdd a MUSL build on Travis.
Dan Fandrich [Fri, 1 Feb 2019 11:29:02 +0000 (12:29 +0100)]
Add a MUSL build on Travis.

5 years agoAdd GPSHPositioningError tag defined in exif version 2.3.1 (#7)
kyububba [Mon, 7 Jan 2019 14:19:41 +0000 (06:19 -0800)]
Add GPSHPositioningError tag defined in exif version 2.3.1 (#7)

* Update exif-tag.h

* Update exif-tag.c

5 years agoReformatted the matrix section of the Travis config file.
Dan Fandrich [Fri, 30 Nov 2018 13:17:55 +0000 (14:17 +0100)]
Reformatted the matrix section of the Travis config file.

5 years agoAdded an ARM cross-compile build to Travis.
Dan Fandrich [Fri, 30 Nov 2018 09:37:39 +0000 (10:37 +0100)]
Added an ARM cross-compile build to Travis.

5 years agoFixed cross-compiling with the default options.
Dan Fandrich [Fri, 30 Nov 2018 12:46:10 +0000 (13:46 +0100)]
Fixed cross-compiling with the default options.

The failmalloc check doesn't make sense when cross-compiling, and
configure even errored out in this case.

5 years agoAdd check-failmalloc.sh to test OOM conditions.
Dan Fandrich [Sat, 10 Nov 2018 13:16:47 +0000 (14:16 +0100)]
Add check-failmalloc.sh to test OOM conditions.

This requires Failmalloc, a library that can be used along with glibc to
cause malloc calls to fail in a defined way. Configure will search for
libfailmalloc.so.0 in the usual places by default, or in a
user-specified location. The tests are skipped if it's not available.
Enable Failmalloc on the Travis coverage build.

5 years agoRemoved obsolete comment.
Dan Fandrich [Fri, 9 Nov 2018 17:18:33 +0000 (18:18 +0100)]
Removed obsolete comment.

5 years agoAdded an Appveyor configuration for msys2.
Dan Fandrich [Wed, 7 Nov 2018 19:19:18 +0000 (20:19 +0100)]
Added an Appveyor configuration for msys2.

[ci skip]

5 years agoEnable AM_SILENT_RULES by default.
Dan Fandrich [Tue, 6 Nov 2018 00:03:54 +0000 (01:03 +0100)]
Enable AM_SILENT_RULES by default.

Verbose compile commands can be re-enabled with "make V=1" which is done
on the continuous build systems for easier debugging.

5 years agoBe a bit more robust in the face of out-of-memory errors.
Dan Fandrich [Mon, 5 Nov 2018 23:53:56 +0000 (00:53 +0100)]
Be a bit more robust in the face of out-of-memory errors.

Do a better job in leaving things in a more consistent state after an
allocation failure. Also, make the tests report and handle OOM
conditions cleanly.

5 years agoRun the libexif-testsuite tests in parallel now that they can be.
Dan Fandrich [Mon, 5 Nov 2018 20:44:37 +0000 (21:44 +0100)]
Run the libexif-testsuite tests in parallel now that they can be.

5 years agoUse a glob to find test-suite.log on a failing Travis build.
Dan Fandrich [Sat, 3 Nov 2018 15:43:24 +0000 (16:43 +0100)]
Use a glob to find test-suite.log on a failing Travis build.

When running on libexif-testsuite, the file is in tests/ not test/.

5 years agoAdded the test/testdata/* files to the dist tar ball.
Dan Fandrich [Thu, 1 Nov 2018 17:32:04 +0000 (18:32 +0100)]
Added the test/testdata/* files to the dist tar ball.

This was missed in commit 5c93e6b4.

5 years agoAdd swap-byte-order.sh to test libexif's byte order conversion function.
Dan Fandrich [Thu, 1 Nov 2018 13:24:31 +0000 (14:24 +0100)]
Add swap-byte-order.sh to test libexif's byte order conversion function.

This is accomplished by adding a feature to test-parse.c to switch the
byte order before dumping the EXIF output. Additionally, the MakerNote
values are now logged in the dump as well, in the same way as the
regular tags, to better catch regressions.

This new test uncovered a bug in the decoding of the
MNOTE_NIKON_TAG_FIRMWARE tag whose data should not be treated as being
endian-specific.

5 years agoAdded a thumbnail to test-mem.c to ensure it's properly freed.
Dan Fandrich [Thu, 1 Nov 2018 10:23:06 +0000 (11:23 +0100)]
Added a thumbnail to test-mem.c to ensure it's properly freed.

5 years agoUse exif_mnote_data_get_name in test-parse.c
Dan Fandrich [Wed, 31 Oct 2018 14:11:51 +0000 (15:11 +0100)]
Use exif_mnote_data_get_name in test-parse.c

This is analagous to exif_tag_get_name that is used for the regular
tags.

5 years agoAdd code coverage using libexif-testsuite.
Dan Fandrich [Sat, 27 Oct 2018 10:57:21 +0000 (12:57 +0200)]
Add code coverage using libexif-testsuite.

This runs the libexif, exif and libexif-testsuite tests to get a more
complete indication of total test coverage.

5 years agoIgnore some more automake files to .gitignore
Dan Fandrich [Fri, 28 Sep 2018 13:25:57 +0000 (15:25 +0200)]
Ignore some more automake files to .gitignore

5 years agoAdd a .appveyor.yml file to enable AppVeyor CI integration.
Dan Fandrich [Mon, 3 Sep 2018 00:49:19 +0000 (02:49 +0200)]
Add a .appveyor.yml file to enable AppVeyor CI integration.

Only Cygwin environments are tested for now.
Results are available at
https://ci.appveyor.com/project/dfandrich/libexif

5 years agoRemoved some FIXME comments.
Dan Fandrich [Sun, 2 Sep 2018 14:26:06 +0000 (16:26 +0200)]
Removed some FIXME comments.

5 years agoDisplay the test log on a Travis test failure.
Dan Fandrich [Wed, 29 Aug 2018 20:21:36 +0000 (22:21 +0200)]
Display the test log on a Travis test failure.

5 years agoUnify some parameter names between declarations and definitions.
Dan Fandrich [Tue, 28 Aug 2018 23:32:36 +0000 (01:32 +0200)]
Unify some parameter names between declarations and definitions.