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/xtrans-1.4.0/Xtransutil.c
Examining data/xtrans-1.4.0/Xtrans.h
Examining data/xtrans-1.4.0/Xtranssock.c
Examining data/xtrans-1.4.0/transport.c
Examining data/xtrans-1.4.0/Xtrans.c
Examining data/xtrans-1.4.0/Xtransint.h
Examining data/xtrans-1.4.0/Xtranslcl.c

FINAL RESULTS:

data/xtrans-1.4.0/Xtranslcl.c:400:6:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
	if( chown( slave, saved_euid, -1 ) < 0 ) {
data/xtrans-1.4.0/Xtranslcl.c:415:9:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
    if (chmod(slave, 0666) < 0) {
data/xtrans-1.4.0/Xtranslcl.c:547:9:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
    if( chmod(server_path, 0666) < 0 ) {
data/xtrans-1.4.0/Xtransutil.c:504:10:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	    if (chmod(path, mode)) {
data/xtrans-1.4.0/Xtransint.h:387: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, f, args);
data/xtrans-1.4.0/Xtranslcl.c:185:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy (sunaddr->sun_path, sun_path);
data/xtrans-1.4.0/Xtranslcl.c:211:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy (p_sunaddr->sun_path, peer_sun_path);
data/xtrans-1.4.0/Xtranslcl.c:428:12:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    (void) sprintf(&buf[1], slave);
data/xtrans-1.4.0/Xtranslcl.c:490:10:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		(void) sprintf(server_path, "%s", port);
data/xtrans-1.4.0/Xtranslcl.c:492:10:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		(void) sprintf(server_path, "%s%s", PTSNODENAME, port);
data/xtrans-1.4.0/Xtranslcl.c:495:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	(void) sprintf(server_path, "%s%d", PTSNODENAME, getpid());
data/xtrans-1.4.0/Xtranslcl.c:651:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy(sunaddr->sun_path,buf);
data/xtrans-1.4.0/Xtranslcl.c:1038:12:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    (void) sprintf(server_path, SCORNODENAME, port);
data/xtrans-1.4.0/Xtranslcl.c:1124:12:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    (void) sprintf(serverR_path, SCORNODENAME, port);
data/xtrans-1.4.0/Xtranslcl.c:1125:12:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    (void) sprintf(serverS_path, SCOSNODENAME, port);
data/xtrans-1.4.0/Xtranslcl.c:1379:12:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    (void) sprintf(serverR_path, SCORNODENAME, port);
data/xtrans-1.4.0/Xtranslcl.c:1380:12:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    (void) sprintf(serverS_path, SCOSNODENAME, port);
data/xtrans-1.4.0/Xtransutil.c:206:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
		strcpy ((char *) *addrp, hostnamebuf);
data/xtrans-1.4.0/Xtransutil.c:260:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf (networkId, "%s/%s:%s", transName,
data/xtrans-1.4.0/Xtransutil.c:290:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf (networkId, "%s/%s:%s", transName, hostnamebuf, portnumbuf);
data/xtrans-1.4.0/Xtransutil.c:410:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy (hostname, ciptr->transptr->TransName);
data/xtrans-1.4.0/Xtransutil.c:413: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 (hostname, addr);
data/xtrans-1.4.0/Xtrans.c:1139:64:  [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.
                                           xquartz_launchd_fd, getenv("DISPLAY"))))==NULL)
data/xtrans-1.4.0/Xtranslcl.c:1694:17:  [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.
	XLOCAL=(char *)getenv("XLOCAL");
data/xtrans-1.4.0/Xtrans.c:157: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 	protobuf[PROTOBUFSIZE];
data/xtrans-1.4.0/Xtrans.c:217: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	hostnamebuf[256];
data/xtrans-1.4.0/Xtrans.c:990: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(*addrp, ciptr->peeraddr, ciptr->peeraddrlen);
data/xtrans-1.4.0/Xtrans.c:1123: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		buffer[256]; /* ??? What size ?? */
data/xtrans-1.4.0/Xtrans.h:140: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.
    unsigned char	addr[XTRANS_MAX_ADDR_LEN];
data/xtrans-1.4.0/Xtranslcl.c:326: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		server_path[64];
data/xtrans-1.4.0/Xtranslcl.c:328:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char		buf[20]; /* MAX_PATH_LEN?? */
data/xtrans-1.4.0/Xtranslcl.c:356:19:  [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 ((server = open (server_path, O_RDWR)) < 0) {
data/xtrans-1.4.0/Xtranslcl.c:366:15:  [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(DEV_PTMX, O_RDWR)) < 0) {
data/xtrans-1.4.0/Xtranslcl.c:478: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 server_path[64], *slave;
data/xtrans-1.4.0/Xtranslcl.c:510: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(server_path, O_RDWR)) >= 0 ) {
data/xtrans-1.4.0/Xtranslcl.c:527: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(DEV_PTMX, O_RDWR)) < 0) {
data/xtrans-1.4.0/Xtranslcl.c:553:17:  [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( (server=open(server_path, O_RDWR)) < 0 ) {
data/xtrans-1.4.0/Xtranslcl.c:584:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char		buf[256];
data/xtrans-1.4.0/Xtranslcl.c:619:16:  [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( (newfd=open(buf,O_RDWR)) < 0 ) {
data/xtrans-1.4.0/Xtranslcl.c:639: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(newciptr->addr,ciptr->addr,newciptr->addrlen);
data/xtrans-1.4.0/Xtranslcl.c:679: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		server_path[64];
data/xtrans-1.4.0/Xtranslcl.c:702:15:  [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(server_path, O_RDWR)) < 0) {
data/xtrans-1.4.0/Xtranslcl.c:816: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		server_path[64];
data/xtrans-1.4.0/Xtranslcl.c:913: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(newciptr->addr,ciptr->addr,newciptr->addrlen);
data/xtrans-1.4.0/Xtranslcl.c:925: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(newciptr->peeraddr,newciptr->addr,newciptr->peeraddrlen);
data/xtrans-1.4.0/Xtranslcl.c:1022: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		server_path[64];
data/xtrans-1.4.0/Xtranslcl.c:1040:19:  [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 ((server = open(server_path, O_RDWR)) < 0) {
data/xtrans-1.4.0/Xtranslcl.c:1045:15:  [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(DEV_SPX, O_RDWR)) < 0) {
data/xtrans-1.4.0/Xtranslcl.c:1109: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		serverR_path[64];
data/xtrans-1.4.0/Xtranslcl.c:1110: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		serverS_path[64];
data/xtrans-1.4.0/Xtranslcl.c:1131:16:  [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 ((fds = open(DEV_SPX, O_RDWR)) < 0 ||
data/xtrans-1.4.0/Xtranslcl.c:1132: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).
	(fdr = open(DEV_SPX, O_RDWR)) < 0 ) {
data/xtrans-1.4.0/Xtranslcl.c:1156:11:  [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).
    fds = open (serverS_path, O_RDWR | O_NDELAY);
data/xtrans-1.4.0/Xtranslcl.c:1176:11:  [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).
    fdr = open (serverR_path, O_RDWR | O_NDELAY);
data/xtrans-1.4.0/Xtranslcl.c:1225:15:  [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(DEV_SPX, O_RDWR)) < 0 ) {
data/xtrans-1.4.0/Xtranslcl.c:1251: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(newciptr->addr,ciptr->addr,newciptr->addrlen);
data/xtrans-1.4.0/Xtranslcl.c:1266: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(newciptr->peeraddr,newciptr->addr,newciptr->peeraddrlen);
data/xtrans-1.4.0/Xtranslcl.c:1286: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 server_path[64];
data/xtrans-1.4.0/Xtranslcl.c:1327: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 server_path[64];
data/xtrans-1.4.0/Xtranslcl.c:1368: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 serverR_path[64], serverS_path[64];
data/xtrans-1.4.0/Xtranslcl.c:1736: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	typebuf[TYPEBUFSIZE];
data/xtrans-1.4.0/Xtranslcl.c:1780:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[256];
data/xtrans-1.4.0/Xtranslcl.c:2030: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 typebuf[TYPEBUFSIZE];
data/xtrans-1.4.0/Xtranssock.c:315: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 (ciptr->addr, socknamePtr, ciptr->addrlen);
data/xtrans-1.4.0/Xtranssock.c:377: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 (ciptr->peeraddr, socknamePtr, ciptr->peeraddrlen);
data/xtrans-1.4.0/Xtranssock.c:526: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(ciptr->peeraddr, ciptr->addr, addrlen);
data/xtrans-1.4.0/Xtranssock.c:834: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	portbuf[PORTBUFSIZE];
data/xtrans-1.4.0/Xtranssock.c:953: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		tmpport[108];
data/xtrans-1.4.0/Xtranssock.c:1041: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 (ciptr->addr, &sockname, ciptr->addrlen);
data/xtrans-1.4.0/Xtranssock.c:1256: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 (newciptr->addr, ciptr->addr, newciptr->addrlen);
data/xtrans-1.4.0/Xtranssock.c:1270: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 (newciptr->peeraddr, ciptr->addr, newciptr->addrlen);
data/xtrans-1.4.0/Xtranssock.c:1292: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 		port[PORTBUFSIZE];
data/xtrans-1.4.0/Xtranssock.c:1293: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 		host[MAXHOSTNAMELEN];
data/xtrans-1.4.0/Xtranssock.c:1309: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		ntopbuf[INET6_ADDRSTRLEN];
data/xtrans-1.4.0/Xtranssock.c:1322: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	portbuf[PORTBUFSIZE];
data/xtrans-1.4.0/Xtranssock.c:1325: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 		hostnamebuf[256];		/* tmp space */
data/xtrans-1.4.0/Xtranssock.c:1537: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 ((char *) &sockname.sin_addr, (char *) hostp->h_addr,
data/xtrans-1.4.0/Xtranssock.c:1686: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 hostnamebuf[256];
data/xtrans-1.4.0/Xtranssock.c:1748: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 specified_local_addr_list[10][4];
data/xtrans-1.4.0/Xtranssock.c:1957: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 (ciptr->addr, &sockname, ciptr->addrlen);
data/xtrans-1.4.0/Xtranssock.c:1958: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 (ciptr->peeraddr, &sockname, ciptr->peeraddrlen);
data/xtrans-1.4.0/Xtranssock.c:2087: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[CMSG_SPACE(MAX_FDS * sizeof(int))];
data/xtrans-1.4.0/Xtransutil.c:110: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 (&saddr, *addrp, sizeof (struct sockaddr_in));
data/xtrans-1.4.0/Xtransutil.c:121: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(*addrp,&saddr.sin_addr,len);
data/xtrans-1.4.0/Xtransutil.c:131: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 (&saddr6, *addrp, sizeof (struct sockaddr_in6));
data/xtrans-1.4.0/Xtransutil.c:149: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(*addrp,cp,*addrlenp);
data/xtrans-1.4.0/Xtransutil.c:156: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(*addrp,&saddr6.sin6_addr,sizeof(saddr6.sin6_addr));
data/xtrans-1.4.0/Xtransutil.c:194: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 hostnamebuf[256];
data/xtrans-1.4.0/Xtransutil.c:243: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	hostnamebuf[256];
data/xtrans-1.4.0/Xtransutil.c:277: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 portnumbuf[10];
data/xtrans-1.4.0/Xtransutil.c:326: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	addrbuf[256];
data/xtrans-1.4.0/Xtransutil.c:572: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(path, O_RDONLY)) != -1) {
data/xtrans-1.4.0/Xtrans.c:169:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy (protobuf, protocol, PROTOBUFSIZE - 1);
data/xtrans-1.4.0/Xtrans.c:268: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(_protocol) == 0)
data/xtrans-1.4.0/Xtrans.c:296: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).
    _host_len = strlen(_host);
data/xtrans-1.4.0/Xtrans.c:345: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).
    if(address != NULL && strlen(address)>8 && (!strncmp(address,"local//",7))) {
data/xtrans-1.4.0/Xtrans.c:1341: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 (name.nodename);
data/xtrans-1.4.0/Xtrans.c:1343:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy (buf, name.nodename, len);
data/xtrans-1.4.0/Xtrans.c:1349: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(buf);
data/xtrans-1.4.0/Xtranslcl.c:180: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).
    if (strlen(sun_path) > sizeof(sunaddr->sun_path) - 1) {
data/xtrans-1.4.0/Xtranslcl.c:187: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).
    sunaddr->sun_len = strlen (sunaddr->sun_path);
data/xtrans-1.4.0/Xtranslcl.c:206: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).
    if (strlen(peer_sun_path) > sizeof(p_sunaddr->sun_path) - 1) {
data/xtrans-1.4.0/Xtranslcl.c:213: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).
    p_sunaddr->sun_len = strlen (p_sunaddr->sun_path);
data/xtrans-1.4.0/Xtranslcl.c:426:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    namelen = strlen(slave);
data/xtrans-1.4.0/Xtranslcl.c:439:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ret = read(fd, buf, 1);
data/xtrans-1.4.0/Xtranslcl.c:589:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if( (in=read(ciptr->fd,&length,1)) <= 0 ){
data/xtrans-1.4.0/Xtranslcl.c:603:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if( (in=read(ciptr->fd,buf,length)) <= 0 ){
data/xtrans-1.4.0/Xtranslcl.c:653: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).
    sunaddr->sun_len=strlen(sunaddr->sun_path);
data/xtrans-1.4.0/Xtranslcl.c:976:16:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    oldUmask = umask(0);
data/xtrans-1.4.0/Xtranslcl.c:981:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    umask(oldUmask);
data/xtrans-1.4.0/Xtranslcl.c:1219:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(ciptr->fd, &c, 1) < 0) {
data/xtrans-1.4.0/Xtranslcl.c:1741:6:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	    strncpy(typebuf,typetocheck,TYPEBUFSIZE);
data/xtrans-1.4.0/Xtranslcl.c:2037:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(typebuf, typetocheck, TYPEBUFSIZE);
data/xtrans-1.4.0/Xtranslcl.c:2201:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    return read(ciptr->fd,buf,size);
data/xtrans-1.4.0/Xtranssock.c:475:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    portlen = strlen(port) + 1; // include space for trailing null
data/xtrans-1.4.0/Xtranssock.c:523:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(addr->sa_data, port, portlen);
data/xtrans-1.4.0/Xtranssock.c:730: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).
    if (strlen(port) + strlen(upath) > maxlen)
data/xtrans-1.4.0/Xtranssock.c:730:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (strlen(port) + strlen(upath) > maxlen)
data/xtrans-1.4.0/Xtranssock.c:965:16:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    oldUmask = umask (0);
data/xtrans-1.4.0/Xtranssock.c:976:9:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	(void) umask (oldUmask);
data/xtrans-1.4.0/Xtranssock.c:994: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).
    sockname.sun_len = strlen(sockname.sun_path);
data/xtrans-1.4.0/Xtranssock.c:1000:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    namelen = strlen(sockname.sun_path) + offsetof(struct sockaddr_un, sun_path);
data/xtrans-1.4.0/Xtranssock.c:1005:57:  [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).
	namelen = offsetof(struct sockaddr_un, sun_path) + 1 + strlen(&sockname.sun_path[1]);
data/xtrans-1.4.0/Xtranssock.c:1015:9:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	(void) umask (oldUmask);
data/xtrans-1.4.0/Xtranssock.c:1032:9:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	(void) umask (oldUmask);
data/xtrans-1.4.0/Xtranssock.c:1043:12:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    (void) umask (oldUmask);
data/xtrans-1.4.0/Xtranssock.c:1078:17:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	int oldUmask = umask (0);
data/xtrans-1.4.0/Xtranssock.c:1089:13:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	    (void) umask (oldUmask);
data/xtrans-1.4.0/Xtranssock.c:1100:13:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	    (void) umask (oldUmask);
data/xtrans-1.4.0/Xtranssock.c:1115:13:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	    (void) umask (oldUmask);
data/xtrans-1.4.0/Xtranssock.c:1119:2:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	umask (oldUmask);
data/xtrans-1.4.0/Xtranssock.c:1368:6:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	    strncpy(addrlist->port, port, sizeof(addrlist->port));
data/xtrans-1.4.0/Xtranssock.c:1370:6:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	    strncpy(addrlist->host, host, sizeof(addrlist->host));
data/xtrans-1.4.0/Xtranssock.c:1868: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).
    sockname.sun_len = strlen (sockname.sun_path);
data/xtrans-1.4.0/Xtranssock.c:1874:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    namelen = strlen (sockname.sun_path) + offsetof(struct sockaddr_un, sun_path);
data/xtrans-1.4.0/Xtranssock.c:2141:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    return read(ciptr->fd, buf, size);
data/xtrans-1.4.0/Xtransutil.c:258: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).
	networkId = malloc (3 + strlen (transName) +
data/xtrans-1.4.0/Xtransutil.c:259: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).
	    strlen (hostnamebuf) + strlen (saddr->sun_path));
data/xtrans-1.4.0/Xtransutil.c:259: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).
	    strlen (hostnamebuf) + strlen (saddr->sun_path));
