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/opt-3.19/src/ag.c
Examining data/opt-3.19/src/ag.h
Examining data/opt-3.19/src/opt.h
Examining data/opt-3.19/src/opt_menu.c
Examining data/opt-3.19/src/opt_num.c
Examining data/opt-3.19/src/opt_p.h
Examining data/opt-3.19/src/opt_proc.c
Examining data/opt-3.19/src/opt_reg.c
Examining data/opt-3.19/src/opt_regcc.cc
Examining data/opt-3.19/src/opt_regt.c
Examining data/opt-3.19/src/opt_sf.h
Examining data/opt-3.19/src/opt_util.c
Examining data/opt-3.19/test/birthday.c
Examining data/opt-3.19/test/hooktest.c
Examining data/opt-3.19/test/iloop.c
Examining data/opt-3.19/test/manyopts.c
Examining data/opt-3.19/test/t_num.c
Examining data/opt-3.19/test/tarray.c
Examining data/opt-3.19/test/testlong.c
Examining data/opt-3.19/test/testmain.c
Examining data/opt-3.19/test/testopt.c
Examining data/opt-3.19/test/testtypes.c
Examining data/opt-3.19/test/tnull.c
Examining data/opt-3.19/test/tstring.c
Examining data/opt-3.19/test/testcc.cc

FINAL RESULTS:

data/opt-3.19/src/opt_menu.c:114: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.
            system( respond+1 );
