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/libserialport-0.1.1/linux.c
Examining data/libserialport-0.1.1/windows.c
Examining data/libserialport-0.1.1/freebsd.c
Examining data/libserialport-0.1.1/macosx.c
Examining data/libserialport-0.1.1/linux_termios.h
Examining data/libserialport-0.1.1/serialport.c
Examining data/libserialport-0.1.1/libserialport_internal.h
Examining data/libserialport-0.1.1/linux_termios.c

FINAL RESULTS:

data/libserialport-0.1.1/freebsd.c:224:3:  [5] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is high; the length parameter
  appears to be a constant, instead of computing the number of characters
  left.
		strncat(tbuf, port->usb_product, sizeof(tbuf) - 1);
data/libserialport-0.1.1/freebsd.c:226:3:  [5] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is high; the length parameter
  appears to be a constant, instead of computing the number of characters
  left.
		strncat(tbuf, libusb20_dev_get_desc(dev), sizeof(tbuf) - 1);
data/libserialport-0.1.1/freebsd.c:228:3:  [5] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is high; the length parameter
  appears to be a constant, instead of computing the number of characters
  left.
		strncat(tbuf, " ", sizeof(tbuf) - 1);
data/libserialport-0.1.1/freebsd.c:229:3:  [5] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is high; the length parameter
  appears to be a constant, instead of computing the number of characters
  left.
		strncat(tbuf, port->usb_serial, sizeof(tbuf) - 1);
