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/smlsharp-1.2.0/sample/callback/callback.c
Examining data/smlsharp-1.2.0/sample/spectrum/sine.c
Examining data/smlsharp-1.2.0/src/runtime/alloctest.c
Examining data/smlsharp-1.2.0/src/runtime/cdecl.h
Examining data/smlsharp-1.2.0/src/runtime/control.c
Examining data/smlsharp-1.2.0/src/runtime/control.h
Examining data/smlsharp-1.2.0/src/runtime/error.c
Examining data/smlsharp-1.2.0/src/runtime/exn.c
Examining data/smlsharp-1.2.0/src/runtime/frame.h
Examining data/smlsharp-1.2.0/src/runtime/heap.h
Examining data/smlsharp-1.2.0/src/runtime/heap_bitmap.c
Examining data/smlsharp-1.2.0/src/runtime/heap_cheney.c
Examining data/smlsharp-1.2.0/src/runtime/heap_malloc.c
Examining data/smlsharp-1.2.0/src/runtime/heap_otomo.c
Examining data/smlsharp-1.2.0/src/runtime/heap_otomo.h
Examining data/smlsharp-1.2.0/src/runtime/heap_reppy.c
Examining data/smlsharp-1.2.0/src/runtime/init.c
Examining data/smlsharp-1.2.0/src/runtime/intinf.h
Examining data/smlsharp-1.2.0/src/runtime/main.c
Examining data/smlsharp-1.2.0/src/runtime/netlib/dtoa.c
Examining data/smlsharp-1.2.0/src/runtime/object.c
Examining data/smlsharp-1.2.0/src/runtime/object.h
Examining data/smlsharp-1.2.0/src/runtime/objspace.c
Examining data/smlsharp-1.2.0/src/runtime/objspace.h
Examining data/smlsharp-1.2.0/src/runtime/obstack.c
Examining data/smlsharp-1.2.0/src/runtime/prim.c
Examining data/smlsharp-1.2.0/src/runtime/prim.h
Examining data/smlsharp-1.2.0/src/runtime/smlsharp.h
Examining data/smlsharp-1.2.0/src/runtime/splay.c
Examining data/smlsharp-1.2.0/src/runtime/splay.h
Examining data/smlsharp-1.2.0/src/runtime/timer.h

FINAL RESULTS:

data/smlsharp-1.2.0/src/runtime/prim.c:1537:6:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
	n = readlink(filename, buf, sizeof(buf));
data/smlsharp-1.2.0/src/runtime/prim.c:1546:7:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
		n = readlink(filename, buf, len);