data/opt-3.19/src/opt_p.h:149:45:  [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.
#define opt_mess_1(fmt,var1)                printf(fmt,var1)
data/opt-3.19/src/opt_p.h:150:45:  [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.
#define opt_mess_2(fmt,var1,var2)           printf(fmt,var1,var2)
data/opt-3.19/src/opt_p.h:151:45:  [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.
#define opt_mess_3(fmt,var1,var2,var3)      printf(fmt,var1,var2,var3)
data/opt-3.19/src/opt_p.h:152:45:  [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.
#define opt_mess_4(fmt,var1,var2,var3,var4) printf(fmt,var1,var2,var3,var4)
data/opt-3.19/src/opt_p.h:155:47:  [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 opt_snprintf_1(buf,n,fmt,v1)          snprintf(buf,n,fmt,v1)
data/opt-3.19/src/opt_p.h:156:47:  [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 opt_snprintf_2(buf,n,fmt,v1,v2)       snprintf(buf,n,fmt,v1,v2)
data/opt-3.19/src/opt_p.h:157:47:  [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 opt_snprintf_3(buf,n,fmt,v1,v2,v3)    snprintf(buf,n,fmt,v1,v2,v3)
data/opt-3.19/src/opt_p.h:158:47:  [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 opt_snprintf_4(buf,n,fmt,v1,v2,v3,v4) snprintf(buf,n,fmt,v1,v2,v3,v4)
data/opt-3.19/src/opt_p.h:160:48:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
#define opt_snprintf_1(buf,n,fmt,v1)           sprintf(buf,fmt,v1)
data/opt-3.19/src/opt_p.h:161:48:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
#define opt_snprintf_2(buf,n,fmt,v1,v2)        sprintf(buf,fmt,v1,v2)
data/opt-3.19/src/opt_p.h:162:48:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
#define opt_snprintf_3(buf,n,fmt,v1,v2,v3)     sprintf(buf,fmt,v1,v2,v3)
data/opt-3.19/src/opt_p.h:163:48:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
#define opt_snprintf_4(buf,n,fmt,v1,v2,v3,v4)  sprintf(buf,fmt,v1,v2,v3,v4)
data/opt-3.19/src/opt_proc.c:301: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(st,s);
data/opt-3.19/src/opt_proc.c:302: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(st,t);
data/opt-3.19/src/opt_proc.c:565:17:  [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.
                system(argnext(ag));
data/opt-3.19/src/opt_proc.c:640: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(lincp,line);
data/opt-3.19/src/opt_reg.c:243: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(str_val,str_nth_val);
data/opt-3.19/src/opt_reg.c:244: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(str_val,str_delim);
data/opt-3.19/src/opt_reg.c:888:9:  [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(fp,format,optlist[i].name,optstrval(i));
data/opt-3.19/src/opt_reg.c:1024:9:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
        sprintf(mstring,format,optlist[i].name,s,
data/opt-3.19/src/opt_reg.c:1027:9:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
        sprintf(mstring,lformat,optlist[i].longname,s,
data/opt-3.19/src/opt_util.c:147:2:  [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 + j, prefix);
data/opt-3.19/src/opt_util.c:167:3:  [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 + j, prefix);
data/opt-3.19/src/opt_proc.c:215:6:  [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.
	s = getenv(opt_envstring);
data/opt-3.19/src/opt_proc.c:264:6:  [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.
	s = getenv(opt_envstring);
data/opt-3.19/src/opt_menu.c:44: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 mgstring[160];	/* global menu string */
data/opt-3.19/src/opt_menu.c:66: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 respond[MAXRESPONDLINE+2];
data/opt-3.19/src/opt_menu.c:92:33:  [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).
                maxoptsinmenu = atoi(respond+1);
data/opt-3.19/src/opt_p.h:169: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 gstr[OPT_ERRMAXSTRLEN]; \
data/opt-3.19/src/opt_p.h:173: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 gstr[OPT_ERRMAXSTRLEN]; \
data/opt-3.19/src/opt_p.h:177: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 gstr[OPT_ERRMAXSTRLEN]; \
data/opt-3.19/src/opt_p.h:182: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 gstr[OPT_ERRMAXSTRLEN]; \
data/opt-3.19/src/opt_p.h:186: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 gstr[OPT_ERRMAXSTRLEN]; \
data/opt-3.19/src/opt_p.h:190: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 gstr[OPT_ERRMAXSTRLEN]; \
data/opt-3.19/src/opt_proc.c:778:10:  [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).
    fp = fopen(opt_filename,"w");
data/opt-3.19/src/opt_proc.c:795:10:  [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).
    fp = fopen(fname,"r");
data/opt-3.19/src/opt_proc.c:799: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).
    fp_bak = fopen(fname_bak,"w");
data/opt-3.19/src/opt_proc.c:824: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[MAXOPLINE+2];	/* leave room for termination */
data/opt-3.19/src/opt_proc.c:832: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).
        fp = fopen(opt_filename,"r");
data/opt-3.19/src/opt_proc.c:834: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).
        fp = fopen(fname,"r");
data/opt-3.19/src/opt_reg.c:192:20:  [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 *s = *((char **)(optlist[i].value));
data/opt-3.19/src/opt_reg.c:231: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 str_delim[2] = { delim, '\0' }; 
data/opt-3.19/src/opt_reg.c:657: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 stval_buf[80];
data/opt-3.19/src/opt_reg.c:722: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(stval_buf,"\"\"");
data/opt-3.19/src/opt_reg.c:725:17:  [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(stval_buf,"\"\"");
data/opt-3.19/src/opt_reg.c:814: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	sttyp_buf[80];
data/opt-3.19/src/opt_reg.c:821:27:  [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.
    case OPT_INT:         strcpy(sttyp_buf,"<INT"); break;
data/opt-3.19/src/opt_reg.c:822:27:  [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.
    case OPT_UINT:        strcpy(sttyp_buf,"<UINT"); break;
data/opt-3.19/src/opt_reg.c:823:27:  [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.
    case OPT_SHORT:       strcpy(sttyp_buf,"<SHORT"); break;
data/opt-3.19/src/opt_reg.c:824:27:  [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.
    case OPT_LONG:        strcpy(sttyp_buf,"<LONG"); break;
data/opt-3.19/src/opt_reg.c:825:27:  [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.
    case OPT_USHORT:      strcpy(sttyp_buf,"<USHORT"); break;
data/opt-3.19/src/opt_reg.c:826:27:  [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.
    case OPT_ULONG:       strcpy(sttyp_buf,"<ULONG"); break;
data/opt-3.19/src/opt_reg.c:828:27:  [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.
    case OPT_FLOAT:       strcpy(sttyp_buf,"<FLOAT"); break;
data/opt-3.19/src/opt_reg.c:829:27:  [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.
    case OPT_DOUBLE:      strcpy(sttyp_buf,"<DOUBLE"); break;
data/opt-3.19/src/opt_reg.c:831:27:  [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.
    case OPT_CHAR:        strcpy(sttyp_buf,"<CHAR"); break;
data/opt-3.19/src/opt_reg.c:832:27:  [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.
    case OPT_UCHAR:       strcpy(sttyp_buf,"<UCHAR"); break;
data/opt-3.19/src/opt_reg.c:834:27:  [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.
    case OPT_INTLEVEL:    strcpy(sttyp_buf,"<INTLEVEL"); break;
data/opt-3.19/src/opt_reg.c:835:27:  [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.
    case OPT_TOGGLE:      strcpy(sttyp_buf,"<TOGGLE"); break;
data/opt-3.19/src/opt_reg.c:836:27:  [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.
    case OPT_BOOL:        strcpy(sttyp_buf,"<BOOL"); break;
data/opt-3.19/src/opt_reg.c:837:27:  [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.
    case OPT_NEGTOGGLE:   strcpy(sttyp_buf,"<NEGTOGGLE"); break;
data/opt-3.19/src/opt_reg.c:838:27:  [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.
    case OPT_NEGBOOL:     strcpy(sttyp_buf,"<NEGBOOL"); break;
data/opt-3.19/src/opt_reg.c:840:27:  [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.
    case OPT_STRING:      strcpy(sttyp_buf,"<STRING"); break;
data/opt-3.19/src/opt_reg.c:841:27:  [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.
    case OPT_CSTRING:     strcpy(sttyp_buf,"<STRING"); break;
data/opt-3.19/src/opt_reg.c:843:27:  [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.
    case OPT_NUL:         strcpy(sttyp_buf,"<NUL"); break;
data/opt-3.19/src/opt_reg.c:850:7:  [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(sttyp_buf," ARRAY");
data/opt-3.19/src/opt_reg.c:948:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[80];
data/opt-3.19/src/opt_reg.c:974: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	flgstr[10];
data/opt-3.19/src/opt_reg.c:992: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(flgstr,"OFF");
data/opt-3.19/src/opt_reg.c:994: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(flgstr,"ON");
data/opt-3.19/src/opt_reg.c:1000:20:  [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.
        case '\0':	sprintf(flgstr,"\'\\0\'"); break;
data/opt-3.19/src/opt_reg.c:1001:20:  [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.
        case '\n':	sprintf(flgstr,"\'\\n\'"); break;
data/opt-3.19/src/opt_reg.c:1002:20:  [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.
        case '\t':	sprintf(flgstr,"\'\\t\'"); break;
data/opt-3.19/src/opt_reg.c:1003:19:  [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.
        case ' ':	sprintf(flgstr,"\'  \'");  break;
data/opt-3.19/src/opt_reg.c:1004:18:  [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.
        default:	sprintf(flgstr,"%c",s[0]); break;
data/opt-3.19/src/opt_reg.c:1009: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(flgstr,"TRUE");
data/opt-3.19/src/opt_reg.c:1011: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(flgstr,"FALSE");
data/opt-3.19/src/opt_reg.c:1433:19:  [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.
          free(*((char **)(optlist[i].value)));
data/opt-3.19/src/opt_reg.c:1443:19:  [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.
        strncpy( (char *)optlist[i].value , argnext(ag), OPT_MAXSTRLEN );
data/opt-3.19/test/manyopts.c:41: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 s[10];
data/opt-3.19/test/manyopts.c:43: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(s,"x%04d",i);
data/opt-3.19/test/testtypes.c:44:1:  [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 mcstring[OPT_MAXSTRLEN] = "hello";
data/opt-3.19/src/ag.c:122:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if( ag->ic >= (int)strlen(ag->v[ag->iw]) )
data/opt-3.19/src/opt_menu.c:200: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).
        len = strlen(r)+1;	/* +1 since double terminated */
data/opt-3.19/src/opt_proc.c:300:26:  [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).
    st = (char *)malloc( strlen(s)+strlen(t)+1 );
data/opt-3.19/src/opt_proc.c:300:36:  [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).
    st = (char *)malloc( strlen(s)+strlen(t)+1 );
data/opt-3.19/src/opt_proc.c:331:12:  [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(pname);
data/opt-3.19/src/opt_proc.c:639: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).
    lincp = (char *)malloc((strlen(line)+2)*sizeof(char));
data/opt-3.19/src/opt_proc.c:645:11:  [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).
    lincp[strlen(line)+1]='\0';
data/opt-3.19/src/opt_proc.c:805:17:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while ((c = getc(fp)) != EOF) {
data/opt-3.19/src/opt_proc.c:855:15:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while( (c=getc(fp)) != '\n' && c!=EOF ) {
data/opt-3.19/src/opt_reg.c:236:12:  [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(str_nth_val) + strlen(str_delim);
data/opt-3.19/src/opt_reg.c:236:34:  [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(str_nth_val) + strlen(str_delim);
data/opt-3.19/src/opt_reg.c:853:5:  [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(sttyp_buf, ">");
data/opt-3.19/src/opt_reg.c:890: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(s) > 37) {
data/opt-3.19/src/opt_reg.c:902: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 (strlen(optlist[i].descript) > 37) {
data/opt-3.19/src/opt_reg.c:929:20:  [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 = 34 - strlen(optlist[i].longname);
data/opt-3.19/src/opt_reg.c:934: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(s) > 35) {
data/opt-3.19/src/opt_reg.c:951: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).
    n = strlen(buf);
data/opt-3.19/src/opt_reg.c:1019: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).
    mstring = (char*) malloc(strlen(justified_descript) + 200);
data/opt-3.19/src/opt_reg.c:1025:6:  [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).
		35-strlen(s)-3,"",justified_descript);
data/opt-3.19/src/opt_reg.c:1028:6:  [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).
		35-strlen(optlist[i].longname)-strlen(s)-3,"",justified_descript);
data/opt-3.19/src/opt_reg.c:1028:34:  [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).
		35-strlen(optlist[i].longname)-strlen(s)-3,"",justified_descript);
data/opt-3.19/src/opt_reg.c:1094:20:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                   strlen(optlist[i].longname) > OPTMAXLONGNAMELEN) {
data/opt-3.19/src/opt_reg.c:1107: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 (strlen(optlist[i].longname) > OPTMAXLONGNAMELEN) {
data/opt-3.19/src/opt_reg.c:1118: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(optlist[i].longname) > OPTMAXLONGNAMELEN) {
data/opt-3.19/src/opt_reg.c:1268:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy( (char *)v , s, OPT_MAXSTRLEN );
data/opt-3.19/src/opt_reg.c:1443:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy( (char *)optlist[i].value , argnext(ag), OPT_MAXSTRLEN );
data/opt-3.19/src/opt_util.c:132:11:  [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(s);
data/opt-3.19/src/opt_util.c:148:7:  [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).
	j += strlen(prefix);
data/opt-3.19/src/opt_util.c:168:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		j += strlen(prefix);
data/opt-3.19/src/opt_util.c:179:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(buf + j, s + i, k);
data/opt-3.19/src/opt_util.c:340:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(respond,line,maxlen);
data/opt-3.19/src/opt_util.c:345: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).
    respond[strlen(respond)+1] = '\0';
data/opt-3.19/src/opt_util.c:359: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).
    n = strlen(s);
data/opt-3.19/test/testtypes.c:57:28:  [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).
    printf("m[%d/%d]=%s\n",strlen(mcstring),sizeof(mcstring)/sizeof(mcstring[0]),mcstring);

ANALYSIS SUMMARY:

Hits = 116
Lines analyzed = 6457 in approximately 0.22 seconds (28885 lines/second)
Physical Source Lines of Code (SLOC) = 4423
Hits@level = [0]  71 [1]  34 [2]  56 [3]   2 [4]  24 [5]   0
Hits@level+ = [0+] 187 [1+] 116 [2+]  82 [3+]  26 [4+]  24 [5+]   0
Hits/KSLOC@level+ = [0+] 42.279 [1+] 26.2265 [2+] 18.5395 [3+] 5.87836 [4+] 5.42618 [5+]   0
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.