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/garmin-forerunner-tools-0.10repacked/src/byte_util.c
Examining data/garmin-forerunner-tools-0.10repacked/src/command.c
Examining data/garmin-forerunner-tools-0.10repacked/src/garmin_dump.c
Examining data/garmin-forerunner-tools-0.10repacked/src/protocol.c
Examining data/garmin-forerunner-tools-0.10repacked/src/symbol_name.c
Examining data/garmin-forerunner-tools-0.10repacked/src/garmin_save_runs.c
Examining data/garmin-forerunner-tools-0.10repacked/src/scan.c
Examining data/garmin-forerunner-tools-0.10repacked/src/datatype.c
Examining data/garmin-forerunner-tools-0.10repacked/src/packet_id.c
Examining data/garmin-forerunner-tools-0.10repacked/src/print.c
Examining data/garmin-forerunner-tools-0.10repacked/src/garmin.h
Examining data/garmin-forerunner-tools-0.10repacked/src/unpack.c
Examining data/garmin-forerunner-tools-0.10repacked/src/pack.c
Examining data/garmin-forerunner-tools-0.10repacked/src/run.c
Examining data/garmin-forerunner-tools-0.10repacked/src/garmin_get_info.c
Examining data/garmin-forerunner-tools-0.10repacked/src/garmin_gmap.c
Examining data/garmin-forerunner-tools-0.10repacked/src/garmin_gchart.c
Examining data/garmin-forerunner-tools-0.10repacked/src/garmin_gpx.c
Examining data/garmin-forerunner-tools-0.10repacked/src/usb_comm.c
Examining data/garmin-forerunner-tools-0.10repacked/python/pygarmin.c

FINAL RESULTS:

data/garmin-forerunner-tools-0.10repacked/src/pack.c:1135:6:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
	    chown(rpath,owner,group);
data/garmin-forerunner-tools-0.10repacked/src/pack.c:1150:7:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
      chown(rpath,owner,group);