data/smlsharp-1.2.0/src/runtime/alloctest.c:27:2:  [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(TIMEFMT" sec\n", TIMEARG(t));
data/smlsharp-1.2.0/src/runtime/cdecl.h:71:48:  [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 ATTR_PRINTF(m,n) __attribute__((format(printf,m,n))) ATTR_NONNULL(m)
data/smlsharp-1.2.0/src/runtime/error.c:50:2:  [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(out, format, args);
data/smlsharp-1.2.0/src/runtime/error.c:78:2:  [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(out, format, args);
data/smlsharp-1.2.0/src/runtime/error.c:160:2:  [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(out, format, args);
data/smlsharp-1.2.0/src/runtime/heap_bitmap.c:691:2:  [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(gcstat.file, fmt, args);
data/smlsharp-1.2.0/src/runtime/heap_cheney.c:84:2:  [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(gcstat.file, fmt, args);
data/smlsharp-1.2.0/src/runtime/heap_otomo.c:72:3:  [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(gcstat.file, fmt, args);
data/smlsharp-1.2.0/src/runtime/heap_reppy.c:99:2:  [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(gcstat.file, fmt, args);
data/smlsharp-1.2.0/src/runtime/netlib/dtoa.c:1778:4:  [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((char*)decimalpoint_cache, (CONST char*)s0);
data/smlsharp-1.2.0/src/runtime/prim.h:189:5:  [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.
int system(const char *);
data/smlsharp-1.2.0/src/runtime/smlsharp.h:73:48:  [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 ATTR_PRINTF(m,n) __attribute__((format(printf,m,n))) ATTR_NONNULL(m)
data/smlsharp-1.2.0/src/runtime/heap_bitmap.c:1439:8:  [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.
	env = getenv("SMLSHARP_GCSTAT_FILE");
data/smlsharp-1.2.0/src/runtime/heap_bitmap.c:1448:8:  [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.
	env = getenv("SMLSHARP_GCSTAT_VERBOSE");
data/smlsharp-1.2.0/src/runtime/heap_bitmap.c:1453:8:  [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.
	env = getenv("SMLSHARP_GCSTAT_PROBE");
data/smlsharp-1.2.0/src/runtime/heap_bitmap.c:1467:8:  [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.
	env = getenv("SMLSHARP_GC_FILLRATIO");
data/smlsharp-1.2.0/src/runtime/heap_bitmap.c:1472:8:  [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.
	env = getenv("SMLSHARP_GC_MINORCOUNT");
data/smlsharp-1.2.0/src/runtime/heap_cheney.c:347:8:  [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.
	env = getenv("SMLSHARP_GCSTAT_FILE");
data/smlsharp-1.2.0/src/runtime/heap_cheney.c:356:8:  [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.
	env = getenv("SMLSHARP_GCSTAT_VERBOSE");
data/smlsharp-1.2.0/src/runtime/heap_cheney.c:361:8:  [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.
	env = getenv("SMLSHARP_GCSTAT_PROBE");
data/smlsharp-1.2.0/src/runtime/heap_otomo.c:388:9:  [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("SMLSHARP_HEAPLAYOUT");
data/smlsharp-1.2.0/src/runtime/heap_otomo.c:593: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.
    env = getenv("SMLSHARP_GCSTAT_FILE");
data/smlsharp-1.2.0/src/runtime/heap_otomo.c:602: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.
    env = getenv("SMLSHARP_GCSTAT_VERBOSE");
data/smlsharp-1.2.0/src/runtime/heap_otomo.c:607: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.
    env = getenv("SMLSHARP_GCSTAT_PROBE");
data/smlsharp-1.2.0/src/runtime/heap_reppy.c:395:8:  [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.
	env = getenv("SMLSHARP_GCSTAT_FILE");
data/smlsharp-1.2.0/src/runtime/heap_reppy.c:404:8:  [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.
	env = getenv("SMLSHARP_GCSTAT_VERBOSE");
data/smlsharp-1.2.0/src/runtime/heap_reppy.c:409:8:  [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.
	env = getenv("SMLSHARP_GCSTAT_PROBE");
data/smlsharp-1.2.0/src/runtime/heap_reppy.c:426: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("SMLSHARP_REMEMBERSIZE");
data/smlsharp-1.2.0/src/runtime/init.c:85: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("SMLSHARP_HEAPSIZE");
data/smlsharp-1.2.0/src/runtime/init.c:89: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("SMLSHARP_VERBOSE");
data/smlsharp-1.2.0/src/runtime/prim.c:184:19:  [3] (misc) LoadLibrary:
  Ensure that the full path to the library is specified, or current directory
  may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to
  find library path, if you aren't already.
	HMODULE handle = LoadLibrary(libname);
data/smlsharp-1.2.0/src/runtime/prim.c:1955:9:  [3] (tmpfile) GetTempFileName:
  Temporary file race condition in certain cases (e.g., if run as SYSTEM in
  many versions of Windows) (CWE-377).
	ret2 = GetTempFileName(path, "tmp", 0, name);
data/smlsharp-1.2.0/src/runtime/prim.c:1970:21:  [3] (tmpfile) tmpnam:
  Temporary file race condition (CWE-377).
	return sml_str_new(tmpnam(NULL));
data/smlsharp-1.2.0/src/runtime/prim.h:187: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.
char *getenv(const char *);
data/smlsharp-1.2.0/src/runtime/exn.c:19:42:  [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 struct { unsigned int head; char body[sizeof(#name)]; } \
data/smlsharp-1.2.0/src/runtime/heap_bitmap.c:1441: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).
		gcstat.file = fopen(env, "w");
data/smlsharp-1.2.0/src/runtime/heap_cheney.c:349: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).
		gcstat.file = fopen(env, "w");
data/smlsharp-1.2.0/src/runtime/heap_cheney.c:503: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(&OBJ_HEADER(newobj), &OBJ_HEADER(obj), obj_size);
data/smlsharp-1.2.0/src/runtime/heap_otomo.c:351:29:  [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.
    while ((char *)b.cur < (char *)bitmap_info[i].tree[0]) {
data/smlsharp-1.2.0/src/runtime/heap_otomo.c:595:21:  [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).
      gcstat.file = fopen(env, "w");
data/smlsharp-1.2.0/src/runtime/heap_reppy.c:397: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).
		gcstat.file = fopen(env, "w");
data/smlsharp-1.2.0/src/runtime/heap_reppy.c:695: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(&OBJ_HEADER(newobj), &OBJ_HEADER(obj), obj_size);
data/smlsharp-1.2.0/src/runtime/heap_reppy.c:773:2:  [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_start[NUM_GENERATIONS];
data/smlsharp-1.2.0/src/runtime/netlib/dtoa.c:604:20:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define Bcopy(x,y) memcpy((char *)&x->sign, (char *)&y->sign, \
data/smlsharp-1.2.0/src/runtime/netlib/dtoa.c:1495:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static unsigned char hexdig[256];
data/smlsharp-1.2.0/src/runtime/object.c:195: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(newobj, *slot, obj_size);
data/smlsharp-1.2.0/src/runtime/object.c:204: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(newobj, *slot,
data/smlsharp-1.2.0/src/runtime/object.c:312: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(obj, str, len);
data/smlsharp-1.2.0/src/runtime/obstack.c:86: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(p2, p, oldsize < size ? oldsize : size);
data/smlsharp-1.2.0/src/runtime/prim.c:192:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char buf[128];
data/smlsharp-1.2.0/src/runtime/prim.c:397: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(dst + di, src + si, len);
data/smlsharp-1.2.0/src/runtime/prim.c:419:2:  [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[sizeof(unsigned int) * CHAR_BIT + sizeof("~")];
data/smlsharp-1.2.0/src/runtime/prim.c:435:2:  [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[sizeof(unsigned int) * CHAR_BIT + sizeof("")];
data/smlsharp-1.2.0/src/runtime/prim.c:958:2:  [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 src[8] = {byte7, byte6, byte5, byte4, byte3, byte2, byte1, byte0};
data/smlsharp-1.2.0/src/runtime/prim.c:960:2:  [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 src[8] = {byte0, byte1, byte2, byte3, byte4, byte5, byte6, byte7};
data/smlsharp-1.2.0/src/runtime/prim.c:963: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(&result, src, sizeof(double) < 8 ? sizeof(double) : 8);
data/smlsharp-1.2.0/src/runtime/prim.c:976:2:  [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 src[8] = {byte0, byte1, byte2, byte3, byte4, byte5, byte6, byte7};
data/smlsharp-1.2.0/src/runtime/prim.c:978:2:  [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 src[8] = {byte7, byte6, byte5, byte4, byte3, byte2, byte1, byte0};
data/smlsharp-1.2.0/src/runtime/prim.c:981: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(&result, src, sizeof(double) < 8 ? sizeof(double) : 8);
data/smlsharp-1.2.0/src/runtime/prim.c:993: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(buf, &d, sizeof(double) < 8 ? sizeof(double) : 8);
data/smlsharp-1.2.0/src/runtime/prim.c:1003:2:  [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 src[4] = {byte3, byte2, byte1, byte0};
data/smlsharp-1.2.0/src/runtime/prim.c:1005:2:  [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 src[4] = {byte0, byte1, byte2, byte3};
data/smlsharp-1.2.0/src/runtime/prim.c:1008: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(ret, src, sizeof(float) < 4 ? sizeof(float) : 4);
data/smlsharp-1.2.0/src/runtime/prim.c:1017:2:  [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 src[4] = {byte0, byte1, byte2, byte3};
data/smlsharp-1.2.0/src/runtime/prim.c:1019:2:  [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 src[4] = {byte3, byte2, byte1, byte0};
data/smlsharp-1.2.0/src/runtime/prim.c:1022: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(ret, src, sizeof(float) < 4 ? sizeof(float) : 4);
data/smlsharp-1.2.0/src/runtime/prim.c:1033: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(buf, &d, sizeof(float) < 4 ? sizeof(float) : 4);
data/smlsharp-1.2.0/src/runtime/prim.c:1247:10:  [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).
		return atoi(errorname);
data/smlsharp-1.2.0/src/runtime/prim.c:1360:9:  [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).
	return open(filename, flags | subflags, 0777);
data/smlsharp-1.2.0/src/runtime/prim.c:1531:2:  [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], *p;
data/smlsharp-1.2.0/src/runtime/prim.c:1858: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, str + offset, size);
data/smlsharp-1.2.0/src/runtime/prim.c:1922:2:  [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[256+1], *p;
data/smlsharp-1.2.0/src/runtime/prim.c:1934: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(obj, path, len + 1);
data/smlsharp-1.2.0/src/runtime/prim.c:1947:2:  [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[MAX_PATH + 1], name[MAX_PATH + 1];
data/smlsharp-1.2.0/src/runtime/prim.c:1962:11:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
	int fd = mkstemp(buf);
data/smlsharp-1.2.0/src/runtime/heap_bitmap.c:1455: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).
		if (env[0] != '\0' && env[strlen(env)-1] == 's') {
data/smlsharp-1.2.0/src/runtime/heap_bitmap.c:1474: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).
		if (env[0] != '\0' && env[strlen(env)-1] == '%') {
data/smlsharp-1.2.0/src/runtime/netlib/dtoa.c:1777: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).
				MALLOC(strlen((CONST char*)s0) + 1))) {
data/smlsharp-1.2.0/src/runtime/object.c:320:27:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	return sml_str_new2(str, strlen(str));
data/smlsharp-1.2.0/src/runtime/prim.c:1374:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	return read(fd, buf + offset, len);
data/smlsharp-1.2.0/src/runtime/prim.c:1865: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).
	return strlen(ptr);

ANALYSIS SUMMARY:

Hits = 83
Lines analyzed = 16856 in approximately 0.57 seconds (29679 lines/second)
Physical Source Lines of Code (SLOC) = 13471
Hits@level = [0]  74 [1]   6 [2]  41 [3]  22 [4]  12 [5]   2
Hits@level+ = [0+] 157 [1+]  83 [2+]  77 [3+]  36 [4+]  14 [5+]   2
Hits/KSLOC@level+ = [0+] 11.6547 [1+] 6.16138 [2+] 5.71598 [3+] 2.67241 [4+] 1.03927 [5+] 0.148467
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.