Ensure 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
authorDan Fandrich <dan@coneharvesters.com>
Sat, 16 May 2020 17:29:21 +0000 (19:29 +0200)
committerJeongmo Yang <jm80.yang@samsung.com>
Mon, 8 Jun 2020 03:44:34 +0000 (12:44 +0900)
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>
libexif/canon/exif-mnote-data-canon.c
libexif/fuji/exif-mnote-data-fuji.c
libexif/olympus/exif-mnote-data-olympus.c
libexif/pentax/exif-mnote-data-pentax.c
packaging/libexif.spec

index 5c043cf..52f851b 100644 (file)
@@ -234,6 +234,7 @@ exif_mnote_data_canon_load (ExifMnoteData *ne,
        for (i = c, o = datao; i; --i, o += 12) {
                size_t s;
 
+               memset(&n->entries[tcount], 0, sizeof(MnoteCanonEntry));
                if (CHECKOVERFLOW(o,buf_size,12)) {
                        exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA,
                                "ExifMnoteCanon", "Short MakerNote");
index a0bcb67..2de0f67 100644 (file)
@@ -198,6 +198,7 @@ exif_mnote_data_fuji_load (ExifMnoteData *en,
        for (i = c, o = datao; i; --i, o += 12) {
                size_t s;
 
+               memset(&n->entries[tcount], 0, sizeof(MnoteFujiEntry));
                if (CHECKOVERFLOW(o, buf_size, 12)) {
                        exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
                                  "ExifMnoteDataFuji", "Short MakerNote");
index 4d158ce..45e4bc5 100644 (file)
@@ -433,6 +433,7 @@ exif_mnote_data_olympus_load (ExifMnoteData *en,
        tcount = 0;
        for (i = c, o = o2; i; --i, o += 12) {
                size_t s;
+               memset(&n->entries[tcount], 0, sizeof(MnoteOlympusEntry));
                if (CHECKOVERFLOW(o, buf_size, 12)) {
                        exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
                                  "ExifMnoteOlympus", "Short MakerNote");
index 319d4c6..c23a7e4 100644 (file)
@@ -280,6 +280,7 @@ exif_mnote_data_pentax_load (ExifMnoteData *en,
        for (i = c, o = datao; i; --i, o += 12) {
                size_t s;
 
+               memset(&n->entries[tcount], 0, sizeof(MnotePentaxEntry));
                if (CHECKOVERFLOW(o,buf_size,12)) {
                        exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA,
                                  "ExifMnoteDataPentax", "Short MakerNote");
index c6030ed..6a92be7 100644 (file)
@@ -1,6 +1,6 @@
 Name:           libexif
 Version:        0.6.21
-Release:        3
+Release:        4
 License:        LGPL-2.1
 Summary:        An EXIF Tag Parsing Library for Digital Cameras
 Url:            http://libexif.sourceforge.net