data/libserialport-0.1.1/linux.c:51:10:  [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.
	count = readlink(file_name, file_name, sizeof(file_name));
data/libserialport-0.1.1/linux.c:203:9:  [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.
		len = readlink(buf, target, sizeof(target));
data/libserialport-0.1.1/linux.c:64:4:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
			snprintf(file_name, sizeof(file_name), dir_name, dev, sub_dir, "busnum");
data/libserialport-0.1.1/linux.c:72:4:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
			snprintf(file_name, sizeof(file_name), dir_name, dev, sub_dir, "devnum");
data/libserialport-0.1.1/linux.c:80:4:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
			snprintf(file_name, sizeof(file_name), dir_name, dev, sub_dir, "idVendor");
data/libserialport-0.1.1/linux.c:88:4:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
			snprintf(file_name, sizeof(file_name), dir_name, dev, sub_dir, "idProduct");
data/libserialport-0.1.1/linux.c:101:4:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
			snprintf(file_name, sizeof(file_name), dir_name, dev, sub_dir, "product");
data/libserialport-0.1.1/linux.c:114:4:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
			snprintf(file_name, sizeof(file_name), dir_name, dev, sub_dir, "manufacturer");
data/libserialport-0.1.1/linux.c:125:4:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
			snprintf(file_name, sizeof(file_name), dir_name, dev, sub_dir, "product");
data/libserialport-0.1.1/linux.c:136:4:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
			snprintf(file_name, sizeof(file_name), dir_name, dev, sub_dir, "serial");
data/libserialport-0.1.1/linux.c:162:4:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
			snprintf(file_name, sizeof(file_name), dir_name, dev, "", "address");
data/libserialport-0.1.1/serialport.c:465:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(escaped_port_name, "\\\\.\\%s", port->name);
data/libserialport-0.1.1/serialport.c:2530: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(stderr, format, args);
data/libserialport-0.1.1/windows.c:258:2:  [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(device_name, hub_name);
data/libserialport-0.1.1/windows.c:447: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(tmp, usb_path);
data/libserialport-0.1.1/windows.c:460:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf(escaped_port_name, "\\\\.\\%s", port->name);
data/libserialport-0.1.1/windows.c:532: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(name, data);
data/libserialport-0.1.1/serialport.c:2528: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.
	if (getenv("LIBSERIALPORT_DEBUG")) {
data/libserialport-0.1.1/freebsd.c:122: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 sbuf[FILENAME_MAX];
data/libserialport-0.1.1/freebsd.c:159: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 sbuf[FILENAME_MAX];
data/libserialport-0.1.1/freebsd.c:160: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 tbuf[FILENAME_MAX];
data/libserialport-0.1.1/freebsd.c:195: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 tbuf[FILENAME_MAX];
data/libserialport-0.1.1/freebsd.c:242: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 tbuf[FILENAME_MAX];
data/libserialport-0.1.1/freebsd.c:331: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 name[PATH_MAX];
data/libserialport-0.1.1/freebsd.c:356:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		if ((fd = open(name, O_RDWR | O_NONBLOCK | O_NOCTTY | O_TTY_INIT | O_CLOEXEC)) < 0) {
data/libserialport-0.1.1/linux.c:31: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 description[128];
data/libserialport-0.1.1/linux.c:34: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 manufacturer[128], product[128], serial[128];
data/libserialport-0.1.1/linux.c:35: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 baddr[32];
data/libserialport-0.1.1/linux.c:37: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 sub_dir[32] = "", file_name[PATH_MAX];
data/libserialport-0.1.1/linux.c:62:4:  [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(sub_dir, "../");
data/libserialport-0.1.1/linux.c:65: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).
			if (!(file = fopen(file_name, "r")))
data/libserialport-0.1.1/linux.c:73: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).
			if (!(file = fopen(file_name, "r")))
data/libserialport-0.1.1/linux.c:81: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).
			if (!(file = fopen(file_name, "r")))
data/libserialport-0.1.1/linux.c:89: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).
			if (!(file = fopen(file_name, "r")))
data/libserialport-0.1.1/linux.c:102:16:  [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).
			if ((file = fopen(file_name, "r"))) {
data/libserialport-0.1.1/linux.c:115:16:  [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).
			if ((file = fopen(file_name, "r"))) {
data/libserialport-0.1.1/linux.c:126:16:  [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).
			if ((file = fopen(file_name, "r"))) {
data/libserialport-0.1.1/linux.c:137:16:  [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).
			if ((file = fopen(file_name, "r"))) {
data/libserialport-0.1.1/linux.c:163:16:  [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).
			if ((file = fopen(file_name, "r"))) {
data/libserialport-0.1.1/linux.c:180: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 name[PATH_MAX], target[PATH_MAX];
data/libserialport-0.1.1/linux.c:186: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(entry.d_name) + 23];
data/libserialport-0.1.1/linux.c:218:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
			if ((fd = open(name, O_RDWR | O_NONBLOCK | O_NOCTTY)) < 0) {
data/libserialport-0.1.1/macosx.c:31: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 description[128];
data/libserialport-0.1.1/macosx.c:33: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 manufacturer[128], product[128], serial[128];
data/libserialport-0.1.1/macosx.c:39: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[PATH_MAX], class[16];
data/libserialport-0.1.1/macosx.c:200: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[PATH_MAX];
data/libserialport-0.1.1/serialport.c:88: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(port->name, portname, len);
data/libserialport-0.1.1/serialport.c:535:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((port->fd = open(port->name, flags_local)) < 0)
data/libserialport-0.1.1/windows.c:37: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(wc_str, wc_buffer, size);
data/libserialport-0.1.1/windows.c:127: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 desc_req_buf[sizeof(USB_DESCRIPTOR_REQUEST) +
data/libserialport-0.1.1/windows.c:154: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_USB_PATH];
data/libserialport-0.1.1/windows.c:232: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 device_id[MAX_DEVICE_ID_LEN];
data/libserialport-0.1.1/windows.c:257:2:  [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(device_name, "\\\\.\\");
data/libserialport-0.1.1/windows.c:353: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 description[128];
data/libserialport-0.1.1/windows.c:366:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
		char value[8], class[16];
data/libserialport-0.1.1/windows.c:410:4:  [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 usb_path[MAX_USB_PATH] = "", tmp[MAX_USB_PATH];
data/libserialport-0.1.1/windows.c:411:4:  [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 device_id[MAX_DEVICE_ID_LEN];
data/libserialport-0.1.1/windows.c:423: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 compat_ids[512], *p = compat_ids;
data/libserialport-0.1.1/freebsd.c:101: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).
	char *t = (char *)s + strlen(s);
data/libserialport-0.1.1/freebsd.c:110:16:  [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).
	size_t slen = strlen(str);
data/libserialport-0.1.1/freebsd.c:111:16:  [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).
	size_t plen = strlen(pattern);
data/libserialport-0.1.1/freebsd.c:250:41:  [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 (!strncmp(port->name, DEV_CUA_PATH, strlen(DEV_CUA_PATH))) {
data/libserialport-0.1.1/freebsd.c:251: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).
		cua_sfx = port->name + strlen(DEV_CUA_PATH);
data/libserialport-0.1.1/linux.c:104: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).
					ptr = description + strlen(description) - 1;
data/libserialport-0.1.1/linux.c:117: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).
					ptr = manufacturer + strlen(manufacturer) - 1;
data/libserialport-0.1.1/linux.c:128:22:  [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).
					ptr = product + strlen(product) - 1;
data/libserialport-0.1.1/linux.c:139:21:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
					ptr = serial + strlen(serial) - 1;
data/libserialport-0.1.1/linux.c:148: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).
			if (port->usb_serial && strlen(port->usb_serial)) {
data/libserialport-0.1.1/linux.c:165: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).
					ptr = baddr + strlen(baddr) - 1;
data/libserialport-0.1.1/serialport.c:81: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).
	len = strlen(portname) + 1;
data/libserialport-0.1.1/serialport.c:463:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (!(escaped_port_name = malloc(strlen(port->name) + 5)))
data/libserialport-0.1.1/serialport.c:1056:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		result = read(port->fd, ptr, count - bytes_read);
data/libserialport-0.1.1/serialport.c:1193:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		result = read(port->fd, buf, count);
data/libserialport-0.1.1/serialport.c:1256:20:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if ((bytes_read = read(port->fd, buf, count)) < 0) {
data/libserialport-0.1.1/windows.c:255: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 (!(device_name = malloc(strlen("\\\\.\\") + strlen(hub_name) + 1)))
data/libserialport-0.1.1/windows.c:255:49:  [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 (!(device_name = malloc(strlen("\\\\.\\") + strlen(hub_name) + 1)))
data/libserialport-0.1.1/windows.c:432: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).
						p += strlen(p) + 1;
data/libserialport-0.1.1/windows.c:458:37:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			if (!(escaped_port_name = malloc(strlen(port->name) + 5)))

ANALYSIS SUMMARY:

Hits = 82
Lines analyzed = 4401 in approximately 0.11 seconds (38326 lines/second)
Physical Source Lines of Code (SLOC) = 3348
Hits@level = [0]  19 [1]  20 [2]  40 [3]   1 [4]  15 [5]   6
Hits@level+ = [0+] 101 [1+]  82 [2+]  62 [3+]  22 [4+]  21 [5+]   6
Hits/KSLOC@level+ = [0+] 30.1673 [1+] 24.4922 [2+] 18.5185 [3+] 6.57109 [4+] 6.2724 [5+] 1.79211
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.