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/gpicview-0.2.5/src/jhead.c
Examining data/gpicview-0.2.5/src/jpgfile.c
Examining data/gpicview-0.2.5/src/working-area.c
Examining data/gpicview-0.2.5/src/tran-supp.h
Examining data/gpicview-0.2.5/src/jpeg-tran.c
Examining data/gpicview-0.2.5/src/image-view.h
Examining data/gpicview-0.2.5/src/pref.h
Examining data/gpicview-0.2.5/src/pref.c
Examining data/gpicview-0.2.5/src/image-list.h
Examining data/gpicview-0.2.5/src/glib-mem.h
Examining data/gpicview-0.2.5/src/file-dlgs.c
Examining data/gpicview-0.2.5/src/xml-purge.c
Examining data/gpicview-0.2.5/src/jpeg-tran.h
Examining data/gpicview-0.2.5/src/tran-supp.c
Examining data/gpicview-0.2.5/src/image-list.c
Examining data/gpicview-0.2.5/src/main-win.h
Examining data/gpicview-0.2.5/src/image-view.c
Examining data/gpicview-0.2.5/src/exif.c
Examining data/gpicview-0.2.5/src/file-dlgs.h
Examining data/gpicview-0.2.5/src/ptk-menu.c
Examining data/gpicview-0.2.5/src/jhead.h
Examining data/gpicview-0.2.5/src/ptk-menu.h
Examining data/gpicview-0.2.5/src/working-area.h
Examining data/gpicview-0.2.5/src/gpicview.c
Examining data/gpicview-0.2.5/src/main-win.c

FINAL RESULTS:

data/gpicview-0.2.5/src/jpeg-tran.c:224:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(tmpfilename, "%s.XXXXXX", filename);
data/gpicview-0.2.5/src/jpgfile.c:66:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy(ImageInfo.Comments,Comment);
data/gpicview-0.2.5/src/exif.c:66:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static const char * OrientTab[9] = {
data/gpicview-0.2.5/src/exif.c:320:21:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        return  ((( char *)Long)[0] << 24) | (((uchar *)Long)[1] << 16)
data/gpicview-0.2.5/src/exif.c:323:21:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        return  ((( char *)Long)[3] << 24) | (((uchar *)Long)[2] << 16)
data/gpicview-0.2.5/src/exif.c:444:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char IndentString[25];
data/gpicview-0.2.5/src/exif.c:1007:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char Buffer[256];
data/gpicview-0.2.5/src/exif.c:1017: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(Buffer+2, "Exif\0\0II",8);
data/gpicview-0.2.5/src/exif.c:1043:17:  [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(Buffer+DataWriteIndex, ImageInfo.DateTime, 19);
data/gpicview-0.2.5/src/exif.c:1078:9:  [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(Buffer+DataWriteIndex, Buffer+DateIndex, 20);
data/gpicview-0.2.5/src/exif.c:1130:9:  [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(NewBuf, Buffer, DataWriteIndex);
data/gpicview-0.2.5/src/exif.c:1263:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char Temp[20];
data/gpicview-0.2.5/src/jhead.h:67:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char  FileName     [PATH_MAX+1];
data/gpicview-0.2.5/src/jhead.h:70:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char  CameraMake   [32];
data/gpicview-0.2.5/src/jhead.h:71:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char  CameraModel  [40];
data/gpicview-0.2.5/src/jhead.h:72:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char  DateTime     [20];
data/gpicview-0.2.5/src/jhead.h:93:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char  Comments[MAX_COMMENT_SIZE];
data/gpicview-0.2.5/src/jhead.h:107:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char GpsLat[31];
data/gpicview-0.2.5/src/jhead.h:108:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char GpsLong[31];
data/gpicview-0.2.5/src/jhead.h:109:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char GpsAlt[20];
data/gpicview-0.2.5/src/jpeg-tran.c:94:18:  [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).
    input_file = fopen (input_filename, "rb");
data/gpicview-0.2.5/src/jpeg-tran.c:98:19:  [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).
    output_file = fopen (output_filename, "wb");
data/gpicview-0.2.5/src/jpeg-tran.c:227:17:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
    tmpfilefd = mkstemp(tmpfilename);
data/gpicview-0.2.5/src/jpgfile.c:40:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char Comment[MAX_COMMENT_SIZE+1];
data/gpicview-0.2.5/src/jpgfile.c:313:14:  [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).
    infile = fopen(FileName, "rb"); // Unix ignores 'b', windows needs it.
data/gpicview-0.2.5/src/jpgfile.c:346:15:  [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).
    outfile = fopen(FileName,"wb");
data/gpicview-0.2.5/src/jpgfile.c:396:25:  [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).
        ThumbnailFile = fopen(ThumbFileName,"wb");
data/gpicview-0.2.5/src/jpgfile.c:438:25:  [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).
        ThumbnailFile = fopen(ThumbFileName,"rb");
data/gpicview-0.2.5/src/main-win.c:331:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    static char fname[50];
data/gpicview-0.2.5/src/main-win.c:334:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[100];
data/gpicview-0.2.5/src/main-win.c:1359:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char tmp[32];
data/gpicview-0.2.5/src/main-win.c:1365:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char tmp[32];
data/gpicview-0.2.5/src/pref.c:137:15:  [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).
    if(  (f = fopen( path, "w" )) )
data/gpicview-0.2.5/src/xml-purge.c:20:7:  [2] (misc) open:
  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).
	fd = open( file, O_RDONLY );
data/gpicview-0.2.5/src/xml-purge.c:38:7:  [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).
	fo = fopen( file, "w" );
data/gpicview-0.2.5/src/exif.c:598:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy(ImageInfo.CameraMake, (char *)ValuePtr, ByteCount < 31 ? ByteCount : 31);
data/gpicview-0.2.5/src/exif.c:602:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy(ImageInfo.CameraModel, (char *)ValuePtr, ByteCount < 39 ? ByteCount : 39);
data/gpicview-0.2.5/src/exif.c:607:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy(ImageInfo.DateTime, (char *)ValuePtr, 19);
data/gpicview-0.2.5/src/exif.c:615:21:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                    strncpy(ImageInfo.DateTime, (char *)ValuePtr, 19);
data/gpicview-0.2.5/src/exif.c:645:29:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                            strncpy(ImageInfo.Comments, (char *)ValuePtr+a, 199);
data/gpicview-0.2.5/src/exif.c:651:21:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                    strncpy(ImageInfo.Comments, (char *)ValuePtr, 199);
data/gpicview-0.2.5/src/jpeg-tran.c:222:30:  [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((tmpfilename = malloc(strlen(filename)+8)) == NULL)
data/gpicview-0.2.5/src/jpgfile.c:123:9:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    a = fgetc(infile);
data/gpicview-0.2.5/src/jpgfile.c:125:22:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (a != 0xff || fgetc(infile) != M_SOI){
data/gpicview-0.2.5/src/jpgfile.c:137:22:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            marker = fgetc(infile);
data/gpicview-0.2.5/src/jpgfile.c:149:14:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        lh = fgetc(infile);
data/gpicview-0.2.5/src/jpgfile.c:150:14:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ll = fgetc(infile);
data/gpicview-0.2.5/src/main-win.c:338:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(fname, filename, 49);
data/gpicview-0.2.5/src/main-win.c:860:35:  [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).
        const char* name = file + strlen(dir) + 1;
data/gpicview-0.2.5/src/xml-purge.c:29:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if( read( fd, buf, statbuf.st_size) == -1 )

ANALYSIS SUMMARY:

Hits = 50
Lines analyzed = 7851 in approximately 0.26 seconds (29870 lines/second)
Physical Source Lines of Code (SLOC) = 5508
Hits@level = [0] 155 [1]  15 [2]  33 [3]   0 [4]   2 [5]   0
Hits@level+ = [0+] 205 [1+]  50 [2+]  35 [3+]   2 [4+]   2 [5+]   0
Hits/KSLOC@level+ = [0+] 37.2186 [1+] 9.07771 [2+] 6.35439 [3+] 0.363108 [4+] 0.363108 [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.