data/garmin-forerunner-tools-0.10repacked/src/byte_util.c:139: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(*buf,x);
data/garmin-forerunner-tools-0.10repacked/src/garmin_gchart.c:202:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(encoded_strings->time + encoded_strings->time_len, "%s", str); 
data/garmin-forerunner-tools-0.10repacked/src/garmin_gchart.c:206:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(encoded_strings->distance + encoded_strings->distance_len, "%s", str); 
data/garmin-forerunner-tools-0.10repacked/src/garmin_gchart.c:210:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(encoded_strings->alt + encoded_strings->alt_len, "%s", str);
data/garmin-forerunner-tools-0.10repacked/src/garmin_get_info.c:34:14:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  verbose = (getopt(argc,argv,"v") != -1);
data/garmin-forerunner-tools-0.10repacked/src/garmin_save_runs.c:34:14:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  verbose = (getopt(argc,argv,"v") != -1);
data/garmin-forerunner-tools-0.10repacked/src/run.c:212:19:  [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.
  if ( (filedir = getenv("GARMIN_SAVE_RUNS")) != NULL ) {
data/garmin-forerunner-tools-0.10repacked/src/run.c:214:15:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
    filedir = realpath(filedir,NULL);
data/garmin-forerunner-tools-0.10repacked/src/run.c:216:15:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
    filedir = realpath(filedir,path);
data/garmin-forerunner-tools-0.10repacked/src/run.c:220:7:  [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.
	     getenv("GARMIN_SAVE_RUNS"),strerror(errno));
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:363:3:  [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             ident[6];       /* identifier            */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:366:3:  [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             cmnt[40];       /* comment               */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:371:3:  [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             ident[6];       /* identifier            */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:374:3:  [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             cmnt[40];       /* comment               */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:381:3:  [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             ident[6];      /* identifier                   */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:384:3:  [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             cmnt[40];      /* comment                      */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:391:3:  [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             ident[6];      /* identifier                    */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:394:3:  [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             cmnt[40];      /* comment                       */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:432:3:  [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              ident[6];        /* identifier                    */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:435:3:  [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              cmnt[40];        /* comment                       */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:470:3:  [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              ident[6];   /* identifier                   */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:473:3:  [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              cmnt[40];   /* comment                      */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:500:3:  [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             state[2];     /* state                           2      */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:501:3:  [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             cc[2];        /* country code                    2      */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:565:3:  [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            state[2];       /* state                            2    */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:566:3:  [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            cc[2];          /* country code                     2    */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:588:3:  [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            state[2];       /* state                            2    */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:589:3:  [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            cc[2];          /* country code                     2    */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:651:3:  [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              name[17];        /* category name */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:656:3:  [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              ident[6];        /* identifier                */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:657:3:  [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              cc[2];           /* country code              */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:661:3:  [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              city[24];        /* city                      */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:662:3:  [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              state[2];        /* state                     */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:663:3:  [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              name[30];        /* facility name             */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:664:3:  [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              cmnt[40];        /* comment                   */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:683:3:  [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             ident[6];        /* identifier                   */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:686:3:  [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             cmnt[40];        /* comment                      */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:688:3:  [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             name[30];        /* facility name                */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:689:3:  [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             city[24];        /* city                         */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:690:3:  [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             state[2];        /* state                        */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:692:3:  [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             cc[2];           /* country code                 */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:711:3:  [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            ident[6];        /* identifier                     */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:714:3:  [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            cmnt[40];        /* comment                        */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:716:3:  [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            name[30];        /* facility name                  */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:717:3:  [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            city[24];        /* city                           */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:718:3:  [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            state[2];        /* state                          */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:720:3:  [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            cc[2];           /* country code                   */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:739:3:  [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              ident[6];        /* identifier                     */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:742:3:  [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              cmnt[40];        /* comment                        */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:744:3:  [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              name[30];        /* facility name                  */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:745:3:  [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              city[24];        /* city                           */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:746:3:  [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              state[2];        /* state                          */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:748:3:  [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              cc[2];           /* country code                   */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:772:3:  [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              ident[6];        /* identifier                   */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:775:3:  [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              cmnt[40];        /* comment                      */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:777:3:  [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              name[30];        /* facility name                */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:778:3:  [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              city[24];        /* city                         */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:779:3:  [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              state[2];        /* state                        */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:781:3:  [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              cc[2];           /* country code                 */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:815:3:  [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                  cmnt[20];   /* comment                 */
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:1085: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                       custom_name[16];
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:1095:3:  [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                         name[16];
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:1165:3:  [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                         workout_name[16];
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:1180:7:  [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                     name[16];
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:1211:3:  [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                         course_name[16];
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:1233: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                       custom_name[16];
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:1243:3:  [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                         name[16];
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:1324:3:  [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                         name[11];
data/garmin-forerunner-tools-0.10repacked/src/garmin.h:1514:3:  [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               data[1024];
data/garmin-forerunner-tools-0.10repacked/src/garmin_gchart.c:189:6:  [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 str[3];
data/garmin-forerunner-tools-0.10repacked/src/garmin_gchart.c:215:3:  [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(encoded_strings->time + encoded_strings->time_len, "%.1f,", 
data/garmin-forerunner-tools-0.10repacked/src/garmin_gchart.c:219:3:  [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(encoded_strings->distance + encoded_strings->distance_len, "%.1f,", 
data/garmin-forerunner-tools-0.10repacked/src/garmin_gchart.c:223:3:  [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(encoded_strings->alt + encoded_strings->alt_len, "%.1f,", 
data/garmin-forerunner-tools-0.10repacked/src/garmin_gchart.c:270:3:  [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 str_d[1024];
data/garmin-forerunner-tools-0.10repacked/src/garmin_gchart.c:271:3:  [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 str_a[1024];
data/garmin-forerunner-tools-0.10repacked/src/garmin_gchart.c:272:3:  [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 str_t[1024];
data/garmin-forerunner-tools-0.10repacked/src/garmin_gchart.c:311:3:  [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 *good_args[size];
data/garmin-forerunner-tools-0.10repacked/src/garmin_gchart.c:318:19:  [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).
      conf->width=atoi(argv[i]);
data/garmin-forerunner-tools-0.10repacked/src/garmin_gchart.c:322:20:  [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).
      conf->height=atoi(argv[i]);
data/garmin-forerunner-tools-0.10repacked/src/garmin_gpx.c:248:3:  [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[512];
data/garmin-forerunner-tools-0.10repacked/src/pack.c:45: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(*pos,x,sizeof(x)-1);                                           \
data/garmin-forerunner-tools-0.10repacked/src/pack.c:1087:3:  [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        rpath[BUFSIZ];
data/garmin-forerunner-tools-0.10repacked/src/pack.c:1178:3:  [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        path[BUFSIZ];
data/garmin-forerunner-tools-0.10repacked/src/print.c:152:3:  [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[128];
data/garmin-forerunner-tools-0.10repacked/src/print.c:1531:25:  [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).
  GARMIN_ENUM_CASE(1002,open);
data/garmin-forerunner-tools-0.10repacked/src/run.c:202:3:  [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[BUFSIZ];
data/garmin-forerunner-tools-0.10repacked/src/run.c:207:3:  [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                path[PATH_MAX];
data/garmin-forerunner-tools-0.10repacked/src/run.c:209:3:  [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                filepath[BUFSIZ];
data/garmin-forerunner-tools-0.10repacked/src/unpack.c:1175:14:  [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).
  if ( (fd = open(filename,O_RDONLY)) != -1 ) {
data/garmin-forerunner-tools-0.10repacked/src/usb_comm.c:253:7:  [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(p->packet.data,data,size);
data/garmin-forerunner-tools-0.10repacked/src/usb_comm.c:367:3:  [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   hex[128];
data/garmin-forerunner-tools-0.10repacked/src/usb_comm.c:368:3:  [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   dec[128];
data/garmin-forerunner-tools-0.10repacked/src/usb_comm.c:383:7:  [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(&hex[(3*(i&0x0f))]," %02x",p->packet.data[i]);
data/garmin-forerunner-tools-0.10repacked/src/usb_comm.c:384:7:  [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(&dec[(i&0x0f)],"%c",
data/garmin-forerunner-tools-0.10repacked/src/byte_util.c:103:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(ret,start,bytes-1);
data/garmin-forerunner-tools-0.10repacked/src/byte_util.c:127:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(ret,start,bytes-1);
data/garmin-forerunner-tools-0.10repacked/src/byte_util.c:140: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).
    *buf += strlen(x)+1;
data/garmin-forerunner-tools-0.10repacked/src/byte_util.c:174:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(elem,start,bytes-1);
data/garmin-forerunner-tools-0.10repacked/src/datatype.c:317: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 (d##x->y != NULL) bytes += strlen(d##x->y)
data/garmin-forerunner-tools-0.10repacked/src/pack.c:1206:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(pos,GARMIN_MAGIC,11);
data/garmin-forerunner-tools-0.10repacked/src/print.c:173: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).
  len = strlen(buf);
data/garmin-forerunner-tools-0.10repacked/src/unpack.c:1114: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 ( memcmp(*pos,GARMIN_MAGIC,strlen(GARMIN_MAGIC)) == 0 ) {
data/garmin-forerunner-tools-0.10repacked/src/unpack.c:1178:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if ( (bytes = read(fd,buf,sb.st_size)) == sb.st_size ) {

ANALYSIS SUMMARY:

Hits = 105
Lines analyzed = 11905 in approximately 0.32 seconds (36812 lines/second)
Physical Source Lines of Code (SLOC) = 8577
Hits@level = [0] 277 [1]   9 [2]  84 [3]   6 [4]   4 [5]   2
Hits@level+ = [0+] 382 [1+] 105 [2+]  96 [3+]  12 [4+]   6 [5+]   2
Hits/KSLOC@level+ = [0+] 44.5377 [1+] 12.242 [2+] 11.1927 [3+] 1.39909 [4+] 0.699545 [5+] 0.233182
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.