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/rdesktop-1.9.0/asn.c Examining data/rdesktop-1.9.0/bitmap.c Examining data/rdesktop-1.9.0/cache.c Examining data/rdesktop-1.9.0/channels.c Examining data/rdesktop-1.9.0/cliprdr.c Examining data/rdesktop-1.9.0/cssp.c Examining data/rdesktop-1.9.0/ctrl.c Examining data/rdesktop-1.9.0/disk.c Examining data/rdesktop-1.9.0/dvc.c Examining data/rdesktop-1.9.0/ewmhints.c Examining data/rdesktop-1.9.0/iso.c Examining data/rdesktop-1.9.0/licence.c Examining data/rdesktop-1.9.0/lspci.c Examining data/rdesktop-1.9.0/mcs.c Examining data/rdesktop-1.9.0/mppc.c Examining data/rdesktop-1.9.0/orders.c Examining data/rdesktop-1.9.0/parallel.c Examining data/rdesktop-1.9.0/pkix_asn1_tab.c Examining data/rdesktop-1.9.0/printer.c Examining data/rdesktop-1.9.0/printercache.c Examining data/rdesktop-1.9.0/pstcache.c Examining data/rdesktop-1.9.0/rdesktop.c Examining data/rdesktop-1.9.0/rdp5.c Examining data/rdesktop-1.9.0/rdp.c Examining data/rdesktop-1.9.0/rdpdr.c Examining data/rdesktop-1.9.0/rdpedisp.c Examining data/rdesktop-1.9.0/rdpsnd_alsa.c Examining data/rdesktop-1.9.0/rdpsnd.c Examining data/rdesktop-1.9.0/rdpsnd_dsp.c Examining data/rdesktop-1.9.0/rdpsnd_libao.c Examining data/rdesktop-1.9.0/rdpsnd_oss.c Examining data/rdesktop-1.9.0/rdpsnd_pulse.c Examining data/rdesktop-1.9.0/rdpsnd_sgi.c Examining data/rdesktop-1.9.0/rdpsnd_sun.c Examining data/rdesktop-1.9.0/scard.c Examining data/rdesktop-1.9.0/seamless.c Examining data/rdesktop-1.9.0/secure.c Examining data/rdesktop-1.9.0/serial.c Examining data/rdesktop-1.9.0/stream.c Examining data/rdesktop-1.9.0/tcp.c Examining data/rdesktop-1.9.0/utils.c Examining data/rdesktop-1.9.0/xclip.c Examining data/rdesktop-1.9.0/xkeymap.c Examining data/rdesktop-1.9.0/xwin.c Examining data/rdesktop-1.9.0/asn.h Examining data/rdesktop-1.9.0/constants.h Examining data/rdesktop-1.9.0/disk.h Examining data/rdesktop-1.9.0/orders.h Examining data/rdesktop-1.9.0/proto.h Examining data/rdesktop-1.9.0/rdesktop.h Examining data/rdesktop-1.9.0/rdpsnd_dsp.h Examining data/rdesktop-1.9.0/rdpsnd.h Examining data/rdesktop-1.9.0/scancodes.h Examining data/rdesktop-1.9.0/scard.h Examining data/rdesktop-1.9.0/seamless.h Examining data/rdesktop-1.9.0/ssl.h Examining data/rdesktop-1.9.0/stream.h Examining data/rdesktop-1.9.0/types.h Examining data/rdesktop-1.9.0/utils.h Examining data/rdesktop-1.9.0/xproto.h Examining data/rdesktop-1.9.0/ssl.c FINAL RESULTS: data/rdesktop-1.9.0/xkeymap.c:330: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(result, b, PATH_MAX); data/rdesktop-1.9.0/ctrl.c:196:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(saun.sun_path, ctrlsock_name); data/rdesktop-1.9.0/ctrl.c:275:2: [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(path, PATH_MAX, "%s" RDESKTOP_CTRLSOCK_STORE, home); data/rdesktop-1.9.0/ctrl.c:472:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(saun.sun_path, ctrlsock_name); data/rdesktop-1.9.0/disk.c:336: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(g_rdpdr_device[*id].local_path, pos2); data/rdesktop-1.9.0/disk.c:370:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "%s%s", g_rdpdr_device[device_id].local_path, filename ? filename : ""); data/rdesktop-1.9.0/disk.c:854:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fullpath, "%s%s", g_rdpdr_device[pfinfo->device_id].local_path, data/rdesktop-1.9.0/disk.c:1046:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fullname, "%s/%s", pfinfo->path, dp->d_name); data/rdesktop-1.9.0/disk.c:1084: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(info.type, e->mnt_type); data/rdesktop-1.9.0/disk.c:1085: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(info.name, e->mnt_fsname); data/rdesktop-1.9.0/disk.c:1253:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fullpath, "%s/%s", dirname, pdirent->d_name); data/rdesktop-1.9.0/parallel.c:57: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(g_rdpdr_device[*id].name, optarg); data/rdesktop-1.9.0/parallel.c:62: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(g_rdpdr_device[*id].local_path, pos2); data/rdesktop-1.9.0/parallel.c:78:42: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. parallel_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition, data/rdesktop-1.9.0/parallel.c:81:9: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. UNUSED(access); data/rdesktop-1.9.0/printer.c:65:3: [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(g_rdpdr_device[*id].name, l_to_a(already + count + 1, 10)); data/rdesktop-1.9.0/printer.c:79: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(pprinter_data->printer, optarg); data/rdesktop-1.9.0/printer.c:87: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(pprinter_data->driver, pos2); data/rdesktop-1.9.0/printer.c:103:41: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. printer_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition, uint32 flags, data/rdesktop-1.9.0/printer.c:106:9: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. UNUSED(access); data/rdesktop-1.9.0/printer.c:119:31: [4] (shell) popen: 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. pprinter_data->printer_fp = popen("lpr", "w"); data/rdesktop-1.9.0/printer.c:123:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "lpr -P %s", pprinter_data->printer); data/rdesktop-1.9.0/printer.c:124:31: [4] (shell) popen: 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. pprinter_data->printer_fp = popen(cmd, "w"); data/rdesktop-1.9.0/printercache.c:47:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "%s/.rdesktop", base); data/rdesktop-1.9.0/printercache.c:64: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(path, printer); data/rdesktop-1.9.0/printercache.c:92:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "%s/.rdesktop/rdpdr/%s/AutoPrinterCacheData", home, printer); data/rdesktop-1.9.0/printercache.c:100:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "%s/.rdesktop/rdpdr/%s", home, printer); data/rdesktop-1.9.0/printercache.c:137:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(printer_path, "%s/.rdesktop/rdpdr/%s", home, printer); data/rdesktop-1.9.0/printercache.c:138:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(new_printer_path, "%s/.rdesktop/rdpdr/%s", home, new_printer); data/rdesktop-1.9.0/printercache.c:175:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "%s/.rdesktop/rdpdr/%s/AutoPrinterCacheData", home, printer_name); data/rdesktop-1.9.0/printercache.c:215:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "%s/.rdesktop/rdpdr/%s/AutoPrinterCacheData", home, printer_name); data/rdesktop-1.9.0/rdesktop.c:838: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(g_username, optarg); data/rdesktop-1.9.0/rdesktop.c:1086: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(g_rdpdr_clientname, optarg + 11); data/rdesktop-1.9.0/rdesktop.c:1358: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(g_username, g_redirect_username); data/rdesktop-1.9.0/rdesktop.c:1862:3: [4] (shell) execvp: 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. execvp(argv[0], argv); data/rdesktop-1.9.0/rdesktop.c:1913:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(head, tail); data/rdesktop-1.9.0/rdesktop.c:1970:2: [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(path, PATH_MAX, "%s" RDESKTOP_LICENSE_STORE, home); data/rdesktop-1.9.0/rdesktop.c:2087:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(bmpcache_dir, "%s/%s", home, ".rdesktop"); data/rdesktop-1.9.0/rdesktop.c:2095:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(bmpcache_dir, "%s/%s", home, ".rdesktop/cache"); data/rdesktop-1.9.0/rdesktop.c:2117:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fn, "%s/.rdesktop/%s", home, filename); data/rdesktop-1.9.0/scard.c:598:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(*destination, reader); data/rdesktop-1.9.0/seamless.c:428:9: [4] (format) vsnprintf: 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. len += vsnprintf(buf + len, sizeof(buf) - len - 1, format, argp); data/rdesktop-1.9.0/serial.c:530: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(g_rdpdr_device[*id].name, optarg); data/rdesktop-1.9.0/serial.c:535: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(g_rdpdr_device[*id].local_path, pos2); data/rdesktop-1.9.0/serial.c:552:40: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. serial_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposition, data/rdesktop-1.9.0/serial.c:555:9: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. UNUSED(access); data/rdesktop-1.9.0/utils.c:169:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(bp, path); data/rdesktop-1.9.0/utils.c:180:3: [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(pt, ptok); data/rdesktop-1.9.0/utils.c:397:2: [4] (format) vsnprintf: 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. vsnprintf(buf, sizeof(buf), format, ap); data/rdesktop-1.9.0/utils.c:505:3: [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(out, hex); data/rdesktop-1.9.0/utils.c:1011:3: [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(message, sizeof(message), data/rdesktop-1.9.0/utils.c:1029:3: [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(message, sizeof(message), data/rdesktop-1.9.0/ctrl.c:263: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. home = getenv("HOME"); data/rdesktop-1.9.0/printercache.c:85: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. home = getenv("HOME"); data/rdesktop-1.9.0/printercache.c:125: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. home = getenv("HOME"); data/rdesktop-1.9.0/printercache.c:169: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. home = getenv("HOME"); data/rdesktop-1.9.0/printercache.c:206: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. home = getenv("HOME"); data/rdesktop-1.9.0/proto.h:128:30: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. void generate_random(uint8 * random); data/rdesktop-1.9.0/rdesktop.c:792:22: [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. logger_set_subjects(getenv("RDESKTOP_DEBUG")); data/rdesktop-1.9.0/rdesktop.c:822:14: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt(argc, argv, data/rdesktop-1.9.0/rdesktop.c:1548:25: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. generate_random(uint8 * random) data/rdesktop-1.9.0/rdesktop.c:1560:16: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. n = read(fd, random, 32); data/rdesktop-1.9.0/rdesktop.c:1568:26: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. if (generate_random_egd(random)) data/rdesktop-1.9.0/rdesktop.c:1573:17: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. r = (uint32 *) random; data/rdesktop-1.9.0/rdesktop.c:1585:25: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. rdssl_md5_update(&md5, random, 16); data/rdesktop-1.9.0/rdesktop.c:1586:24: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. rdssl_md5_final(&md5, random); data/rdesktop-1.9.0/rdesktop.c:1925: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. home = getenv("HOME"); data/rdesktop-1.9.0/rdesktop.c:1966: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. home = getenv("HOME"); data/rdesktop-1.9.0/rdesktop.c:2035: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. home = getenv("HOME"); data/rdesktop-1.9.0/rdesktop.c:2082: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. home = getenv("HOME"); data/rdesktop-1.9.0/rdesktop.c:2114: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. home = getenv("HOME"); data/rdesktop-1.9.0/rdpsnd_oss.c:107:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. preload = getenv("LD_PRELOAD"); data/rdesktop-1.9.0/rdpsnd_oss.c:535:13: [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. dsp_dev = getenv("AUDIODEV"); data/rdesktop-1.9.0/rdpsnd_sun.c:540:13: [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. dsp_dev = getenv("AUDIODEV"); data/rdesktop-1.9.0/utils.c:896: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. home = getenv("HOME"); data/rdesktop-1.9.0/xkeymap.c:344: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. home = getenv("HOME"); data/rdesktop-1.9.0/asn.c:34:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char errstr[MAX_ERROR_DESCRIPTION_SIZE]; data/rdesktop-1.9.0/asn.c:320: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((void *)m->data, newbuf, m->size); data/rdesktop-1.9.0/asn.c:340: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((void *)e->data, newbuf, e->size); data/rdesktop-1.9.0/cache.c:348: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(text->data, data, length); data/rdesktop-1.9.0/cache.c:387:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&g_deskcache[offset], data, cx); data/rdesktop-1.9.0/cache.c:471: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(bd, brush_data, sizeof(BRUSHDATA)); data/rdesktop-1.9.0/cliprdr.c:94: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(last_formats, formats_data, formats_data_length); data/rdesktop-1.9.0/ctrl.c:43:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. extern char g_codepage[16]; data/rdesktop-1.9.0/ctrl.c:47:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char ctrlsock_name[PATH_MAX]; data/rdesktop-1.9.0/ctrl.c:56: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 linebuf[CTRL_LINEBUF_SIZE]; data/rdesktop-1.9.0/ctrl.c:136: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[64] = { 0 }; data/rdesktop-1.9.0/ctrl.c:256: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 hash[41], path[PATH_MAX]; data/rdesktop-1.9.0/ctrl.c:456: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 data[CTRL_LINEBUF_SIZE], tmp[CTRL_LINEBUF_SIZE]; data/rdesktop-1.9.0/ctrl.c:457: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 result[CTRL_RESULT_SIZE], c, *escaped; data/rdesktop-1.9.0/disk.c:152: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/rdesktop-1.9.0/disk.c:153: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 label[PATH_MAX]; data/rdesktop-1.9.0/disk.c:155: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 type[PATH_MAX]; data/rdesktop-1.9.0/disk.c:273:8: [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). ret = open(pathname, flags, mode); data/rdesktop-1.9.0/disk.c:308:10: [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(pathname, flags & ~O_EXCL, mode); data/rdesktop-1.9.0/disk.c:356: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/rdesktop-1.9.0/disk.c:746: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 *newname, fullpath[PATH_MAX]; data/rdesktop-1.9.0/disk.c:975: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(&pfinfo->notify, ¬ify, sizeof(NOTIFY)); data/rdesktop-1.9.0/disk.c:1072: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(info.label, "RDESKTOP"); data/rdesktop-1.9.0/disk.c:1073: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(info.type, "RDPFS"); data/rdesktop-1.9.0/disk.c:1088: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). int fd = open(e->mnt_fsname, O_RDONLY); data/rdesktop-1.9.0/disk.c:1091:15: [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 buf[512]; data/rdesktop-1.9.0/disk.c:1096:7: [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(info.type, "vfat"); data/rdesktop-1.9.0/disk.c:1120: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(info.label, "RDESKTOP"); data/rdesktop-1.9.0/disk.c:1121: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(info.type, "RDPFS"); data/rdesktop-1.9.0/disk.c:1215: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 *dirname, fullpath[PATH_MAX]; data/rdesktop-1.9.0/dvc.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[512]; data/rdesktop-1.9.0/ewmhints.c:467:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(new_set, cur_set, nitems * sizeof(unsigned long)); data/rdesktop-1.9.0/ewmhints.c:531: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(new_set, cur_set, i * sizeof(unsigned long)); data/rdesktop-1.9.0/ewmhints.c:533: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(new_set + i, cur_set + i + icon_size, data/rdesktop-1.9.0/iso.c:221:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char msg[256]; data/rdesktop-1.9.0/iso.c:223:1: [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(msg, "CredSSP required by server"); data/rdesktop-1.9.0/iso.c:227:5: [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(msg, " (check if server has disabled old TLS versions, if yes use -V option)"); data/rdesktop-1.9.0/licence.c:27:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. extern char g_hostname[16]; data/rdesktop-1.9.0/licence.c:48: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(g_licence_sign_key, key_block, 16); data/rdesktop-1.9.0/licence.c:257: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(out_token, in_token, LICENCE_TOKEN_SIZE); data/rdesktop-1.9.0/licence.c:265: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(sealed_buffer, decrypt_token, LICENCE_TOKEN_SIZE); data/rdesktop-1.9.0/licence.c:266: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(sealed_buffer + LICENCE_TOKEN_SIZE, hwid, LICENCE_HWID_SIZE); data/rdesktop-1.9.0/lspci.c:49: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[1024]; data/rdesktop-1.9.0/lspci.c:114: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 *lspci_command[5] = { "lspci", "-m", "-n", "-v", NULL }; data/rdesktop-1.9.0/orders.c:153: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(out_brush, in_brush, sizeof(BRUSH)); data/rdesktop-1.9.0/orders.c:922: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(&inverted[(height - y - 1) * (width * Bpp)], &data[y * (width * Bpp)], data/rdesktop-1.9.0/orders.c:1050:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&bmpdata[(height - y - 1) * (width * Bpp)], data/rdesktop-1.9.0/parallel.c:88: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). parallel_fd = open(g_rdpdr_device[device_id].local_path, O_RDWR); data/rdesktop-1.9.0/printer.c:64:3: [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(g_rdpdr_device[*id].name, "PRN"); data/rdesktop-1.9.0/printer.c:111: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 cmd[256]; data/rdesktop-1.9.0/printercache.c:55:2: [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(path, "/rdpdr"); data/rdesktop-1.9.0/printercache.c:177:7: [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). fd = open(path, O_RDONLY); data/rdesktop-1.9.0/printercache.c:217:7: [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). fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0600); data/rdesktop-1.9.0/printercache.c:240: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 device_name[9], *printer, *driver; data/rdesktop-1.9.0/pstcache.c:92: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(cellhdr.key, key, sizeof(HASH_KEY)); data/rdesktop-1.9.0/pstcache.c:133:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(keylist[idx], cellhdr.key, sizeof(HASH_KEY)); data/rdesktop-1.9.0/pstcache.c:167: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 filename[256]; data/rdesktop-1.9.0/pstcache.c:185:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(filename, "cache/pstcache_%d_%d", cache_id, g_pstcache_Bpp); data/rdesktop-1.9.0/rdesktop.c:62:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char g_title[64] = ""; data/rdesktop-1.9.0/rdesktop.c:64:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char g_password[64] = ""; data/rdesktop-1.9.0/rdesktop.c:65:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char g_hostname[16] = ""; data/rdesktop-1.9.0/rdesktop.c:66:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char g_keymapname[PATH_MAX] = ""; data/rdesktop-1.9.0/rdesktop.c:115:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char g_seamless_shell[512]; data/rdesktop-1.9.0/rdesktop.c:116:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char g_seamless_spawn_cmd[512]; data/rdesktop-1.9.0/rdesktop.c:117:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char g_tls_version[4]; data/rdesktop-1.9.0/rdesktop.c:139:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char g_reconnect_random[16]; data/rdesktop-1.9.0/rdesktop.c:152:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char g_codepage[16] = ""; data/rdesktop-1.9.0/rdesktop.c:774: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 server[256]; data/rdesktop-1.9.0/rdesktop.c:775: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 fullhostname[64]; data/rdesktop-1.9.0/rdesktop.c:776: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 domain[256]; data/rdesktop-1.9.0/rdesktop.c:777: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 shell[256]; data/rdesktop-1.9.0/rdesktop.c:778: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 directory[256]; data/rdesktop-1.9.0/rdesktop.c:1304:3: [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(g_title, "rdesktop - "); data/rdesktop-1.9.0/rdesktop.c:1522: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(addr.sun_path, EGD_SOCKET, sizeof(EGD_SOCKET)); data/rdesktop-1.9.0/rdesktop.c:1557: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/urandom", O_RDONLY)) != -1) data/rdesktop-1.9.0/rdesktop.c:1558: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). || ((fd = open("/dev/random", O_RDONLY)) != -1)) data/rdesktop-1.9.0/rdesktop.c:1836: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 output[256]; data/rdesktop-1.9.0/rdesktop.c:1887: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 ret[LTOA_BUFSIZE]; data/rdesktop-1.9.0/rdesktop.c:1921: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 *home, path[PATH_MAX], hash[41]; data/rdesktop-1.9.0/rdesktop.c:1937:7: [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). fd = open(path, O_RDONLY); data/rdesktop-1.9.0/rdesktop.c:1943: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/rdesktop-1.9.0/rdesktop.c:1963: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 *home, path[PATH_MAX], tmppath[PATH_MAX], hash[41]; data/rdesktop-1.9.0/rdesktop.c:1991:7: [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). fd = open(tmppath, O_WRONLY | O_CREAT | O_TRUNC, 0600); data/rdesktop-1.9.0/rdesktop.c:2033: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 certcache_dir[PATH_MAX]; data/rdesktop-1.9.0/rdesktop.c:2080: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 bmpcache_dir[256]; data/rdesktop-1.9.0/rdesktop.c:2111: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 fn[256]; data/rdesktop-1.9.0/rdesktop.c:2118:7: [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). fd = open(fn, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); data/rdesktop-1.9.0/rdp.c:37:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. extern char g_password[64]; data/rdesktop-1.9.0/rdp.c:38:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. extern char g_codepage[16]; data/rdesktop-1.9.0/rdp.c:87:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. extern char g_reconnect_random[16]; data/rdesktop-1.9.0/rdpdr.c:61:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. extern char g_hostname[16]; data/rdesktop-1.9.0/rdpsnd_alsa.c:487: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 buffer[32768]; data/rdesktop-1.9.0/rdpsnd_dsp.c:216: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(tmpdata + (i * samplewidth), data/rdesktop-1.9.0/rdpsnd_dsp.c:221: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(tmpdata + (i * samplewidth), data/rdesktop-1.9.0/rdpsnd_dsp.c:329: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(&cval1, data/rdesktop-1.9.0/rdpsnd_dsp.c:332: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(&cval2, data/rdesktop-1.9.0/rdpsnd_dsp.c:338: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(data + (i * resample_to_channels * samplewidth) + data/rdesktop-1.9.0/rdpsnd_dsp.c:347: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(&sval1, data/rdesktop-1.9.0/rdpsnd_dsp.c:350: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(&sval2, data/rdesktop-1.9.0/rdpsnd_dsp.c:356: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(data + (i * resample_to_channels * samplewidth) + data/rdesktop-1.9.0/rdpsnd_dsp.c:363:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out + (i * resample_to_channels * samplewidth) + (samplewidth * j), data/rdesktop-1.9.0/rdpsnd_oss.c:176: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). dsp_fd = open(dsp_dev, dsp_mode | O_NONBLOCK); data/rdesktop-1.9.0/rdpsnd_oss.c:479: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 buffer[32768]; data/rdesktop-1.9.0/rdpsnd_pulse.c:1357: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(capture_buf, pulse_buf, audio_size); data/rdesktop-1.9.0/rdpsnd_sun.c:146: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). dsp_fd = open(dsp_dev, O_RDWR | O_NONBLOCK); data/rdesktop-1.9.0/rdpsnd_sun.c:163:12: [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). dsp_fd = open(dsp_dev, dsp_mode | O_NONBLOCK); data/rdesktop-1.9.0/rdpsnd_sun.c:469: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 buffer[32768]; data/rdesktop-1.9.0/scard.c:1136: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(dstIter->rgbAtr, srcIter->rgbAtr, MAX_ATR_SIZE * sizeof(unsigned char)); data/rdesktop-1.9.0/scard.c:1155: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(dstIter->rgbAtr, srcIter->rgbAtr, MAX_ATR_SIZE * sizeof(unsigned char)); data/rdesktop-1.9.0/scard.c:1375: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(ResArray, rsArray, readerCount * sizeof(SERVER_SCARD_READERSTATE_A)); data/rdesktop-1.9.0/scard.c:1410: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(ResArray + j, rsCur, sizeof(SCARD_READERSTATE)); data/rdesktop-1.9.0/scard.c:1515: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(dstBytes, srcBytes, bytesToCopy); data/rdesktop-1.9.0/scard.c:1528: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(dstBytes, srcBytes, bytesToCopy); data/rdesktop-1.9.0/scard.c:1581: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(tmp, pioSendPci, sizeof(SERVER_SCARD_IO_REQUEST)); data/rdesktop-1.9.0/scard.c:1625:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tmp, pioRecvPci, sizeof(SERVER_SCARD_IO_REQUEST)); data/rdesktop-1.9.0/scard.c:2495:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(d->data, s->data, (size_t) (s->end) - (size_t) (s->data)); data/rdesktop-1.9.0/scard.c:2497:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(d->data, s->data, (size_t) (s->p) - (size_t) (s->data)); data/rdesktop-1.9.0/scard.h:63:11: [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 rgbAtr[36]; data/rdesktop-1.9.0/scard.h:135:11: [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 rgbAtr[36]; data/rdesktop-1.9.0/scard.h:136:11: [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 rgbMask[36]; data/rdesktop-1.9.0/scard.h:141: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 alias[128]; data/rdesktop-1.9.0/scard.h:142: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[128]; data/rdesktop-1.9.0/scard.h:143: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 vendor[128]; data/rdesktop-1.9.0/seamless.c:30:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char icon_buf[1024]; data/rdesktop-1.9.0/seamless.c:137: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 byte[3]; data/rdesktop-1.9.0/seamless.c:421: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 *escaped, buf[1025]; data/rdesktop-1.9.0/secure.c:25:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. extern char g_hostname[16]; data/rdesktop-1.9.0/secure.c:139:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(out, "%.2x", in[k]); data/rdesktop-1.9.0/secure.c:161: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(pre_master_secret, client_random, 24); data/rdesktop-1.9.0/secure.c:162: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(pre_master_secret + 24, server_random, 24); data/rdesktop-1.9.0/secure.c:169: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(g_sec_sign_key, key_block, 16); data/rdesktop-1.9.0/secure.c:192: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(g_sec_decrypt_update_key, g_sec_decrypt_key, 16); data/rdesktop-1.9.0/secure.c:193: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(g_sec_encrypt_update_key, g_sec_encrypt_key, 16); data/rdesktop-1.9.0/secure.c:249: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(signature, md5sig, siglen); data/rdesktop-1.9.0/serial.c:565: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). serial_fd = open(g_rdpdr_device[device_id].local_path, O_RDWR | O_NOCTTY | O_NONBLOCK); data/rdesktop-1.9.0/ssl.c:179: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 oid[64]; data/rdesktop-1.9.0/stream.c:26:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. extern char g_codepage[16]; data/rdesktop-1.9.0/stream.h:149:46: [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 in_uint8a(s,v,n) { s_assert_r(s, n); memcpy(v,(s)->p,n); (s)->p += n; } data/rdesktop-1.9.0/stream.h:157:47: [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 out_uint8a(s,v,n) { s_assert_w(s, n); memcpy((s)->p,v,n); (s)->p += n; } data/rdesktop-1.9.0/tcp.c:554: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[NI_MAXHOST]; data/rdesktop-1.9.0/tcp.c:561: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 tcp_port_rdp_s[10]; data/rdesktop-1.9.0/tcp.c:630: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(g_server_address, addr, sizeof(struct addrinfo)); data/rdesktop-1.9.0/tcp.c:633: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(g_server_address->ai_addr, addr->ai_addr, addr->ai_addrlen); data/rdesktop-1.9.0/tcp.c:735: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 ipaddr[32]; data/rdesktop-1.9.0/tcp.c:741:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(ipaddr, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); data/rdesktop-1.9.0/tcp.c:744:3: [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(ipaddr, "127.0.0.1"); data/rdesktop-1.9.0/types.h:169: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[8]; data/rdesktop-1.9.0/types.h:235: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[8]; data/rdesktop-1.9.0/types.h:243: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/rdesktop-1.9.0/types.h:304: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/rdesktop-1.9.0/types.h:307: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 pattern[PATH_MAX]; data/rdesktop-1.9.0/utils.c:32:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. extern char g_codepage[16]; data/rdesktop-1.9.0/utils.c:55: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 *pe, *e, esc[4]; data/rdesktop-1.9.0/utils.c:80:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(pe, esc, 3); data/rdesktop-1.9.0/utils.c:102: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(ns, str, strlen(str) + 1); data/rdesktop-1.9.0/utils.c:153: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 pt[PATH_MAX]; data/rdesktop-1.9.0/utils.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 bp[PATH_MAX]; data/rdesktop-1.9.0/utils.c:236: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(dest, src, strlen(src) + 1); data/rdesktop-1.9.0/utils.c:290: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 response[512]; data/rdesktop-1.9.0/utils.c:291:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *choices[MAX_CHOICES] = {0}; data/rdesktop-1.9.0/utils.c:386: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[1024]; data/rdesktop-1.9.0/utils.c:497: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 hex[4]; data/rdesktop-1.9.0/utils.c:538: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] = {0}; data/rdesktop-1.9.0/utils.c:539: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[64] = {0}; data/rdesktop-1.9.0/utils.c:540: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 result[1024] = {0}; data/rdesktop-1.9.0/utils.c:585: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]; data/rdesktop-1.9.0/utils.c:587: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 digest[128]; data/rdesktop-1.9.0/utils.c:591: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 subject[256]; data/rdesktop-1.9.0/utils.c:592: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 issuer[256]; data/rdesktop-1.9.0/utils.c:593: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 valid_from[256]; data/rdesktop-1.9.0/utils.c:594: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 valid_to[256]; data/rdesktop-1.9.0/utils.c:595: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 sha1[256]; data/rdesktop-1.9.0/utils.c:596: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 sha256[256]; data/rdesktop-1.9.0/utils.c:646: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 entries[1024] = {0}; data/rdesktop-1.9.0/utils.c:647: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 san[128] = {0}; data/rdesktop-1.9.0/utils.c:704: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[1024]; data/rdesktop-1.9.0/utils.c:705: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 str[1024 + 64]; data/rdesktop-1.9.0/utils.c:893: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 dir[PATH_MAX - 12]; data/rdesktop-1.9.0/utils.c:952: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 certcache_fn[PATH_MAX]; data/rdesktop-1.9.0/utils.c:953: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 cert_info[2048] = {0}; data/rdesktop-1.9.0/utils.c:954: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 cert_invalid_reasons[2048] = {0}; data/rdesktop-1.9.0/utils.c:955: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 message[8192] = {0}; data/rdesktop-1.9.0/xclip.c:971: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(g_clip_buffer + g_clip_buflen, data, nitems); data/rdesktop-1.9.0/xclip.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(formats_data, data, length); data/rdesktop-1.9.0/xkeymap.c:40:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. extern char g_keymapname[16]; data/rdesktop-1.9.0/xkeymap.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 keyname[KEYMAP_MAX_LINE_LENGTH]; data/rdesktop-1.9.0/xkeymap.c:350:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(path2, "r"); data/rdesktop-1.9.0/xkeymap.c:358:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(path1, "r"); data/rdesktop-1.9.0/xkeymap.c:366:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(path1, "r"); data/rdesktop-1.9.0/xkeymap.c:378: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 line[KEYMAP_MAX_LINE_LENGTH]; data/rdesktop-1.9.0/xwin.c:124: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 icon_buffer[32 * 32 * 4]; data/rdesktop-1.9.0/xwin.c:158: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 g_pointer_log_to_phys_map[32]; data/rdesktop-1.9.0/xwin.c:742: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 name[64]; data/rdesktop-1.9.0/xwin.c:1584:11: [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 phys_to_log_map[sizeof(g_pointer_log_to_phys_map)]; data/rdesktop-1.9.0/xwin.c:1890: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 hostname[HOST_NAME_MAX]; data/rdesktop-1.9.0/xwin.c:2612: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 str[256]; data/rdesktop-1.9.0/xwin.c:4784: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(sw->icon_buffer + sw->icon_offset, data, chunk_len); data/rdesktop-1.9.0/channels.c:65:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(channel->name, name, 8); data/rdesktop-1.9.0/cssp.c:121:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int size = (strlen(service_name) + 1 + strlen(server) + 1); data/rdesktop-1.9.0/cssp.c:121: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). int size = (strlen(service_name) + 1 + strlen(server) + 1); data/rdesktop-1.9.0/cssp.c:125:18: [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). output.length = strlen(output.value) + 1; data/rdesktop-1.9.0/cssp.c:407:18: [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 (username && strlen(username)) data/rdesktop-1.9.0/cssp.c:422: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). if (domain && strlen(domain)) data/rdesktop-1.9.0/ctrl.c:144: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). send(slave->sock, buf, strlen(buf), 0); data/rdesktop-1.9.0/ctrl.c:157:43: [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(cmd, CMD_SEAMLESS_SPAWN " ", strlen(CMD_SEAMLESS_SPAWN) + 1) == 0) data/rdesktop-1.9.0/ctrl.c:162: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). p += strlen("seamlessrdpshell.exe") + 1; data/rdesktop-1.9.0/ctrl.c:164:14: [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 = cmd + strlen(CMD_SEAMLESS_SPAWN) + 1; data/rdesktop-1.9.0/ctrl.c:197:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = sizeof(saun.sun_family) + strlen(saun.sun_path); data/rdesktop-1.9.0/ctrl.c:230:44: [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). rdssl_sha1_update(&sha1, (uint8 *) user, strlen(user)); data/rdesktop-1.9.0/ctrl.c:234:46: [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). rdssl_sha1_update(&sha1, (uint8 *) domain, strlen(domain)); data/rdesktop-1.9.0/ctrl.c:238:44: [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). rdssl_sha1_update(&sha1, (uint8 *) host, strlen(host)); data/rdesktop-1.9.0/ctrl.c:308:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(saun.sun_path, ctrlsock_name, sizeof(saun.sun_path)); data/rdesktop-1.9.0/ctrl.c:402: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). offs = strlen(it->linebuf); data/rdesktop-1.9.0/ctrl.c:473:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = sizeof(saun.sun_family) + strlen(saun.sun_path); data/rdesktop-1.9.0/ctrl.c:483: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). ret = utils_locale_to_utf8(data, strlen(data), tmp, CTRL_LINEBUF_SIZE - 1); data/rdesktop-1.9.0/ctrl.c:490:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((strlen(escaped) + 1) > CTRL_LINEBUF_SIZE - 1) data/rdesktop-1.9.0/ctrl.c:494:19: [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). send(s, escaped, strlen(escaped), 0); data/rdesktop-1.9.0/ctrl.c:500:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(fp)) != EOF && index < CTRL_RESULT_SIZE && c != '\n') data/rdesktop-1.9.0/disk.c:332:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(pdisk_data->name, optarg, sizeof(pdisk_data->name) - 1); data/rdesktop-1.9.0/disk.c:333:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(g_rdpdr_device[*id].name, optarg, sizeof(g_rdpdr_device[*id].name) - 1); data/rdesktop-1.9.0/disk.c:335:53: [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). g_rdpdr_device[*id].local_path = (char *) xmalloc(strlen(pos2) + 1); data/rdesktop-1.9.0/disk.c:367:40: [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 (filename && *filename && filename[strlen(filename) - 1] == '/') data/rdesktop-1.9.0/disk.c:368: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). filename[strlen(filename) - 1] = 0; data/rdesktop-1.9.0/disk.c:522:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(g_fileinfo[handle].path, path, PATH_MAX - 1); data/rdesktop-1.9.0/disk.c:601:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(handle, data, length); data/rdesktop-1.9.0/disk.c:1045:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). fullname = (char *) xmalloc(strlen(pfinfo->path) + strlen(dp->d_name) + 2); data/rdesktop-1.9.0/disk.c:1045:54: [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). fullname = (char *) xmalloc(strlen(pfinfo->path) + strlen(dp->d_name) + 2); data/rdesktop-1.9.0/disk.c:1097:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(fd, buf, sizeof(buf)); data/rdesktop-1.9.0/disk.c:1101:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(info.label, (char *) buf + 43, 10); data/rdesktop-1.9.0/disk.c:1106:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(fd, buf, sizeof(buf)); data/rdesktop-1.9.0/disk.c:1107:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(info.label, (char *) buf + 41, 32); data/rdesktop-1.9.0/disk.c:1240:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(pfinfo->pattern, 1 + strrchr(pattern, '/'), PATH_MAX - 1); data/rdesktop-1.9.0/ewmhints.c:410: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(title); data/rdesktop-1.9.0/iso.c:65: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). int length = 30 + strlen(username); data/rdesktop-1.9.0/iso.c:82: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). out_uint8a(s, "Cookie: mstshash=", strlen("Cookie: mstshash=")); data/rdesktop-1.9.0/iso.c:83: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). out_uint8a(s, username, strlen(username)); data/rdesktop-1.9.0/licence.c:58:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy((char *) (hwid + 4), g_hostname, LICENCE_HWID_SIZE - 4); data/rdesktop-1.9.0/licence.c:108:19: [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). uint16 userlen = strlen(user) + 1; data/rdesktop-1.9.0/licence.c:109:19: [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). uint16 hostlen = strlen(host) + 1; data/rdesktop-1.9.0/lspci.c:91:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if (strspn(line, " \t") == strlen(line)) data/rdesktop-1.9.0/lspci.c:165: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(output); data/rdesktop-1.9.0/parallel.c:61:44: [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). g_rdpdr_device[*id].local_path = xmalloc(strlen(pos2) + 1); data/rdesktop-1.9.0/parallel.c:125:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). *result = read(handle, data, length); data/rdesktop-1.9.0/printer.c:78: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). pprinter_data->printer = xmalloc(strlen(optarg) + 1); data/rdesktop-1.9.0/printer.c:86:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). pprinter_data->driver = xmalloc(strlen(pos2) + 1); data/rdesktop-1.9.0/printer.c:117:51: [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(pprinter_data->printer, "mydeskjet", strlen(pprinter_data->printer)) == 0) data/rdesktop-1.9.0/printercache.c:45: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). path = (char *) xmalloc(strlen(base) + sizeof("/.rdesktop/rdpdr/") + strlen(printer) + 1); data/rdesktop-1.9.0/printercache.c:45:71: [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). path = (char *) xmalloc(strlen(base) + sizeof("/.rdesktop/rdpdr/") + strlen(printer) + 1); data/rdesktop-1.9.0/printercache.c:63:2: [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(path, "/"); data/rdesktop-1.9.0/printercache.c:89: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). path = (char *) xmalloc(strlen(home) + sizeof("/.rdesktop/rdpdr/") + strlen(printer) + data/rdesktop-1.9.0/printercache.c:89:71: [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). path = (char *) xmalloc(strlen(home) + sizeof("/.rdesktop/rdpdr/") + strlen(printer) + data/rdesktop-1.9.0/printercache.c:130:4: [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(printer) > data/rdesktop-1.9.0/printercache.c:131:4: [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(new_printer) ? strlen(printer) : strlen(new_printer)) + strlen(home) + data/rdesktop-1.9.0/printercache.c:131: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). strlen(new_printer) ? strlen(printer) : strlen(new_printer)) + strlen(home) + data/rdesktop-1.9.0/printercache.c:131:44: [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(new_printer) ? strlen(printer) : strlen(new_printer)) + strlen(home) + data/rdesktop-1.9.0/printercache.c:131:67: [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(new_printer) ? strlen(printer) : strlen(new_printer)) + strlen(home) + data/rdesktop-1.9.0/printercache.c:173: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). path = (char *) xmalloc(strlen(home) + sizeof("/.rdesktop/rdpdr/") + strlen(printer_name) + data/rdesktop-1.9.0/printercache.c:173:71: [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). path = (char *) xmalloc(strlen(home) + sizeof("/.rdesktop/rdpdr/") + strlen(printer_name) + data/rdesktop-1.9.0/printercache.c:191:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). length = read(fd, *data, st.st_size); data/rdesktop-1.9.0/printercache.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). path = (char *) xmalloc(strlen(home) + sizeof("/.rdesktop/rdpdr/") + strlen(printer_name) + data/rdesktop-1.9.0/printercache.c:213:71: [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). path = (char *) xmalloc(strlen(home) + sizeof("/.rdesktop/rdpdr/") + strlen(printer_name) + data/rdesktop-1.9.0/rdesktop.c:579:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(server, server + 1, strlen(server)); data/rdesktop-1.9.0/rdesktop.c:579:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncpy(server, server + 1, strlen(server)); data/rdesktop-1.9.0/rdesktop.c:837: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). g_username = (char *) xmalloc(strlen(optarg) + 1); data/rdesktop-1.9.0/rdesktop.c:1085: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). g_rdpdr_clientname = xmalloc(strlen(optarg + 11) + 1); data/rdesktop-1.9.0/rdesktop.c:1144: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(optarg, "sc-csp-name", strlen("sc-scp-name")) == data/rdesktop-1.9.0/rdesktop.c:1149:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen("sc-reader-name")) == 0) data/rdesktop-1.9.0/rdesktop.c:1153:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen("sc-card-name")) == 0) data/rdesktop-1.9.0/rdesktop.c:1157:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen("sc-container-name")) == 0) data/rdesktop-1.9.0/rdesktop.c:1242: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). int pwlen = strlen(pw->pw_name) + 1; data/rdesktop-1.9.0/rdesktop.c:1305:3: [1] (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. strncat(g_title, server, sizeof(g_title) - sizeof("rdesktop - ")); data/rdesktop-1.9.0/rdesktop.c:1357:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). g_username = (char *) xmalloc(strlen(g_redirect_username) + 1); data/rdesktop-1.9.0/rdesktop.c:1532:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((read(fd, buf, 1) != 1) || (buf[0] == 0)) /* Available? */ data/rdesktop-1.9.0/rdesktop.c:1535:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, buf, 32) != 32) data/rdesktop-1.9.0/rdesktop.c:1560:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, random, 32); data/rdesktop-1.9.0/rdesktop.c:1746:18: [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). nextval = src + strlen(src); data/rdesktop-1.9.0/rdesktop.c:1766: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). return (strncmp(s, prefix, strlen(prefix)) == 0); data/rdesktop-1.9.0/rdesktop.c:1785:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). inputlen = strlen(input); data/rdesktop-1.9.0/rdesktop.c:1787:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). restlen = strlen(*rest); data/rdesktop-1.9.0/rdesktop.c:1793:2: [1] (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. strncat(buf, input, buflen); data/rdesktop-1.9.0/rdesktop.c:1871:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd[0], output, 255); data/rdesktop-1.9.0/rdesktop.c:1954:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). length = read(fd, *data, st.st_size); data/rdesktop-1.9.0/rdesktop.c:2136:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read(fd, ptr, len); data/rdesktop-1.9.0/rdesktop.h:141:30: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). #define STRNCPY(dst,src,n) { strncpy(dst,src,n-1); dst[n-1] = 0; } data/rdesktop-1.9.0/rdp.c:288: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). ibl = strlen(string); data/rdesktop-1.9.0/rdp.c:397:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len_domain = 2 * strlen(domain); data/rdesktop-1.9.0/rdp.c:398: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). int len_user = 2 * strlen(user); data/rdesktop-1.9.0/rdp.c:399:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len_password = 2 * strlen(password); data/rdesktop-1.9.0/rdp.c:400: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). int len_program = 2 * strlen(program); data/rdesktop-1.9.0/rdp.c:401: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). int len_directory = 2 * strlen(directory); data/rdesktop-1.9.0/rdp.c:404:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len_ip = 2 * strlen(ipaddr) + 2; data/rdesktop-1.9.0/rdp.c:405: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). int len_dll = 2 * strlen("C:\\WINNT\\System32\\mstscax.dll") + 2; data/rdesktop-1.9.0/rdp.c:526:43: [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). rdp_out_unistr(s, "GTB, normaltid", 2 * strlen("GTB, normaltid")); data/rdesktop-1.9.0/rdp.c:527: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). out_uint8s(s, 62 - 2 * strlen("GTB, normaltid")); data/rdesktop-1.9.0/rdp.c:533:43: [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). rdp_out_unistr(s, "GTB, sommartid", 2 * strlen("GTB, sommartid")); data/rdesktop-1.9.0/rdp.c:534: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). out_uint8s(s, 62 - 2 * strlen("GTB, sommartid")); data/rdesktop-1.9.0/rdpdr.c:261: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). size += 2 * strlen(diskinfo->name) + 2; data/rdesktop-1.9.0/rdpdr.c:270: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). size += 2 * strlen(printerinfo->driver) + 2; data/rdesktop-1.9.0/rdpdr.c:271: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). size += 2 * strlen(printerinfo->printer) + 2; data/rdesktop-1.9.0/rdpdr.c:316: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). disklen = strlen(diskinfo->name) + 1; data/rdesktop-1.9.0/rdpdr.c:535:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (!fns->read) data/rdesktop-1.9.0/rdpdr.c:560:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). status = fns->read(file, buffer, length, offset, &result); data/rdesktop-1.9.0/rdpdr.c:1169:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). status = fns->read(iorq->fd, data/rdesktop-1.9.0/rdpsnd.c:541: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 (optarg != NULL && strlen(optarg) > 0) data/rdesktop-1.9.0/rdpsnd_oss.c:484:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(dsp_fd, buffer, sizeof(buffer)); data/rdesktop-1.9.0/rdpsnd_pulse.c:985:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(pulse_ctl[0], &audio_cmd, sizeof audio_cmd); data/rdesktop-1.9.0/rdpsnd_sgi.c:275:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(10); data/rdesktop-1.9.0/rdpsnd_sun.c:472:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(dsp_fd, buffer, sizeof(buffer) / 2); data/rdesktop-1.9.0/scard.c:200:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(g_rdpdr_device[*id].name, "SCARD\0\0\0", 8); data/rdesktop-1.9.0/scard.c:218: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). if (strlen(name) > 0) data/rdesktop-1.9.0/scard.c:220:10: [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(alias)) data/rdesktop-1.9.0/scard.c:245:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(vendor); data/rdesktop-1.9.0/scard.c:502:33: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). inRepos(STREAM in, unsigned int read) data/rdesktop-1.9.0/scard.c:504:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). SERVER_DWORD add = 4 - read % 4; data/rdesktop-1.9.0/scard.c:597:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). *destination = SC_xmalloc(handle, strlen(reader) + 1); data/rdesktop-1.9.0/scard.c:609: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). unsigned int dataLength = strlen(reader) + 1; data/rdesktop-1.9.0/scard.c:849: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). int lenSC = strlen(cur); data/rdesktop-1.9.0/scard.c:862:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). lenSC = strlen(cur); data/rdesktop-1.9.0/scard.c:933: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). if (szVendor && (strlen(szVendor) > 0)) data/rdesktop-1.9.0/scard.c:1407:9: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. if (equal) data/rdesktop-1.9.0/scard.c:1980: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). for (i = 0, cur = szGroups; i < dwGroups; i++, cur += strlen(cur) + 1) data/rdesktop-1.9.0/serial.c:534:44: [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). g_rdpdr_device[*id].local_path = xmalloc(strlen(pos2) + 1); data/rdesktop-1.9.0/serial.c:679:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). *result = read(handle, data, length); data/rdesktop-1.9.0/ssl.c:219:50: [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(oid, OID_SHA_WITH_RSA_SIGNATURE, strlen(OID_SHA_WITH_RSA_SIGNATURE)) == 0 data/rdesktop-1.9.0/ssl.c:220: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). || strncmp(oid, OID_MD5_WITH_RSA_SIGNATURE, strlen(OID_MD5_WITH_RSA_SIGNATURE)) == 0)) data/rdesktop-1.9.0/stream.c:126: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). ibl = strlen(string); data/rdesktop-1.9.0/types.h:222:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). RD_NTSTATUS(*read) (RD_NTHANDLE handle, uint8 * data, uint32 length, uint64 offset, data/rdesktop-1.9.0/utils.c:71:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). es = strlen(str) + (cnt * 3) + 1; data/rdesktop-1.9.0/utils.c:101: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). ns = xmalloc(strlen(str) + 1); data/rdesktop-1.9.0/utils.c:102:18: [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). memcpy(ns, str, strlen(str) + 1); data/rdesktop-1.9.0/utils.c:156:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!path || strlen(path) == 0) data/rdesktop-1.9.0/utils.c:161: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(path) > PATH_MAX) data/rdesktop-1.9.0/utils.c:178:4: [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(pt, "/"); data/rdesktop-1.9.0/utils.c:196: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 (strncmp(g_codepage, "UTF-8", strlen("UTF-8")) == 0) data/rdesktop-1.9.0/utils.c:233: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). if (os < (strlen(src) + 1)) data/rdesktop-1.9.0/utils.c:236: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). memcpy(dest, src, strlen(src) + 1); data/rdesktop-1.9.0/utils.c:430: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). if (!subjects || !strlen(subjects)) data/rdesktop-1.9.0/utils.c:530: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(out); data/rdesktop-1.9.0/utils.c:558:5: [1] (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. strncat(result, buf, left); data/rdesktop-1.9.0/utils.c:559:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). left -= strlen(buf); data/rdesktop-1.9.0/utils.c:566:5: [1] (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. strncat(result, buf, left); data/rdesktop-1.9.0/utils.c:567:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). left -= strlen(buf); data/rdesktop-1.9.0/utils.c:678:6: [1] (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 low because the source is a constant string. strncat(entries, ", ", left); data/rdesktop-1.9.0/utils.c:682:5: [1] (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. strncat(entries, san, left); data/rdesktop-1.9.0/utils.c:683:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). left -= strlen(san); data/rdesktop-1.9.0/utils.c:689: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(entries) == 0) data/rdesktop-1.9.0/utils.c:716:3: [1] (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. strncat(out, buf, size - 1); data/rdesktop-1.9.0/utils.c:717: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). size -= strlen(buf); data/rdesktop-1.9.0/utils.c:727:4: [1] (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. strncat(out, str, size); data/rdesktop-1.9.0/utils.c:728: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). size -= strlen(str); data/rdesktop-1.9.0/utils.c:735:4: [1] (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. strncat(out, str, size); data/rdesktop-1.9.0/utils.c:736: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). size -= strlen(str); data/rdesktop-1.9.0/utils.c:739:3: [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(out, "\n"); data/rdesktop-1.9.0/utils.c:746:3: [1] (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. strncat(out, buf, size); data/rdesktop-1.9.0/utils.c:747: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). size -= strlen(buf); data/rdesktop-1.9.0/utils.c:753:3: [1] (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. strncat(out, buf, size); data/rdesktop-1.9.0/utils.c:754: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). size -= strlen(buf); data/rdesktop-1.9.0/utils.c:764:4: [1] (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. strncat(out, str, size); data/rdesktop-1.9.0/utils.c:765: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). size -= strlen(str); data/rdesktop-1.9.0/utils.c:772:3: [1] (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. strncat(out, buf, size); data/rdesktop-1.9.0/utils.c:773: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). size -= strlen(buf); data/rdesktop-1.9.0/utils.c:779:3: [1] (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. strncat(out, buf, size); data/rdesktop-1.9.0/utils.c:780: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). size -= strlen(buf); data/rdesktop-1.9.0/utils.c:787:3: [1] (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. strncat(out, buf, size); data/rdesktop-1.9.0/utils.c:788: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). size -= strlen(buf); data/rdesktop-1.9.0/utils.c:792:3: [1] (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. strncat(out, buf, size); data/rdesktop-1.9.0/utils.c:793: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). size -= strlen(buf); data/rdesktop-1.9.0/utils.c:799:3: [1] (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. strncat(out, buf, size); data/rdesktop-1.9.0/utils.c:800: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). size -= strlen(buf); data/rdesktop-1.9.0/utils.c:804:3: [1] (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. strncat(out, buf, size); data/rdesktop-1.9.0/utils.c:805: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). size -= strlen(buf); data/rdesktop-1.9.0/utils.c:811:3: [1] (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. strncat(out, buf, size); data/rdesktop-1.9.0/utils.c:812: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). size -= strlen(buf); data/rdesktop-1.9.0/utils.c:818:3: [1] (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. strncat(out, buf, size); data/rdesktop-1.9.0/utils.c:819: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). size -= strlen(buf); data/rdesktop-1.9.0/utils.c:825:3: [1] (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. strncat(out, buf, size); data/rdesktop-1.9.0/utils.c:826: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). size -= strlen(buf); data/rdesktop-1.9.0/utils.c:832:3: [1] (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. strncat(out, buf, size); data/rdesktop-1.9.0/utils.c:833: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). size -= strlen(buf); data/rdesktop-1.9.0/utils.c:839:3: [1] (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. strncat(out, buf, size); data/rdesktop-1.9.0/utils.c:840: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). size -= strlen(buf); data/rdesktop-1.9.0/utils.c:846:3: [1] (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. strncat(out, buf, size); data/rdesktop-1.9.0/utils.c:847: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). size -= strlen(buf); data/rdesktop-1.9.0/utils.c:855:3: [1] (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. strncat(out, buf, size); data/rdesktop-1.9.0/utils.c:856: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). size -= strlen(buf); data/rdesktop-1.9.0/utils.c:865:3: [1] (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. strncat(out, buf, size); data/rdesktop-1.9.0/utils.c:866: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). size -= strlen(buf); data/rdesktop-1.9.0/utils.c:872:3: [1] (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. strncat(out, buf, size); data/rdesktop-1.9.0/utils.c:873: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). size -= strlen(buf); data/rdesktop-1.9.0/utils.c:882:3: [1] (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. strncat(out, buf, size); data/rdesktop-1.9.0/utils.c:883: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). size -= strlen(buf); data/rdesktop-1.9.0/xkeymap.c:324:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(result, b, PATH_MAX); data/rdesktop-1.9.0/xkeymap.c:328:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(result, a, PATH_MAX); data/rdesktop-1.9.0/xkeymap.c:329:3: [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(result, "/"); data/rdesktop-1.9.0/xkeymap.c:403: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). line_length = strlen(line); data/rdesktop-1.9.0/xwin.c:636:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(100000); data/rdesktop-1.9.0/xwin.c:1896:14: [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). tp.nitems = strlen(hostname); ANALYSIS SUMMARY: Hits = 473 Lines analyzed = 40686 in approximately 0.86 seconds (47158 lines/second) Physical Source Lines of Code (SLOC) = 31162 Hits@level = [0] 150 [1] 200 [2] 197 [3] 24 [4] 51 [5] 1 Hits@level+ = [0+] 623 [1+] 473 [2+] 273 [3+] 76 [4+] 52 [5+] 1 Hits/KSLOC@level+ = [0+] 19.9923 [1+] 15.1787 [2+] 8.76067 [3+] 2.43887 [4+] 1.6687 [5+] 0.0320904 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.