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/jhead-3.04/jpgfile.c
Examining data/jhead-3.04/iptc.c
Examining data/jhead-3.04/jhead.h
Examining data/jhead-3.04/jhead.c
Examining data/jhead-3.04/paths.c
Examining data/jhead-3.04/jpgqguess.c
Examining data/jhead-3.04/makernote.c
Examining data/jhead-3.04/myglob.c
Examining data/jhead-3.04/debian/patches/01_gpsinfo.c
Examining data/jhead-3.04/debian/patches/02_exif.c
Examining data/jhead-3.04/exif.c
Examining data/jhead-3.04/gpsinfo.c

FINAL RESULTS:

data/jhead-3.04/jhead.c:431:17:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
                chmod(FileName, buf.st_mode);
data/jhead-3.04/jhead.c:500:9:  [5] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is high; the length parameter
  appears to be a constant, instead of computing the number of characters
  left.
        strncat(OutFileName, OrigName, PATH_MAX);
data/jhead-3.04/jhead.c:501:9:  [5] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is high; the length parameter
  appears to be a constant, instead of computing the number of characters
  left.
        strncat(OutFileName, Subst+2, PATH_MAX);
data/jhead-3.04/jhead.c:1205:13:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
            chmod(FileName, buf.st_mode);
data/jhead-3.04/jhead.h:24:13:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
    #define chmod _chmod
data/jhead-3.04/gpsinfo.c:151:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(TempString, sizeof(TempString), FmtString, Values[0], Values[1], Values[2]);
data/jhead-3.04/jhead.c:131:5:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    fprintf(stderr, msg, a1, a2);
data/jhead-3.04/jhead.c:168:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(QuotedPath, "%s \"%s\"",Editor, TempFileName);
data/jhead-3.04/jhead.c:169:13:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
        a = system(QuotedPath);
data/jhead-3.04/jhead.c:275:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(Temp, "scan_date=%s", ctime(&ImageInfo.FileDateTime));
data/jhead-3.04/jhead.c:379:5:  [4] (tmpfile) mktemp:
  Temporary file race condition (CWE-377).
    mktemp(TempName);
