Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler. Number of rules (primarily dangerous function names) in C/C++ ruleset: 223 Examining data/libexif-gtk-0.5.0/gtk-extensions/gtk-menu-option.c Examining data/libexif-gtk-0.5.0/gtk-extensions/gtk-menu-option.h Examining data/libexif-gtk-0.5.0/gtk-extensions/gtk-options.c Examining data/libexif-gtk-0.5.0/gtk-extensions/gtk-options.h Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-browser.c Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-browser.h Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-content-list.c Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-content-list.h Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-ascii.c Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-ascii.h Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-copyright.c Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-copyright.h Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-date.c Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-date.h Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-flash.c Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-flash.h Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-generic.c Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-generic.h Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-number.c Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-number.h Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-option.c Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-option.h Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-rational.c Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-rational.h Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-resolution.c Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-resolution.h Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-user-comment.c Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-user-comment.h Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-version.c Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-version.h Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry.c Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry.h Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-tree-item.c Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-tree-item.h Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-tree.c Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-tree.h Examining data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-util.h Examining data/libexif-gtk-0.5.0/tests/test-libexif-gtk.c FINAL RESULTS: data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-browser.c:455:6: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen (filename, "rb"); data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-browser.c:517:6: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen (filename, "wb"); data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-date.c:139:37: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). gtk_calendar_select_month (p->cal, atoi (data + 5) - 1, atoi (data)); data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-date.c:139:58: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). gtk_calendar_select_month (p->cal, atoi (data + 5) - 1, atoi (data)); data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-date.c:140:45: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). gtk_calendar_select_day (entry->priv->cal, atoi (data + 8)); data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-date.c:141:49: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). gtk_adjustment_set_value (entry->priv->a_hour, atoi (data + 11)); data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-date.c:142:49: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). gtk_adjustment_set_value (entry->priv->a_min, atoi (data + 14)); data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-date.c:143:49: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). gtk_adjustment_set_value (entry->priv->a_sec, atoi (data + 17)); data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-user-comment.c:162:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (s, entry->priv->entry->data + 8, entry->priv->entry->size - 8); data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-user-comment.c:196:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (entry->priv->entry->data, data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-user-comment.c:212:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (entry->priv->entry->data + 8, t, strlen (t)); data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-version.c:230:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (entry->priv->entry->data, data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-version.c:239:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (entry->priv->entry->data, data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-browser.c:450:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). unsigned int size, read; data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-browser.c:478:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((read != size) || ferror (f)) { data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-ascii.c:105:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). entry->priv->entry->size = strlen (txt) + 1; data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-copyright.c:133:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). entry->priv->entry->data[strlen (photographer)] = '\0'; data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-copyright.c:134:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). entry->priv->entry->size = strlen (photographer) + 1 + data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-copyright.c:135:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen (editor) + 1; data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-copyright.c:192:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (gchar *)e->data + strlen ((char *)e->data) + 1); data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-user-comment.c:204:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (entry->priv->entry->size < strlen (t) + 8) { data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-user-comment.c:205:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). s = sizeof (char) * (strlen (t) + 8); data/libexif-gtk-0.5.0/libexif-gtk/gtk-exif-entry-user-comment.c:212:43: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memcpy (entry->priv->entry->data + 8, t, strlen (t)); ANALYSIS SUMMARY: Hits = 23 Lines analyzed = 5995 in approximately 0.19 seconds (31904 lines/second) Physical Source Lines of Code (SLOC) = 4341 Hits@level = [0] 2 [1] 10 [2] 13 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 25 [1+] 23 [2+] 13 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 5.75904 [1+] 5.29832 [2+] 2.9947 [3+] 0 [4+] 0 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.