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/libkcompactdisc-20.08.2/tests/testkcd.cpp Examining data/libkcompactdisc-20.08.2/src/phonon_interface.h Examining data/libkcompactdisc-20.08.2/src/wmlib_interface.cpp Examining data/libkcompactdisc-20.08.2/src/wmlib/plat_scor5.c Examining data/libkcompactdisc-20.08.2/src/wmlib/scsi.c Examining data/libkcompactdisc-20.08.2/src/wmlib/plat_irix.c Examining data/libkcompactdisc-20.08.2/src/wmlib/plat_bsd386.c Examining data/libkcompactdisc-20.08.2/src/wmlib/plat_svr4.c Examining data/libkcompactdisc-20.08.2/src/wmlib/plat_sun.c Examining data/libkcompactdisc-20.08.2/src/wmlib/cdrom.c Examining data/libkcompactdisc-20.08.2/src/wmlib/cddb.c Examining data/libkcompactdisc-20.08.2/src/wmlib/include/wm_platform.h Examining data/libkcompactdisc-20.08.2/src/wmlib/include/wm_config.h Examining data/libkcompactdisc-20.08.2/src/wmlib/include/wm_cdinfo.h Examining data/libkcompactdisc-20.08.2/src/wmlib/include/workman.h Examining data/libkcompactdisc-20.08.2/src/wmlib/include/wm_struct.h Examining data/libkcompactdisc-20.08.2/src/wmlib/include/wm_cddb.h Examining data/libkcompactdisc-20.08.2/src/wmlib/include/wm_scsi.h Examining data/libkcompactdisc-20.08.2/src/wmlib/include/workman_defs.h Examining data/libkcompactdisc-20.08.2/src/wmlib/include/wm_cdrom.h Examining data/libkcompactdisc-20.08.2/src/wmlib/include/wm_helpers.h Examining data/libkcompactdisc-20.08.2/src/wmlib/include/wm_cdtext.h Examining data/libkcompactdisc-20.08.2/src/wmlib/include/wm_cdda.h Examining data/libkcompactdisc-20.08.2/src/wmlib/include/wm_version.h Examining data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c Examining data/libkcompactdisc-20.08.2/src/wmlib/plat_linux.c Examining data/libkcompactdisc-20.08.2/src/wmlib/cdtext.c Examining data/libkcompactdisc-20.08.2/src/wmlib/plat_news.c Examining data/libkcompactdisc-20.08.2/src/wmlib/plat_freebsd.c Examining data/libkcompactdisc-20.08.2/src/wmlib/plat_ultrix.c Examining data/libkcompactdisc-20.08.2/src/wmlib/drv_toshiba.c Examining data/libkcompactdisc-20.08.2/src/wmlib/cdda.c Examining data/libkcompactdisc-20.08.2/src/wmlib/plat_openbsd.c Examining data/libkcompactdisc-20.08.2/src/wmlib/audio/audio_arts.c Examining data/libkcompactdisc-20.08.2/src/wmlib/audio/audio_sun.c Examining data/libkcompactdisc-20.08.2/src/wmlib/audio/audio_phonon.cpp Examining data/libkcompactdisc-20.08.2/src/wmlib/audio/audio.c Examining data/libkcompactdisc-20.08.2/src/wmlib/audio/audio.h Examining data/libkcompactdisc-20.08.2/src/wmlib/audio/audio_alsa.c Examining data/libkcompactdisc-20.08.2/src/wmlib/audio/audio_phonon.h Examining data/libkcompactdisc-20.08.2/src/wmlib/plat_hpux.c Examining data/libkcompactdisc-20.08.2/src/wmlib/drv_sony.c Examining data/libkcompactdisc-20.08.2/src/wmlib/wm_helpers.c Examining data/libkcompactdisc-20.08.2/src/wmlib/plat_aix.c Examining data/libkcompactdisc-20.08.2/src/wmlib/plat_template.c Examining data/libkcompactdisc-20.08.2/src/wmlib/plat_sun_cdda.c Examining data/libkcompactdisc-20.08.2/src/kcompactdisc.h Examining data/libkcompactdisc-20.08.2/src/wmlib_interface.h Examining data/libkcompactdisc-20.08.2/src/kcompactdisc_p.cpp Examining data/libkcompactdisc-20.08.2/src/kcompactdisc.cpp Examining data/libkcompactdisc-20.08.2/src/kcompactdisc_p.h Examining data/libkcompactdisc-20.08.2/src/phonon_interface.cpp FINAL RESULTS: data/libkcompactdisc-20.08.2/src/wmlib/plat_scor5.c:98:11: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (chown(pass_through, 0 , 0) < 0) data/libkcompactdisc-20.08.2/src/wmlib/plat_scor5.c:104:11: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (chmod(pass_through, 0660 ) < 0) data/libkcompactdisc-20.08.2/src/wmlib/plat_svr4.c:100:11: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (chown(pass_through, 0 , 0) < 0) data/libkcompactdisc-20.08.2/src/wmlib/plat_svr4.c:106:11: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (chmod(pass_through, 0660 ) < 0) data/libkcompactdisc-20.08.2/src/wmlib/audio/audio_sun.c:109: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(acdev, audiodev); data/libkcompactdisc-20.08.2/src/wmlib/cdtext.c:176:9: [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((char*)(p_componente[arr]), (char*)(p_componente[arr-1])); data/libkcompactdisc-20.08.2/src/wmlib/cdtext.c:197:9: [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((char*)(p_componente[arr]), (char*)(p_componente[arr-1])); data/libkcompactdisc-20.08.2/src/wmlib/include/wm_config.h:356:25: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define DEBUGLOG(...) fprintf(stderr, __VA_ARGS__) data/libkcompactdisc-20.08.2/src/wmlib/include/wm_config.h:358:34: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define DEBUGLOG(fmt, args...) fprintf(stderr, fmt, ##args) data/libkcompactdisc-20.08.2/src/wmlib/include/wm_config.h:364:24: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define ERRORLOG(...) fprintf(stderr, __VA_ARGS__) data/libkcompactdisc-20.08.2/src/wmlib/include/wm_config.h:366:33: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define ERRORLOG(fmt, args...) fprintf(stderr, fmt, ##args) data/libkcompactdisc-20.08.2/src/wmlib/include/wm_helpers.h:92:28: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__ ((format(printf,2,3))) data/libkcompactdisc-20.08.2/src/wmlib/plat_openbsd.c:70:6: [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. if (access("/dev/rcd0c", F_OK) == 0) { data/libkcompactdisc-20.08.2/src/wmlib/plat_openbsd.c:72:16: [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. } else if (access("/dev/rcd1c", F_OK) == 0) { data/libkcompactdisc-20.08.2/src/wmlib/plat_openbsd.c:74:16: [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. } else if (access("/dev/acd0c", F_OK) == 0) { data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c:98:7: [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(retval, holdbuf); data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c:108: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(retval, stmp+1); data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c:112: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(holdbuf, tmp); data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c:116:6: [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(retval, stmp); data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c:161:7: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl("/etc/uerf", "uerf", "-R", "-r", "300", (void *)0); data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c:162:7: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl("/usr/sbin/uerf", "uerf", "-R", "-r", "300", (void *)0); data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c:181: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(osf_cd_device, device_p); data/libkcompactdisc-20.08.2/src/wmlib/plat_scor5.c:80:11: [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. ccode = access(pass_through, F_OK); data/libkcompactdisc-20.08.2/src/wmlib/plat_sun.c:129:7: [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. if (access("/vol/dev/aliases", X_OK) == 0) data/libkcompactdisc-20.08.2/src/wmlib/plat_sun.c:148:12: [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. else if (access("/dev/rdsk/c0t6d0s2", F_OK) == 0) data/libkcompactdisc-20.08.2/src/wmlib/plat_sun.c:153:12: [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. else if (access("/dev/rcd0", F_OK) == 0) data/libkcompactdisc-20.08.2/src/wmlib/plat_sun.c:157:12: [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. else if (access("/dev/rsr0", F_OK) == 0) data/libkcompactdisc-20.08.2/src/wmlib/plat_sun.c:861:20: [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). ctlname = strcat(strcpy(malloc(strlen(devname) + 4), devname), "ctl"); data/libkcompactdisc-20.08.2/src/wmlib/plat_svr4.c:75:11: [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. ccode = access(pass_through, F_OK); data/libkcompactdisc-20.08.2/src/wmlib/plat_svr4.c:141:7: [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. if (access("/dev/cdrom/cdrom1", F_OK) == 0) data/libkcompactdisc-20.08.2/src/wmlib/plat_svr4.c:145:12: [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. else if (access("/dev/cdrom/cdrom2", F_OK) == 0) data/libkcompactdisc-20.08.2/src/wmlib/plat_ultrix.c:87: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(retval, holdbuf); data/libkcompactdisc-20.08.2/src/wmlib/plat_ultrix.c:96:6: [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(retval, stmp+1); data/libkcompactdisc-20.08.2/src/wmlib/plat_ultrix.c:99: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(holdbuf, tmp); data/libkcompactdisc-20.08.2/src/wmlib/plat_ultrix.c:103:5: [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(retval, stmp); data/libkcompactdisc-20.08.2/src/wmlib/plat_ultrix.c:142:3: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl("/etc/uerf", "uerf", "-R", "-r", "300", (void *)0); data/libkcompactdisc-20.08.2/src/wmlib/plat_ultrix.c:143:3: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl("/usr/sbin/uerf", "uerf", "-R", "-r", "300", (void *)0); data/libkcompactdisc-20.08.2/src/wmlib/plat_ultrix.c:161:4: [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(ultrix_cd_device, device_p); data/libkcompactdisc-20.08.2/src/wmlib/scsi.c:219:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(d->vendor, WM_STR_GENVENDOR); data/libkcompactdisc-20.08.2/src/wmlib/scsi.c:220:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(d->model, WM_STR_GENMODEL); data/libkcompactdisc-20.08.2/src/wmlib/scsi.c:221:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(d->revision, WM_STR_GENREV); data/libkcompactdisc-20.08.2/src/wmlib/wm_helpers.c:146: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(*t, s); data/libkcompactdisc-20.08.2/src/wmlib/wm_helpers.c:160: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(new, s); data/libkcompactdisc-20.08.2/src/wmlib/wm_helpers.c:218:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, ap); data/libkcompactdisc-20.08.2/tests/testkcd.cpp:34:19: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. for (auto system: mKcd->audioSystems()) { data/libkcompactdisc-20.08.2/tests/testkcd.cpp:35:25: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. qDebug() << system; data/libkcompactdisc-20.08.2/src/kcompactdisc.cpp:433:20: [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 KCompactDisc::random() data/libkcompactdisc-20.08.2/src/kcompactdisc.cpp:506:43: [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 KCompactDisc::setRandomPlaylist(bool random) data/libkcompactdisc-20.08.2/src/kcompactdisc.cpp:509: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. d->m_randomPlaylist = random; data/libkcompactdisc-20.08.2/src/kcompactdisc.h:435:10: [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 random(); data/libkcompactdisc-20.08.2/src/wmlib/audio/audio_sun.c:76:7: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *getenv(); data/libkcompactdisc-20.08.2/src/wmlib/audio/audio_sun.c:97: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. audiodev = getenv("AUDIODEV"); data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c:140:16: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. extern char *getenv(); data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c:145: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. device = getenv("CDROM"); data/libkcompactdisc-20.08.2/src/wmlib/plat_sun.c:135:23: [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. sun_cd_device = getenv("VOLUME_DEVICE"); data/libkcompactdisc-20.08.2/src/wmlib/plat_sun.c:860:19: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (!(devname = getenv("AUDIODEV"))) devname = "/dev/audio"; data/libkcompactdisc-20.08.2/src/wmlib/plat_svr4.c:135: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. device = getenv("CDROM"); data/libkcompactdisc-20.08.2/src/wmlib/plat_ultrix.c:130:11: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. device = getenv("CDROM"); data/libkcompactdisc-20.08.2/src/wmlib/audio/audio_sun.c:110: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(acdev, "ctl"); data/libkcompactdisc-20.08.2/src/wmlib/audio/audio_sun.c:112: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). aucfd = open(acdev, O_WRONLY, 0); data/libkcompactdisc-20.08.2/src/wmlib/audio/audio_sun.c:120:9: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). aufd = open(audiodev, O_WRONLY, 0); data/libkcompactdisc-20.08.2/src/wmlib/cdda.c:214:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). output = fopen(filename, "w"); data/libkcompactdisc-20.08.2/src/wmlib/cddb.c:54: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[12], data/libkcompactdisc-20.08.2/src/wmlib/cddb.c:59: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(buf, "%lu", (unsigned long)n); data/libkcompactdisc-20.08.2/src/wmlib/cdrom.c:166:27: [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 ((err = pdrive->proto.open(pdrive)) < 0) data/libkcompactdisc-20.08.2/src/wmlib/cdrom.c:658:29: [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). err = pdrive->proto.open(pdrive); data/libkcompactdisc-20.08.2/src/wmlib/cdrom.c:789: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 tmp[250]; data/libkcompactdisc-20.08.2/src/wmlib/cdrom.c:819: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(tmp, "unexpected status %i", status); data/libkcompactdisc-20.08.2/src/wmlib/cdtext.c:355:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((char*)(lp_block->binary_disc_identification_info), data/libkcompactdisc-20.08.2/src/wmlib/cdtext.c:359:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((char*)(lp_block->binary_genreidentification_info), data/libkcompactdisc-20.08.2/src/wmlib/cdtext.c:385:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((char*)(lp_block->binary_size_information), data/libkcompactdisc-20.08.2/src/wmlib/drv_sony.c:101: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 mode[16]; data/libkcompactdisc-20.08.2/src/wmlib/include/wm_cdtext.h:35:12: [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 text_data_field[DATAFIELD_LENGHT_IN_PACK]; data/libkcompactdisc-20.08.2/src/wmlib/include/wm_cdtext.h:40:18: [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. typedef unsigned char cdtext_string[MAX_LENGHT_OF_CDTEXT_STRING]; data/libkcompactdisc-20.08.2/src/wmlib/include/wm_cdtext.h:62:12: [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 binary_disc_identification_info[DATAFIELD_LENGHT_IN_PACK]; data/libkcompactdisc-20.08.2/src/wmlib/include/wm_cdtext.h:63:12: [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 binary_genreidentification_info[DATAFIELD_LENGHT_IN_PACK]; data/libkcompactdisc-20.08.2/src/wmlib/include/wm_cdtext.h:64:12: [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 binary_size_information[DATAFIELD_LENGHT_IN_PACK]; data/libkcompactdisc-20.08.2/src/wmlib/include/wm_struct.h:67: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). int (*open)(struct wm_drive *d); data/libkcompactdisc-20.08.2/src/wmlib/include/wm_struct.h:147: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[9]; /* Vendor name */ data/libkcompactdisc-20.08.2/src/wmlib/include/wm_struct.h:148: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 model[17]; /* Drive model */ data/libkcompactdisc-20.08.2/src/wmlib/include/wm_struct.h:149: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 revision[5]; /* Revision of the drive */ data/libkcompactdisc-20.08.2/src/wmlib/plat_aix.c:148:21: [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). switch(d->proto.open(d)) data/libkcompactdisc-20.08.2/src/wmlib/plat_bsd386.c:120: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("/dev/mixer", O_RDWR, 0); data/libkcompactdisc-20.08.2/src/wmlib/plat_bsd386.c:180:20: [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). switch (d->proto.open(d)) { data/libkcompactdisc-20.08.2/src/wmlib/plat_freebsd.c:117: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). d->fd = open(d->cd_device, 0); data/libkcompactdisc-20.08.2/src/wmlib/plat_freebsd.c:174:20: [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). switch (d->proto.open(d)) { data/libkcompactdisc-20.08.2/src/wmlib/plat_freebsd.c:387:25: [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 d->proto.open(d); data/libkcompactdisc-20.08.2/src/wmlib/plat_hpux.c:84: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). d->fd = open(d->cd_device, O_RDWR); data/libkcompactdisc-20.08.2/src/wmlib/plat_hpux.c:104: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(d->vendor, "TOSHIBA"); data/libkcompactdisc-20.08.2/src/wmlib/plat_hpux.c:105: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(d->model, "XM-3301"); data/libkcompactdisc-20.08.2/src/wmlib/plat_hpux.c:127: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(cmd.cdb, cdb, cdblen); data/libkcompactdisc-20.08.2/src/wmlib/plat_hpux.c:132: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 reply_buf[12]; data/libkcompactdisc-20.08.2/src/wmlib/plat_hpux.c:139: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(cmd.command, cdb, cdblen); data/libkcompactdisc-20.08.2/src/wmlib/plat_linux.c:121: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). d->fd = open(d->cd_device, O_RDONLY | O_NONBLOCK); data/libkcompactdisc-20.08.2/src/wmlib/plat_linux.c:157:18: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ret = d->proto.open(d); data/libkcompactdisc-20.08.2/src/wmlib/plat_linux.c:548: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(cmd + 2*sizeof(int), cdb, cdblen); data/libkcompactdisc-20.08.2/src/wmlib/plat_linux.c:550: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(cmd + 2*sizeof(int) + cdblen, retbuf, retbuflen); data/libkcompactdisc-20.08.2/src/wmlib/plat_linux.c:562: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(retbuf, cmd + 2*sizeof(int), retbuflen); data/libkcompactdisc-20.08.2/src/wmlib/plat_linux.c:591:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(cdc.cmd, cdb, cdblen); data/libkcompactdisc-20.08.2/src/wmlib/plat_news.c:129:20: [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). switch (d->proto.open(d)) { data/libkcompactdisc-20.08.2/src/wmlib/plat_openbsd.c:103: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). d->fd = open(d->cd_device, O_RDONLY); data/libkcompactdisc-20.08.2/src/wmlib/plat_openbsd.c:159:19: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). switch (d->proto.open(d)) { data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c:83:10: [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 holdbuf[BUF_SIZE + 1]; data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c:84: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 tmp[BUF_SIZE + 1]; data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c:178: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(osf_cd_device, "/dev/r"); data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c:221: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). d->fd = open(d->cd_device, O_RDWR); data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c:280:20: [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). switch (d->proto.open(d)) { data/libkcompactdisc-20.08.2/src/wmlib/plat_scor5.c:63: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 pass_through[100]; data/libkcompactdisc-20.08.2/src/wmlib/plat_scor5.c:111: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). file_des = open( pass_through, O_RDONLY); data/libkcompactdisc-20.08.2/src/wmlib/plat_scor5.c:172:12: [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 sense_buffer[ SENSE_SZ ]; data/libkcompactdisc-20.08.2/src/wmlib/plat_scor5.c:185: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(sb.cmd.cdb, xcdb, cdblen); data/libkcompactdisc-20.08.2/src/wmlib/plat_sun.c:191: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). d->fd = open(d->cd_device, 0); data/libkcompactdisc-20.08.2/src/wmlib/plat_sun.c:288:22: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). switch (d->proto.open(d)) { data/libkcompactdisc-20.08.2/src/wmlib/plat_sun.c:448:12: [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 cmdbuf[10]; data/libkcompactdisc-20.08.2/src/wmlib/plat_sun.c:589: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 unbcd[256] = { data/libkcompactdisc-20.08.2/src/wmlib/plat_sun.c:861:13: [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. ctlname = strcat(strcpy(malloc(strlen(devname) + 4), devname), "ctl"); data/libkcompactdisc-20.08.2/src/wmlib/plat_sun.c:862:17: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((ctl_fd = open(ctlname, O_WRONLY, 0)) < 0) data/libkcompactdisc-20.08.2/src/wmlib/plat_sun.c:946:17: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((dev_fd = open(devname, O_WRONLY|O_NDELAY, 0)) < 0) data/libkcompactdisc-20.08.2/src/wmlib/plat_sun_cdda.c:60:10: [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 unbcd[256] = { data/libkcompactdisc-20.08.2/src/wmlib/plat_sun_cdda.c:108: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). pdev->fd = open(pdev->devname, 0); data/libkcompactdisc-20.08.2/src/wmlib/plat_sun_cdda.c:110: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). pdev->fd = open("/dev/rdsk/c0t6d0s2", 0); data/libkcompactdisc-20.08.2/src/wmlib/plat_svr4.c:58: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 pass_through[100]; data/libkcompactdisc-20.08.2/src/wmlib/plat_svr4.c:79:23: [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 ((file_des = open(dev_name, O_RDONLY)) < 0) data/libkcompactdisc-20.08.2/src/wmlib/plat_svr4.c:113: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). file_des = open( pass_through, O_RDWR); data/libkcompactdisc-20.08.2/src/wmlib/plat_svr4.c:199:12: [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 sense_buffer[ SENSE_SZ ]; data/libkcompactdisc-20.08.2/src/wmlib/plat_ultrix.c:74: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 holdbuf[BUF_SIZE + 1]; data/libkcompactdisc-20.08.2/src/wmlib/plat_ultrix.c:75: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 tmp[BUF_SIZE + 1]; data/libkcompactdisc-20.08.2/src/wmlib/plat_ultrix.c:158:4: [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(ultrix_cd_device, "/dev/r"); data/libkcompactdisc-20.08.2/src/wmlib/plat_ultrix.c:201: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). d->fd = open(d->cd_device, 0); data/libkcompactdisc-20.08.2/src/wmlib/plat_ultrix.c:260:20: [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). switch (d->proto.open(d)) { data/libkcompactdisc-20.08.2/src/wmlib/scsi.c:106: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 cdb[12]; data/libkcompactdisc-20.08.2/src/wmlib/scsi.c:153: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 pagebuf[255]; data/libkcompactdisc-20.08.2/src/wmlib/scsi.c:184: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 pagebuf[255]; data/libkcompactdisc-20.08.2/src/wmlib/scsi.c:213: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 *s, *t, buf[36]; data/libkcompactdisc-20.08.2/src/wmlib/scsi.c:229: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(d->vendor, buf + 8, 8); data/libkcompactdisc-20.08.2/src/wmlib/scsi.c:231: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(d->model, buf + 16, 16); data/libkcompactdisc-20.08.2/src/wmlib/scsi.c:233: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(d->revision, buf + 32, 4); data/libkcompactdisc-20.08.2/src/wmlib/scsi.c:296: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 buf[12]; /* one track's worth of info */ data/libkcompactdisc-20.08.2/src/wmlib/scsi.c:328: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 buf[48]; data/libkcompactdisc-20.08.2/src/wmlib/scsi.c:402: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 buf[4]; data/libkcompactdisc-20.08.2/src/wmlib/scsi.c:473: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 mode[16]; data/libkcompactdisc-20.08.2/src/wmlib/scsi.c:493: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 mode[16]; data/libkcompactdisc-20.08.2/src/wmlib/scsi.c:519: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 temp[8]; data/libkcompactdisc-20.08.2/src/wmlib/scsi.c:625: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(*pp_buffer, dynamic_temp + 4, *p_buffer_length); data/libkcompactdisc-20.08.2/src/wmlib/wm_helpers.c:66: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(s, "%d.%d.%d", wm_libver_major(), wm_libver_minor(), wm_libver_pl()); data/libkcompactdisc-20.08.2/src/wmlib/audio/audio_alsa.c:341: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). if(dev && strlen(dev) > 0) { data/libkcompactdisc-20.08.2/src/wmlib/audio/audio_sun.c:103: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). acdev = malloc(strlen(audiodev) + 4); data/libkcompactdisc-20.08.2/src/wmlib/cdda.c:191:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(filename); data/libkcompactdisc-20.08.2/src/wmlib/cdda.c:198:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(0, &namelen, sizeof(namelen)); data/libkcompactdisc-20.08.2/src/wmlib/cdda.c:212:4: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(0, filename, namelen); data/libkcompactdisc-20.08.2/src/wmlib/cdrom.c:248:42: [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(driver->vendor, d->vendor, strlen(d->vendor))) || data/libkcompactdisc-20.08.2/src/wmlib/cdrom.c:249:65: [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). ((driver->model != NULL) && strncmp(driver->model, d->model, strlen(d->model))) || data/libkcompactdisc-20.08.2/src/wmlib/cdrom.c:250:69: [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). ((d->revision != NULL) && strncmp(driver->revision, d->revision, strlen(d->revision)))) data/libkcompactdisc-20.08.2/src/wmlib/cdtext.c:181:8: [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((char*)(p_componente[arr]), (char*)(&(pack->text_data_field[i])), 1); data/libkcompactdisc-20.08.2/src/wmlib/cdtext.c:202:9: [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((char*)(p_componente[arr]), u_uc_to_utf8((Uchar*)(&(pack->text_data_field[i]))), 1); data/libkcompactdisc-20.08.2/src/wmlib/plat_hpux.c:144:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(d->fd, reply_buf, sizeof(reply_buf)); data/libkcompactdisc-20.08.2/src/wmlib/plat_hpux.c:146:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(d->fd, retbuf, retbuflen) < 0) data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c:99: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). retval[strlen(retval)-1] = '\0'; data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c:107: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). retval[strlen(retval)-1] = '\0'; /* Trim off C/R */ data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c:113: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). holdbuf[strlen(holdbuf)-1] = -1; data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c:117: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). retval[strlen(retval)-1] = '\0'; data/libkcompactdisc-20.08.2/src/wmlib/plat_osf1.c:182: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(osf_cd_device, "c"); data/libkcompactdisc-20.08.2/src/wmlib/plat_scor5.c:70:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(pass_through, dev_name, sizeof(pass_through)-2); data/libkcompactdisc-20.08.2/src/wmlib/plat_scor5.c:72: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(pass_through, "p" ); data/libkcompactdisc-20.08.2/src/wmlib/plat_sun.c:861: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). ctlname = strcat(strcpy(malloc(strlen(devname) + 4), devname), "ctl"); data/libkcompactdisc-20.08.2/src/wmlib/plat_svr4.c:65:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(pass_through, dev_name, sizeof(pass_through) - 2); data/libkcompactdisc-20.08.2/src/wmlib/plat_svr4.c:67: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(pass_through, "p" ); data/libkcompactdisc-20.08.2/src/wmlib/plat_ultrix.c:88: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). retval[strlen(retval)-1] = '\0'; data/libkcompactdisc-20.08.2/src/wmlib/plat_ultrix.c:95: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). retval[strlen(retval)-1] = '\0'; /* Trim off C/R */ data/libkcompactdisc-20.08.2/src/wmlib/plat_ultrix.c:100: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). holdbuf[strlen(holdbuf)-1] = -1; data/libkcompactdisc-20.08.2/src/wmlib/plat_ultrix.c:104: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). retval[strlen(retval)-1] = '\0'; data/libkcompactdisc-20.08.2/src/wmlib/plat_ultrix.c:162: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(ultrix_cd_device, "c"); data/libkcompactdisc-20.08.2/src/wmlib/wm_helpers.c:115: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). *t = malloc(strlen(s) + 1); data/libkcompactdisc-20.08.2/src/wmlib/wm_helpers.c:123:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(*t, s, strlen(s)); data/libkcompactdisc-20.08.2/src/wmlib/wm_helpers.c:123: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). strncpy(*t, s, strlen(s)); data/libkcompactdisc-20.08.2/src/wmlib/wm_helpers.c:130: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). int len = strlen(s) + 1; data/libkcompactdisc-20.08.2/src/wmlib/wm_helpers.c:139: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). len += strlen(*t); data/libkcompactdisc-20.08.2/src/wmlib/wm_helpers.c:158: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). new = malloc(strlen(s) + 1); ANALYSIS SUMMARY: Hits = 178 Lines analyzed = 15295 in approximately 0.58 seconds (26503 lines/second) Physical Source Lines of Code (SLOC) = 9308 Hits@level = [0] 12 [1] 33 [2] 87 [3] 12 [4] 42 [5] 4 Hits@level+ = [0+] 190 [1+] 178 [2+] 145 [3+] 58 [4+] 46 [5+] 4 Hits/KSLOC@level+ = [0+] 20.4125 [1+] 19.1233 [2+] 15.578 [3+] 6.2312 [4+] 4.94199 [5+] 0.429738 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.