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/mawk-1.3.4.20200120/memory.c
Examining data/mawk-1.3.4.20200120/sizes.h
Examining data/mawk-1.3.4.20200120/jmp.h
Examining data/mawk-1.3.4.20200120/regexp_system.c
Examining data/mawk-1.3.4.20200120/split.c
Examining data/mawk-1.3.4.20200120/init.c
Examining data/mawk-1.3.4.20200120/error.c
Examining data/mawk-1.3.4.20200120/rexp3.c
Examining data/mawk-1.3.4.20200120/files.h
Examining data/mawk-1.3.4.20200120/types.h
Examining data/mawk-1.3.4.20200120/kw.c
Examining data/mawk-1.3.4.20200120/scan.c
Examining data/mawk-1.3.4.20200120/main.c
Examining data/mawk-1.3.4.20200120/makescan.c
Examining data/mawk-1.3.4.20200120/regexp.c
Examining data/mawk-1.3.4.20200120/regexp.h
Examining data/mawk-1.3.4.20200120/bi_vars.c
Examining data/mawk-1.3.4.20200120/bi_funct.c
Examining data/mawk-1.3.4.20200120/symtype.h
Examining data/mawk-1.3.4.20200120/matherr.c
Examining data/mawk-1.3.4.20200120/array.h
Examining data/mawk-1.3.4.20200120/rexp.c
Examining data/mawk-1.3.4.20200120/memory.h
Examining data/mawk-1.3.4.20200120/re_cmpl.c
Examining data/mawk-1.3.4.20200120/execute.c
Examining data/mawk-1.3.4.20200120/field.c
Examining data/mawk-1.3.4.20200120/bi_vars.h
Examining data/mawk-1.3.4.20200120/fin.c
Examining data/mawk-1.3.4.20200120/zmalloc.c
Examining data/mawk-1.3.4.20200120/rexp.h
Examining data/mawk-1.3.4.20200120/parse.c
Examining data/mawk-1.3.4.20200120/init.h
Examining data/mawk-1.3.4.20200120/array.c
Examining data/mawk-1.3.4.20200120/rexp1.c
Examining data/mawk-1.3.4.20200120/code.c
Examining data/mawk-1.3.4.20200120/cast.c
Examining data/mawk-1.3.4.20200120/split.h
Examining data/mawk-1.3.4.20200120/patchlev.h
Examining data/mawk-1.3.4.20200120/rexp4.c
Examining data/mawk-1.3.4.20200120/da.c
Examining data/mawk-1.3.4.20200120/files.c
Examining data/mawk-1.3.4.20200120/rexp0.c
Examining data/mawk-1.3.4.20200120/field.h
Examining data/mawk-1.3.4.20200120/hash.c
Examining data/mawk-1.3.4.20200120/rexp2.c
Examining data/mawk-1.3.4.20200120/bi_funct.h
Examining data/mawk-1.3.4.20200120/scan.h
Examining data/mawk-1.3.4.20200120/scancode.h
Examining data/mawk-1.3.4.20200120/code.h
Examining data/mawk-1.3.4.20200120/jmp.c
Examining data/mawk-1.3.4.20200120/fcall.c
Examining data/mawk-1.3.4.20200120/version.c
Examining data/mawk-1.3.4.20200120/zmalloc.h
Examining data/mawk-1.3.4.20200120/msdos/vs2008.h
Examining data/mawk-1.3.4.20200120/msdos/dosexec.c
Examining data/mawk-1.3.4.20200120/mawk.h
Examining data/mawk-1.3.4.20200120/fin.h
Examining data/mawk-1.3.4.20200120/parse.h
Examining data/mawk-1.3.4.20200120/repl.h
Examining data/mawk-1.3.4.20200120/nstd.h
Examining data/mawk-1.3.4.20200120/fpe_check.c
Examining data/mawk-1.3.4.20200120/trace.c
Examining data/mawk-1.3.4.20200120/rexpdb.c
Examining data/mawk-1.3.4.20200120/print.c

FINAL RESULTS:

data/mawk-1.3.4.20200120/array.c:87:16:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
               sprintf(buff, string(CONVFMT)->str, d) ;
data/mawk-1.3.4.20200120/array.c:149:16:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
               sprintf(buff, string(CONVFMT)->str, d) ;