data/jhead-3.04/jhead.c:411:9:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    a = system(ExecString);
data/jhead-3.04/jhead.c:546:9:  [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(NewName, NewBaseName);
data/jhead-3.04/jhead.c:635:25:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
                        sprintf(num, pat, FileSequence); // let printf do the number formatting.
data/jhead-3.04/jhead.c:695:21:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
                    sprintf(NewName, "%s%s", NewBaseName, NameExtra);
data/jhead-3.04/jhead.c:729:13:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
            sprintf(RotateCommand, "jpegtran -trim -%s -outfile &o &i", Argument);
data/jhead-3.04/jhead.c:743:17:  [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(ThumbTempName_in, FileName);
data/jhead-3.04/jhead.c:745:17:  [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(ThumbTempName_out, FileName);
data/jhead-3.04/jhead.c:748:17:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
                sprintf(RotateCommand,"jpegtran -trim -%s -outfile \"%s\" \"%s\"",
data/jhead-3.04/jhead.c:751:21:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
                if (system(RotateCommand) == 0){
data/jhead-3.04/jhead.c:776:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(ThumbnailGenCommand, "mogrify -thumbnail %dx%d -quality 80 \"%s\"", 
data/jhead-3.04/jhead.c:779:9:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    if (system(ThumbnailGenCommand) == 0){
data/jhead-3.04/jhead.c:836:13:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
        if (access(FileName, 2 /*W_OK*/)){
data/jhead-3.04/jhead.c:1063:17:  [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(EditFileName, FileName);
data/jhead-3.04/jhead.c:1130:25:  [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(TempBuf, ImageInfo.DateTime);
data/jhead-3.04/jhead.c:1189:9:  [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(BackupName, FileName);
data/jhead-3.04/jhead.c:1267:5:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    printf("Where:\n"
data/jhead-3.04/jhead.h:25:13:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    #define access _access
data/jhead-3.04/jhead.h:26:13:  [4] (tmpfile) mktemp:
  Temporary file race condition (CWE-377).
    #define mktemp _mktemp
data/jhead-3.04/jhead.h:30:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
        #define snprintf(dest, len, format,...) sprintf (dest, format, __VA_ARGS__)
data/jhead-3.04/jhead.h:30:49:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
        #define snprintf(dest, len, format,...) sprintf (dest, format, __VA_ARGS__)
data/jhead-3.04/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/jhead-3.04/myglob.c:50:9:  [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(dest, p2);
data/jhead-3.04/myglob.c:60:9:  [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(dest+l, p2);
data/jhead-3.04/myglob.c:88: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(PatCopy, Pattern);
data/jhead-3.04/myglob.c:224:9:  [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(MatchPattern, PatCopy+RecurseAt);
data/jhead-3.04/paths.c:33: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(NewPath, FileName);
data/jhead-3.04/paths.c:100:9:  [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(BasePath, FilePath);
data/jhead-3.04/paths.c:109:5:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
    strcat(BasePath, FilePath);
data/jhead-3.04/jhead.c:158:18:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
        Editor = getenv("EDITOR");
data/jhead-3.04/exif.c:64: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/jhead-3.04/exif.c:334: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/jhead-3.04/exif.c:337: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/jhead-3.04/exif.c:466: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/jhead-3.04/exif.c:655:21:  [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(ImageInfo.Comments, ValuePtr, ByteCount);
data/jhead-3.04/exif.c:1081: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/jhead-3.04/exif.c:1091: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/jhead-3.04/exif.c:1117: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/jhead-3.04/exif.c:1152: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/jhead-3.04/exif.c:1204: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/jhead-3.04/exif.c:1308: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/jhead-3.04/gpsinfo.c:19: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 * GpsTags[MAX_GPS_TAG+1]= {
data/jhead-3.04/gpsinfo.c:70:5:  [2] (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). Risk is low because the source is a constant string.
    strcpy(ImageInfo.GpsLat, "? ?");
data/jhead-3.04/gpsinfo.c:71:5:  [2] (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). Risk is low because the source is a constant string.
    strcpy(ImageInfo.GpsLong, "? ?");
data/jhead-3.04/gpsinfo.c:117: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 FmtString[21];
data/jhead-3.04/gpsinfo.c:118: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 TempString[50];
data/jhead-3.04/gpsinfo.c:134:17:  [2] (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). Risk is low because the source is a constant string.
                strcpy(FmtString, "%0.0fd %0.0fm %0.0fs");
data/jhead-3.04/iptc.c:171: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 TempBuf[32];
data/jhead-3.04/iptc.c:174:13:  [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(TempBuf, description, strlen(description));
data/jhead-3.04/iptc.c:193: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 OutLine[101];
data/jhead-3.04/jhead.c:67:8:  [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 DateSet[11];
data/jhead-3.04/jhead.c:143: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 QuotedPath[PATH_MAX+10];
data/jhead-3.04/jhead.c:145:12:  [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).
    file = fopen(TempFileName, "w");
data/jhead-3.04/jhead.c:177:12:  [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).
    file = fopen(TempFileName, "r");
data/jhead-3.04/jhead.c:203: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 Line[500];
data/jhead-3.04/jhead.c:274: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 Temp[40];
data/jhead-3.04/jhead.c:286: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 CommandString[PATH_MAX+1];
data/jhead-3.04/jhead.c:298:13:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
            sprintf(CommandString, "mogrify -quality 86 &i");
data/jhead-3.04/jhead.c:307:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(CommandString, "mogrify -geometry %dx%d -quality 85 &i",(int)(ImageInfo.Width*scale+0.5), 
data/jhead-3.04/jhead.c:360: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 ExecString[PATH_MAX*3];
data/jhead-3.04/jhead.c:361: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 TempName[PATH_MAX+10];
data/jhead-3.04/jhead.c:370: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(TempName, FileName, a);
data/jhead-3.04/jhead.c:371:5:  [2] (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). Risk is low because the source is a constant string.
    strcpy(TempName+a, "XXXXXX");
data/jhead-3.04/jhead.c:517: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 FilePattern[_MAX_PATH+1];
data/jhead-3.04/jhead.c:518: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 NewName[_MAX_PATH+1];
data/jhead-3.04/jhead.c:526: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(FilePattern, FileName, ExtPos);
data/jhead-3.04/jhead.c:574: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 NewBaseName[PATH_MAX*2];
data/jhead-3.04/jhead.c:576: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 NewName[PATH_MAX+2];
data/jhead-3.04/jhead.c:602: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 pattern[PATH_MAX+20];
data/jhead-3.04/jhead.c:630:25:  [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 pat[8], num[16];
data/jhead-3.04/jhead.c:632:25:  [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(pat, pattern+ppos, 4);
data/jhead-3.04/jhead.c:640:25:  [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(pattern+ppos, num, nl);
data/jhead-3.04/jhead.c:651:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(NewName, "%02d%02d-%02d%02d%02d",
data/jhead-3.04/jhead.c:660: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 NewName[PATH_MAX+10];
data/jhead-3.04/jhead.c:661: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 NameExtra[3];
data/jhead-3.04/jhead.c:724: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 RotateCommand[PATH_MAX*2+50];
data/jhead-3.04/jhead.c:740:17:  [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 ThumbTempName_in[PATH_MAX+5];
data/jhead-3.04/jhead.c:741:17:  [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 ThumbTempName_out[PATH_MAX+5];
data/jhead-3.04/jhead.c:744:17:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
                strcat(ThumbTempName_in, ".thi");
data/jhead-3.04/jhead.c:746:17:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
                strcat(ThumbTempName_out, ".tho");
data/jhead-3.04/jhead.c:770: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 ThumbnailGenCommand[PATH_MAX*2+50];
data/jhead-3.04/jhead.c:888: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 RelativeExifName[PATH_MAX+1];
data/jhead-3.04/jhead.c:963: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 OutFileName[PATH_MAX+1];
data/jhead-3.04/jhead.c:985: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 ThumbFileName[PATH_MAX+1];
data/jhead-3.04/jhead.c:1006: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 Comment[MAX_COMMENT_SIZE+1];
data/jhead-3.04/jhead.c:1029: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 CommentFileName[PATH_MAX+1];
data/jhead-3.04/jhead.c:1035:27:  [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).
            CommentFile = fopen(CommentFileName,"r");
data/jhead-3.04/jhead.c:1050: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 CommentZt[MAX_COMMENT_SIZE+1];
data/jhead-3.04/jhead.c:1051:13:  [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(CommentZt, (char *)CommentSec->Data+2, CommentSize);
data/jhead-3.04/jhead.c:1059:13:  [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(Comment, (char *)CommentSec->Data+2, CommentSize);
data/jhead-3.04/jhead.c:1062:17:  [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 EditFileName[PATH_MAX+5];
data/jhead-3.04/jhead.c:1064:17:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
                strcat(EditFileName, ".txt");
data/jhead-3.04/jhead.c:1079:13:  [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((CommentSec->Data)+2, Comment, size-2);
data/jhead-3.04/jhead.c:1093: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 OutFileName[PATH_MAX+1];
data/jhead-3.04/jhead.c:1099:27:  [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).
            CommentFile = fopen(OutFileName,"w");
data/jhead-3.04/jhead.c:1115: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 TempBuf[50];
data/jhead-3.04/jhead.c:1126:21:  [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(ImageInfo.DateTime, DateSet, DateSetChars);
data/jhead-3.04/jhead.c:1146:13:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
            sprintf(TempBuf, "%04d:%02d:%02d %02d:%02d:%02d",
data/jhead-3.04/jhead.c:1156: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(Pointer, TempBuf, 19);
data/jhead-3.04/jhead.c:1158:13:  [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(ImageInfo.DateTime, TempBuf, 19);
data/jhead-3.04/jhead.c:1184: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 BackupName[PATH_MAX+5];
data/jhead-3.04/jhead.c:1190:9:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
        strcat(BackupName, ".t");
data/jhead-3.04/jhead.c:1616:13:  [2] (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). Risk is low because the source is a constant string.
            strcpy(DateSet, "0000:01:01");
data/jhead-3.04/jhead.h:80: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/jhead-3.04/jhead.h:94: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/jhead-3.04/jhead.h:95: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/jhead-3.04/jhead.h:96: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/jhead-3.04/jhead.h:122: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/jhead-3.04/jhead.h:137: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/jhead-3.04/jhead.h:138: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/jhead-3.04/jhead.h:139: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/jhead-3.04/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/jhead-3.04/jpgfile.c:370: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/jhead-3.04/jpgfile.c:416: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/jhead-3.04/jpgfile.c:458: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/jhead-3.04/jpgfile.c:571: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/jhead-3.04/jpgqguess.c:174: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.
    unsigned char huff[16];
data/jhead-3.04/myglob.c:56: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(dest, p1, l+1);
data/jhead-3.04/myglob.c:77: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 BasePattern[_MAX_PATH];
data/jhead-3.04/myglob.c:78: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 MatchPattern[_MAX_PATH];
data/jhead-3.04/myglob.c:79: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 PatCopy[_MAX_PATH*2+1];
data/jhead-3.04/myglob.c:115:25:  [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(PatCopy+a, PatCopy+a+3, strlen(PatCopy)-a-1);
data/jhead-3.04/myglob.c:188:13:  [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(FileList[NumHave].Name, finddata.name, a+1);
data/jhead-3.04/myglob.c:203: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 CombinedName[_MAX_PATH*2+1];
data/jhead-3.04/paths.c:26: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 NewPath[PATH_MAX*2];
data/jhead-3.04/exif.c:618: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/jhead-3.04/exif.c:622: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/jhead-3.04/exif.c:627: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/jhead-3.04/exif.c:635: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/jhead-3.04/exif.c:687:33:  [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, msiz-a);
data/jhead-3.04/exif.c:692:25:  [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, msiz);
data/jhead-3.04/gpsinfo.c:154:21:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                    strncpy(ImageInfo.GpsLat+2, TempString, 29);
data/jhead-3.04/gpsinfo.c:156:21:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                    strncpy(ImageInfo.GpsLong+2, TempString, 29);
data/jhead-3.04/iptc.c:174:42:  [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(TempBuf, description, strlen(description));
data/jhead-3.04/iptc.c:175:13:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
            strcat(TempBuf, ":"); 
data/jhead-3.04/jhead.c:166:13:  [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 (strlen(Editor) > PATH_MAX) ErrFatal("env too long");
data/jhead-3.04/jhead.c:222:25:  [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).
                    l = strlen(KnownTags[a]);
data/jhead-3.04/jhead.c:236:37:  [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 (strlen(RemComment) == l){
data/jhead-3.04/jhead.c:247:37:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                                    strncpy(Line, AddComment, sizeof(Line));
data/jhead-3.04/jhead.c:252:29:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
                            strncat(OutComment, Line, MAX_COMMENT_SIZE-5-strlen(OutComment));
data/jhead-3.04/jhead.c:252:74:  [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).
                            strncat(OutComment, Line, MAX_COMMENT_SIZE-5-strlen(OutComment));
data/jhead-3.04/jhead.c:253:29:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
                            strcat(OutComment, "\n");
data/jhead-3.04/jhead.c:267:9:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
        strncat(OutComment, AddComment, MAX_COMMENT_SIZE-5-strlen(OutComment));
data/jhead-3.04/jhead.c:267:60:  [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).
        strncat(OutComment, AddComment, MAX_COMMENT_SIZE-5-strlen(OutComment));
data/jhead-3.04/jhead.c:268:9:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
        strcat(OutComment, "\n");
data/jhead-3.04/jhead.c:276:9:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
        strncat(OutComment, Temp, MAX_COMMENT_SIZE-5-strlen(OutComment));
data/jhead-3.04/jhead.c:276:54:  [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).
        strncat(OutComment, Temp, MAX_COMMENT_SIZE-5-strlen(OutComment));
data/jhead-3.04/jhead.c:368:9:  [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).
    a = strlen(FileName)-1;
data/jhead-3.04/jhead.c:498:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(OutFileName, NamePattern, Subst-NamePattern);
data/jhead-3.04/jhead.c:503:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(OutFileName, NamePattern, PATH_MAX); 
data/jhead-3.04/jhead.c:522:18:  [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).
    for(ExtPos = strlen(FileName);FileName[ExtPos-1] != '.';){
data/jhead-3.04/jhead.c:530:19:  [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).
    for(PathLen = strlen(FileName);FileName[PathLen-1] != SLASH;){
data/jhead-3.04/jhead.c:544:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(FilePattern+PathLen, finddata.name, PATH_MAX-PathLen); // full name with path
data/jhead-3.04/jhead.c:547:17:  [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).
        for(a = strlen(finddata.name);finddata.name[a] != '.';){
data/jhead-3.04/jhead.c:550:9:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
        strncat(NewName, finddata.name+a, _MAX_PATH-strlen(NewName)); // add extension to new name
data/jhead-3.04/jhead.c:550:53:  [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).
        strncat(NewName, finddata.name+a, _MAX_PATH-strlen(NewName)); // add extension to new name
data/jhead-3.04/jhead.c:578:21:  [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).
    ExtensionPart = strlen(FileName);
data/jhead-3.04/jhead.c:595:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(NewBaseName, FileName, PATH_MAX); // Get path component of name.
data/jhead-3.04/jhead.c:614:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(pattern, strftime_args, PATH_MAX-1);
data/jhead-3.04/jhead.c:615:47:  [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).
        while ((s = strstr(pattern, "%f")) && strlen(pattern) + n < PATH_MAX-1){
data/jhead-3.04/jhead.c:616: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).
            memmove(s + n, s + 2, strlen(s+2) + 1);
data/jhead-3.04/jhead.c:636: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).
                        nl = strlen(num);
data/jhead-3.04/jhead.c:637: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).
                        l = strlen(pattern+a+1);
data/jhead-3.04/jhead.c:658:37:  [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).
    AddLetter = isdigit(NewBaseName[strlen(NewBaseName)-1]);
data/jhead-3.04/jhead.c:725:17:  [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 (strlen(Argument) == 0){
data/jhead-3.04/jhead.c:806:9:  [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 (strlen(FileName) >= PATH_MAX-1){
data/jhead-3.04/jhead.c:842:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(ImageInfo.FileName, FileName, PATH_MAX);
data/jhead-3.04/jhead.c:1046:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(Comment, CommentInsertLiteral, MAX_COMMENT_SIZE);
data/jhead-3.04/jhead.c:1047: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).
            CommentSize = strlen(Comment);
data/jhead-3.04/jhead.c:1055:31:  [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).
                CommentSize = strlen(Comment);
data/jhead-3.04/jpgfile.c:124:9:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    a = fgetc(infile);
data/jhead-3.04/jpgfile.c:126: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/jhead-3.04/jpgfile.c:144:22:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            marker = fgetc(infile);
data/jhead-3.04/jpgfile.c:159:14:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        lh = fgetc(infile);
data/jhead-3.04/jpgfile.c:160:14:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ll = fgetc(infile);
data/jhead-3.04/myglob.c:48:9:  [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).
    l = strlen(p1);
data/jhead-3.04/myglob.c:52:15:  [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 (l+strlen(p2) > _MAX_PATH-2){
data/jhead-3.04/myglob.c:115:56:  [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(PatCopy+a, PatCopy+a+3, strlen(PatCopy)-a-1);
data/jhead-3.04/myglob.c:142:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(BasePattern, PatCopy, BaseEnd);
data/jhead-3.04/myglob.c:145:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(MatchPattern, PatCopy, PatternEnd);
data/jhead-3.04/myglob.c:181:17:  [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).
            a = strlen(finddata.name);
data/jhead-3.04/myglob.c:208:21:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
                    strncat(CombinedName, PatCopy+PatternEnd, _MAX_PATH*2-strlen(CombinedName));
data/jhead-3.04/myglob.c:208:75:  [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).
                    strncat(CombinedName, PatCopy+PatternEnd, _MAX_PATH*2-strlen(CombinedName));
data/jhead-3.04/myglob.c:226:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
        strncpy(PatCopy+RecurseAt, "*\\**\\", _MAX_PATH*2-RecurseAt);
data/jhead-3.04/myglob.c:227:9:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
        strncat(PatCopy, MatchPattern, _MAX_PATH*2-strlen(PatCopy));
data/jhead-3.04/myglob.c:227:52:  [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).
        strncat(PatCopy, MatchPattern, _MAX_PATH*2-strlen(PatCopy));
data/jhead-3.04/paths.c:34:9:  [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).
    a = strlen(NewPath);
data/jhead-3.04/paths.c:72:42:  [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 (NewPath[1] == ':' && strlen(NewPath) == 2) continue;
data/jhead-3.04/paths.c:91:9:  [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).
    l = strlen(BasePath);

ANALYSIS SUMMARY:

Hits = 199
Lines analyzed = 5749 in approximately 0.21 seconds (28040 lines/second)
Physical Source Lines of Code (SLOC) = 4186
Hits@level = [0] 257 [1]  64 [2]  95 [3]   1 [4]  34 [5]   5
Hits@level+ = [0+] 456 [1+] 199 [2+] 135 [3+]  40 [4+]  39 [5+]   5
Hits/KSLOC@level+ = [0+] 108.935 [1+] 47.5394 [2+] 32.2504 [3+] 9.55566 [4+] 9.31677 [5+] 1.19446
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.