data/xtrans-1.4.0/Xtransutil.c:288: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).
	networkId = malloc (3 + strlen (transName) +
data/xtrans-1.4.0/Xtransutil.c:289: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).
	    strlen (hostnamebuf) + strlen (portnumbuf));
data/xtrans-1.4.0/Xtransutil.c:289: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).
	    strlen (hostnamebuf) + strlen (portnumbuf));
data/xtrans-1.4.0/Xtransutil.c:409: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).
    hostname = malloc (strlen (ciptr->transptr->TransName) + strlen (addr) + 2);
data/xtrans-1.4.0/Xtransutil.c:409:62:  [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).
    hostname = malloc (strlen (ciptr->transptr->TransName) + strlen (addr) + 2);
data/xtrans-1.4.0/Xtransutil.c:411:5:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
    strcat (hostname, "/");
data/xtrans-1.4.0/Xtransutil.c:442: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).
    for (i = 0; i < (int) strlen (str); i++)

ANALYSIS SUMMARY:

Hits = 146
Lines analyzed = 7985 in approximately 0.18 seconds (44921 lines/second)
Physical Source Lines of Code (SLOC) = 5522
Hits@level = [0]  27 [1]  54 [2]  68 [3]   2 [4]  18 [5]   4
Hits@level+ = [0+] 173 [1+] 146 [2+]  92 [3+]  24 [4+]  22 [5+]   4
Hits/KSLOC@level+ = [0+] 31.3292 [1+] 26.4397 [2+] 16.6606 [3+] 4.34625 [4+] 3.98406 [5+] 0.724375
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.