data/mawk-1.3.4.20200120/array.c:344:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
             sprintf(buff, INT_FMT, ival) ;
data/mawk-1.3.4.20200120/array.c:453:13:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
            sprintf(buff, INT_FMT, p->ival) ;
data/mawk-1.3.4.20200120/bi_funct.c:917:27:  [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.
    ret_val = wait_status(system(string(sp)->str));
data/mawk-1.3.4.20200120/cast.c:154:6:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	    sprintf(xbuff, INT_FMT, lval);
data/mawk-1.3.4.20200120/cast.c:156:6:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	    sprintf(xbuff, string(CONVFMT)->str, cp->dval);
data/mawk-1.3.4.20200120/cast.c:190:6:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	    sprintf(xbuff, INT_FMT, lval);
data/mawk-1.3.4.20200120/cast.c:192:6:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	    sprintf(xbuff, string(CONVFMT)->str, cp->dval);
data/mawk-1.3.4.20200120/cast.c:222:6:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	    sprintf(xbuff, INT_FMT, lval);
data/mawk-1.3.4.20200120/cast.c:224:6:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	    sprintf(xbuff, string(CONVFMT)->str, cp->dval);
data/mawk-1.3.4.20200120/da.c:304:2:  [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, jfmt, "jmp", tab2, (p - start) + p->op);
data/mawk-1.3.4.20200120/da.c:309:2:  [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, jfmt, "jnz", tab2, (p - start) + p->op);
data/mawk-1.3.4.20200120/da.c:314:2:  [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, jfmt, "jz", tab2, (p - start) + p->op);
data/mawk-1.3.4.20200120/da.c:319:2:  [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, jfmt, "ljz", tab2, (p - start) + p->op);
data/mawk-1.3.4.20200120/da.c:324:2:  [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, jfmt, "ljnz", tab2 + 1, (p - start) + p->op);
data/mawk-1.3.4.20200120/error.c:193:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stderr, format, args);
data/mawk-1.3.4.20200120/error.c:222:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stderr, format, args);
data/mawk-1.3.4.20200120/error.c:262:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stderr, format, args);
data/mawk-1.3.4.20200120/field.c:454:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
		sprintf(xbuff, string(fp)->str, 3.1459);
data/mawk-1.3.4.20200120/field.c:547:4:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
			sprintf(xbuff, INT_FMT, ival);
data/mawk-1.3.4.20200120/field.c:549:4:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
			sprintf(xbuff, string(CONVFMT)->str, cp->dval);
data/mawk-1.3.4.20200120/files.c:455:2:  [4] (shell) execl:
  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.
	execl(shell, shell, "-c", name, (char *) 0);
data/mawk-1.3.4.20200120/fin.c:596:19:  [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).
    p = rm_escape(strcpy((char *) zmalloc(len), p), &length);
data/mawk-1.3.4.20200120/fpe_check.c:146:11:  [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.
	result = system(command) == 0;
data/mawk-1.3.4.20200120/hash.c:120:23:  [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).
	    p->symtab.name = strcpy(zmalloc(strlen(s) + 1), s);
data/mawk-1.3.4.20200120/memory.c:91: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(sval->str, s);
data/mawk-1.3.4.20200120/msdos/dosexec.c:96:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(xbuff, "%s %s", command_opt, command);
data/mawk-1.3.4.20200120/msdos/dosexec.c:129:12:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    (void) sprintf(buffer, "%sMAWK%04X.%03X", tmpdir, mawkid, id);
data/mawk-1.3.4.20200120/msdos/dosexec.c:151:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(xbuff, "%s > %s", command, tmpname);
data/mawk-1.3.4.20200120/msdos/dosexec.c:172:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(xbuff, "%s < %s", command, tmpname);
data/mawk-1.3.4.20200120/print.c:64:3:  [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, INT_FMT, ival);
data/mawk-1.3.4.20200120/print.c:66:3:  [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, string(OFMT)->str, p->dval);
data/mawk-1.3.4.20200120/print.c:417:22:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	printer = (PRINTER) sprintf;
data/mawk-1.3.4.20200120/print.c:421:22:  [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.
	printer = (PRINTER) fprintf;
data/mawk-1.3.4.20200120/print.c:600:6:  [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(xbuff, p);
data/mawk-1.3.4.20200120/regexp_system.c:404:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(error_buffer,
data/mawk-1.3.4.20200120/scan.c:82: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(program_string->str, cmdline_program);
data/mawk-1.3.4.20200120/trace.c:33:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(trace_fp, format, args);
data/mawk-1.3.4.20200120/trace.c:42:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(trace_fp, format, args);
data/mawk-1.3.4.20200120/version.c:33: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(VERSION_STRING, PATCH_BASE, PATCH_LEVEL, PATCH_STRING, DATE_STRING);
data/mawk-1.3.4.20200120/version.c:38: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, FMT_S, SHOW_RANDOM, NAME_RANDOM);
data/mawk-1.3.4.20200120/version.c:40: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, FMT_S, SHOW_RANDOM, "internal");
data/mawk-1.3.4.20200120/version.c:45: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, FMT_S, SHOW_REGEXP, "internal");
data/mawk-1.3.4.20200120/version.c:47: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, FMT_S, SHOW_REGEXP, "external");
data/mawk-1.3.4.20200120/version.c:51: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, FMT_N, "sprintf buffer", (double) SPRINTF_LIMIT);
data/mawk-1.3.4.20200120/version.c:52: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, FMT_N, "maximum-integer", (double) MAX__INT);
data/mawk-1.3.4.20200120/version.c:55: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, FMT_N, "maximum-unsigned", (double) MAX__UINT);
data/mawk-1.3.4.20200120/version.c:56: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, FMT_N, "maximum-long", (double) MAX__LONG);
data/mawk-1.3.4.20200120/array.c:273:11:  [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 (getenv("WHINY_USERS") != NULL)        /* gawk compatibility */
data/mawk-1.3.4.20200120/init.c:79:12:  [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.
	char *p = getenv("MAWKBINMODE");
data/mawk-1.3.4.20200120/init.c:214:14:  [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.
	char *env = getenv("MAWK_LONG_OPTIONS");
data/mawk-1.3.4.20200120/msdos/dosexec.c:67:14:  [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 ((s = getenv("MAWKSHELL")) != 0) {
data/mawk-1.3.4.20200120/msdos/dosexec.c:77:21:  [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.
    } else if ((s = getenv("COMSPEC")) != 0) {
data/mawk-1.3.4.20200120/msdos/dosexec.c:124:11:  [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.
	tmpdir = getenv("MAWKTMPDIR");
data/mawk-1.3.4.20200120/parse.c:1596:16:  [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 ((yys = getenv("YYDEBUG")) != 0)
data/mawk-1.3.4.20200120/array.c:85:16:  [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 buff[260] ;
data/mawk-1.3.4.20200120/array.c:147:16:  [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 buff[260] ;
data/mawk-1.3.4.20200120/array.c:310: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(target, string(p)->str, string(p)->len) ;
data/mawk-1.3.4.20200120/array.c:312: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(target, subsep_str, subsep_len) ;
data/mawk-1.3.4.20200120/array.c:316:4:  [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(target, string(p)->str, string(p)->len) ;
data/mawk-1.3.4.20200120/array.c:342: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.
             char buff[256] ;
data/mawk-1.3.4.20200120/array.c:447: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 buff[256] ;
data/mawk-1.3.4.20200120/bi_funct.c:293:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(string(sp)->str, sval->str + i, (size_t) n);
data/mawk-1.3.4.20200120/bi_funct.c:479: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 buff[128];
data/mawk-1.3.4.20200120/bi_funct.c:1025:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(string(&tc)->str, p, len);
data/mawk-1.3.4.20200120/bi_funct.c:1093:6:  [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(sval->str, middle, middle_len);
data/mawk-1.3.4.20200120/bi_funct.c:1105:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy(p, front, front_len);
data/mawk-1.3.4.20200120/bi_funct.c:1109:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy(p, string(sp + 1)->str, string(sp + 1)->len);
data/mawk-1.3.4.20200120/bi_funct.c:1113:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy(p, back, back_len);
data/mawk-1.3.4.20200120/bi_funct.c:1181:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy(output->str + used, input->str + j, have);
data/mawk-1.3.4.20200120/bi_funct.c:1223:4:  [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(output->str, buffer->str, used);
data/mawk-1.3.4.20200120/bi_funct.c:1233:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy(output->str + used, string(&xrepl)->str, have);
data/mawk-1.3.4.20200120/bi_funct.c:1254:6:  [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(output->str + used, input->str + j, have);
data/mawk-1.3.4.20200120/bi_vars.c:41: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 *bi_var_names[NUM_BI_VAR] =
data/mawk-1.3.4.20200120/cast.c:142: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 xbuff[260];
data/mawk-1.3.4.20200120/cast.c:178: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 xbuff[260];
data/mawk-1.3.4.20200120/cast.c:276: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 temp[1];
data/mawk-1.3.4.20200120/cast.c:287: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 temp[2];
data/mawk-1.3.4.20200120/execute.c:804:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy(b->str, str1, len1);
data/mawk-1.3.4.20200120/execute.c:805:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy(b->str + len1, str2, len2);
data/mawk-1.3.4.20200120/field.c:218:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(string(&field[0])->str, s, len);
data/mawk-1.3.4.20200120/field.c:451: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 xbuff[512];
data/mawk-1.3.4.20200120/field.c:543: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 xbuff[260];
data/mawk-1.3.4.20200120/field.c:575:6:  [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, string(cp)->str, string(cp)->len);
data/mawk-1.3.4.20200120/field.c:591:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(p, tail->str, tail->len);
data/mawk-1.3.4.20200120/files.c:260: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 xbuff[100];
data/mawk-1.3.4.20200120/files.c:386: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 xbuff[100];
data/mawk-1.3.4.20200120/files.c:616:20:  [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 *retval = fopen(name, mode);
data/mawk-1.3.4.20200120/fin.c:113:22:  [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).
    } else if ((fd = open(filename, oflag, 0)) != -1) {
data/mawk-1.3.4.20200120/fin.c:221:8:  [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(new_buff, fin->buff, my_size);
data/mawk-1.3.4.20200120/fpe_check.c:135: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 command[128];
data/mawk-1.3.4.20200120/fpe_check.c:144:2:  [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(command,
data/mawk-1.3.4.20200120/init.c:82:18:  [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).
	    set_binmode(atoi(p));
data/mawk-1.3.4.20200120/init.c:355:16:  [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).
			set_binmode(atoi(optNext + 1));
data/mawk-1.3.4.20200120/init.c:394:12:  [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).
			int x = atoi(optNext + 1);
data/mawk-1.3.4.20200120/init.c:411:12:  [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).
			int x = atoi(optNext + 1);
data/mawk-1.3.4.20200120/init.c:567:6:  [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(string(&c)->str, *p, len);
data/mawk-1.3.4.20200120/jmp.c:207:6:  [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->code, code, sizeof(INST) * len);
data/mawk-1.3.4.20200120/jmp.c:253:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(target, p->code, len * sizeof(INST));
data/mawk-1.3.4.20200120/makescan.c:27: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 scan_code[256];
data/mawk-1.3.4.20200120/mawk.h:76: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.
extern char string_buff[SPRINTF_LIMIT];
data/mawk-1.3.4.20200120/memory.c:74:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(sval->str, s, len);
data/mawk-1.3.4.20200120/msdos/dosexec.c:74:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(my_shell, s, len);
data/mawk-1.3.4.20200120/msdos/dosexec.c:91: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 xbuff[256];
data/mawk-1.3.4.20200120/msdos/dosexec.c:142: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 xbuff[256];
data/mawk-1.3.4.20200120/msdos/dosexec.c:149:17:  [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).
	retval = (PTR) fopen(tmpname, (binmode() & 2) ? "wb" : "w");
data/mawk-1.3.4.20200120/msdos/dosexec.c:168: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 xbuff[256];
data/mawk-1.3.4.20200120/print.c:303: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, source, (size_t) length);
data/mawk-1.3.4.20200120/print.c:412: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 xbuff[256];		/* splice in l qualifier here */
data/mawk-1.3.4.20200120/re_cmpl.c:415:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(target, (*p)->str, (*p)->len);
data/mawk-1.3.4.20200120/regexp_system.c:392: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 error_buffer[2048];
data/mawk-1.3.4.20200120/rexp0.c:754: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 hex_val['f' - 'A' + 1] =
data/mawk-1.3.4.20200120/rexp1.c:105: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(mp->start + sz1, np->start, sz2 * STATESZ);
data/mawk-1.3.4.20200120/rexp1.c:121: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(p + 1, mp->start, szm * STATESZ);
data/mawk-1.3.4.20200120/rexp1.c:127: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(p + szm + 1, np->start, szn * STATESZ);
data/mawk-1.3.4.20200120/rexp1.c:189: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(p + 2, mp->start, sz * STATESZ);
data/mawk-1.3.4.20200120/rexp1.c:220: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(p + 1, mp->start, sz * STATESZ);
data/mawk-1.3.4.20200120/rexp1.c:241: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(p + 1, mp->start, sz * STATESZ);
data/mawk-1.3.4.20200120/scan.c:63: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 string_buff[SPRINTF_LIMIT];
data/mawk-1.3.4.20200120/scan.c:112:30:  [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).
    } else if ((program_fd = open(pfile_name, O_RDONLY, 0)) == -1) {
data/mawk-1.3.4.20200120/scan.c:819: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 hex_val['f' - 'A' + 1] =
data/mawk-1.3.4.20200120/scancode.h:23: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.
extern char scan_code[256];
data/mawk-1.3.4.20200120/trace.c:27:13:  [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).
	trace_fp = fopen("Trace.out", "w");
data/mawk-1.3.4.20200120/types.h:65: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[2];
data/mawk-1.3.4.20200120/zmalloc.c:209: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 dummy[ZBLOCKSZ];
data/mawk-1.3.4.20200120/zmalloc.c:305:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(q, p, old_size < new_size ? old_size : new_size);
data/mawk-1.3.4.20200120/fin.c:238:32:  [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).
	    fin->limit = fin->buffp + strlen(fin->buffp);
data/mawk-1.3.4.20200120/fin.c:391:20:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	switch (r = (int) read(fd, target, size)) {
data/mawk-1.3.4.20200120/fin.c:594: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(p) + 1;
data/mawk-1.3.4.20200120/hash.c:120:38:  [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).
	    p->symtab.name = strcpy(zmalloc(strlen(s) + 1), s);
data/mawk-1.3.4.20200120/hash.c:282:32:  [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).
	zfree((PTR) (p->symtab.name), strlen(p->symtab.name) + 1);
data/mawk-1.3.4.20200120/init.c:321: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).
	if (strlen(argv[i]) > 2 && !strncmp(argv[i], "--", (size_t) 2)) {
data/mawk-1.3.4.20200120/init.c:347: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).
	    for (j = 0; j < (int) strlen(optArg); j = (int) (optNext - optArg)) {
data/mawk-1.3.4.20200120/main.c:57: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).
	    && strlen(data->decimal_point) == 1) {
data/mawk-1.3.4.20200120/memory.c:90: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).
	STRING *sval = xnew_STRING(strlen(s));
data/mawk-1.3.4.20200120/msdos/dosexec.c:125: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 (!tmpdir || strlen(tmpdir) > 80)
data/mawk-1.3.4.20200120/regexp_system.c:309: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).
	    assert(strlen(new_regexp) < need);
data/mawk-1.3.4.20200120/regexp_system.c:406: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).
		(int) (sizeof(error_buffer) - sizeof(fmt) - strlen(msg)),
data/mawk-1.3.4.20200120/rexp2.c:340: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).
	s += strlen(s);
data/mawk-1.3.4.20200120/scan.c:81: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).
	program_string = new_STRING0(strlen(cmdline_program) + 1);

ANALYSIS SUMMARY:

Hits = 141
Lines analyzed = 21305 in approximately 0.52 seconds (40711 lines/second)
Physical Source Lines of Code (SLOC) = 16127
Hits@level = [0]  92 [1]  14 [2]  71 [3]   7 [4]  49 [5]   0
Hits@level+ = [0+] 233 [1+] 141 [2+] 127 [3+]  56 [4+]  49 [5+]   0
Hits/KSLOC@level+ = [0+] 14.4478 [1+] 8.7431 [2+] 7.87499 [3+] 3.47244 [4+] 3.03838 [5+]   0
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.