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/betaradio-1.6/src/betaradio.c Examining data/betaradio-1.6/src/json_soup.c Examining data/betaradio-1.6/src/any-tray-icon.h Examining data/betaradio-1.6/src/any-tray-icon.c Examining data/betaradio-1.6/src/gst_player.c Examining data/betaradio-1.6/libltdl/lt_error.c Examining data/betaradio-1.6/libltdl/lt_dlloader.c Examining data/betaradio-1.6/libltdl/lt__alloc.c Examining data/betaradio-1.6/libltdl/argz_.h Examining data/betaradio-1.6/libltdl/loaders/load_add_on.c Examining data/betaradio-1.6/libltdl/loaders/shl_load.c Examining data/betaradio-1.6/libltdl/loaders/dyld.c Examining data/betaradio-1.6/libltdl/loaders/dld_link.c Examining data/betaradio-1.6/libltdl/loaders/dlopen.c Examining data/betaradio-1.6/libltdl/loaders/preopen.c Examining data/betaradio-1.6/libltdl/loaders/loadlibrary.c Examining data/betaradio-1.6/libltdl/lt__dirent.c Examining data/betaradio-1.6/libltdl/libltdl/slist.h Examining data/betaradio-1.6/libltdl/libltdl/lt_system.h Examining data/betaradio-1.6/libltdl/libltdl/lt__strl.h Examining data/betaradio-1.6/libltdl/libltdl/lt_dlloader.h Examining data/betaradio-1.6/libltdl/libltdl/lt_error.h Examining data/betaradio-1.6/libltdl/libltdl/lt__dirent.h Examining data/betaradio-1.6/libltdl/libltdl/lt__alloc.h Examining data/betaradio-1.6/libltdl/libltdl/lt__private.h Examining data/betaradio-1.6/libltdl/libltdl/lt__glibc.h Examining data/betaradio-1.6/libltdl/ltdl.c Examining data/betaradio-1.6/libltdl/slist.c Examining data/betaradio-1.6/libltdl/ltdl.h Examining data/betaradio-1.6/libltdl/lt__strl.c Examining data/betaradio-1.6/libltdl/argz.c FINAL RESULTS: data/betaradio-1.6/libltdl/libltdl/lt__private.h:117:11: [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. void * system; /* system specific data */ data/betaradio-1.6/libltdl/loaders/loadlibrary.c:170: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(wpath, filename); data/betaradio-1.6/libltdl/ltdl.c:515:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (filename, "%.*s/%s", (int) dirname_len, dirname, dlname); data/betaradio-1.6/libltdl/ltdl.c:711: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 (filename, dir_name); data/betaradio-1.6/libltdl/ltdl.c:717: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 (filename +lendir, base_name); data/betaradio-1.6/libltdl/ltdl.c:778:19: [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. int notfound = access (filename, R_OK); data/betaradio-1.6/libltdl/ltdl.c:915:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (name, "lib%s", p+2); data/betaradio-1.6/libltdl/ltdl.c:1205:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(attempt, "%s%s", filename, ext); data/betaradio-1.6/libltdl/ltdl.c:1300:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (archive_name, "%s%s.%s", libprefix, name + 3, libext); data/betaradio-1.6/libltdl/ltdl.c:1304:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (archive_name, "%s.%s", name, libext); data/betaradio-1.6/libltdl/ltdl.c:1813: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 (buf, dirnam); data/betaradio-1.6/libltdl/ltdl.c:2056: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(sym, handle->vtable->sym_prefix); data/betaradio-1.6/libltdl/ltdl.c:2057: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(sym, handle->info.name); data/betaradio-1.6/libltdl/ltdl.c:2061: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(sym, handle->info.name); data/betaradio-1.6/libltdl/ltdl.c:2065:7: [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(sym, symbol); data/betaradio-1.6/libltdl/ltdl.c:2083: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(sym, handle->vtable->sym_prefix); data/betaradio-1.6/libltdl/ltdl.c:2084:7: [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(sym, symbol); data/betaradio-1.6/libltdl/ltdl.c:2088: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(sym, symbol); data/betaradio-1.6/libltdl/loaders/loadlibrary.c:199:14: [3] (misc) LoadLibrary: Ensure that the full path to the library is specified, or current directory may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to find library path, if you aren't already. module = LoadLibrary (wpath); data/betaradio-1.6/libltdl/ltdl.c:1354: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. search_path = getenv (LTDL_SEARCHPATH_VAR); data/betaradio-1.6/libltdl/ltdl.c:1362: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. search_path = getenv (LT_MODULE_PATH_VAR); data/betaradio-1.6/libltdl/ltdl.c:1462: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. && !find_handle (getenv (LTDL_SEARCHPATH_VAR), base_name, data/betaradio-1.6/libltdl/ltdl.c:1465: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. && !find_handle (getenv (LT_MODULE_PATH_VAR), base_name, data/betaradio-1.6/libltdl/ltdl.c:1918:33: [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. is_done = foreach_dirinpath (getenv(LTDL_SEARCHPATH_VAR), 0, data/betaradio-1.6/libltdl/ltdl.c:1925:33: [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. is_done = foreach_dirinpath (getenv(LT_MODULE_PATH_VAR), 0, data/betaradio-1.6/libltdl/argz.c:69: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 (argz + *pargz_len, buf, buf_len); data/betaradio-1.6/libltdl/argz.c:166: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 (before, entry, entry_len); data/betaradio-1.6/libltdl/libltdl/lt__dirent.h:64: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 d_name[LT_FILENAME_MAX]; data/betaradio-1.6/libltdl/loaders/dyld.c:326: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 saveError[256] = "Symbol not found"; data/betaradio-1.6/libltdl/loaders/loadlibrary.c:139: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 wpath[MAX_PATH]; data/betaradio-1.6/libltdl/lt__alloc.c:86:12: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. return memcpy (newmem, mem, n); data/betaradio-1.6/libltdl/lt__dirent.c:52: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 file_spec[LT_FILENAME_MAX]; data/betaradio-1.6/libltdl/lt_error.c:35:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char error_strings[LT_ERROR_MAX][LT_ERROR_LEN_MAX + 1] = data/betaradio-1.6/libltdl/ltdl.c:749:17: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((*pfile = fopen (filename, LT_READTEXT_MODE))) data/betaradio-1.6/libltdl/ltdl.c:1016:7: [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, &str[1], (end - str) - 1); data/betaradio-1.6/libltdl/ltdl.c:1376:11: [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). file = fopen (attempt, LT_READTEXT_MODE); data/betaradio-1.6/libltdl/ltdl.c:2009: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 lsym[LT_SYMBOL_LENGTH]; data/betaradio-1.6/libltdl/ltdl.c:2064:7: [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(sym, "_LTX_"); data/betaradio-1.6/libltdl/argz.c:91: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). argz_len = 1+ strlen (str); data/betaradio-1.6/libltdl/argz.c:141: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). return argz_append (pargz, pargz_len, entry, 1+ strlen (entry)); data/betaradio-1.6/libltdl/argz.c:150:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t entry_len = 1+ strlen (entry); data/betaradio-1.6/libltdl/libltdl/lt__dirent.h:45: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). # define D_NAMLEN(dirent) (strlen((dirent)->d_name)) data/betaradio-1.6/libltdl/libltdl/lt__dirent.h:53: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). # define D_NAMLEN(dirent) (strlen((dirent)->d_name)) data/betaradio-1.6/libltdl/loaders/dyld.c:353:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (saveError, dylderror (LT__STRERROR (SYMBOL_NOT_FOUND)), 255); data/betaradio-1.6/libltdl/loaders/loadlibrary.c:179: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 (wpath); data/betaradio-1.6/libltdl/lt__alloc.c:94:39: [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 (char *) lt__memdup (string, strlen (string) +1); data/betaradio-1.6/libltdl/lt__dirent.c:102: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). entry->file_info.d_namlen = strlen (entry->file_info.d_name); data/betaradio-1.6/libltdl/lt__strl.c:61: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). length=strlen(dst); data/betaradio-1.6/libltdl/ltdl.c:1236:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (dir, canonical, dirlen); data/betaradio-1.6/libltdl/ltdl.c:1286:33: [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). archive_name = MALLOC (char, strlen (libprefix) + LT_STRLEN (name) + strlen (libext) + 2); data/betaradio-1.6/libltdl/ltdl.c:1286:73: [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). archive_name = MALLOC (char, strlen (libprefix) + LT_STRLEN (name) + strlen (libext) + 2); data/betaradio-1.6/libltdl/ltdl.c:1724:55: [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). error = argz_append (pargz, pargz_len, entry, 1 + strlen (entry)); data/betaradio-1.6/libltdl/ltdl.c:1814: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 (buf, "/"); data/betaradio-1.6/libltdl/ltdl.c:1815: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 (buf, dp->d_name, end_offset); data/betaradio-1.6/libltdl/ltdl.c:2159:48: [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). assert ((int) (before - *ppath) <= (int) strlen (*ppath)); data/betaradio-1.6/libltdl/ltdl.h:44: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). #define LT_STRLEN(s) (((s) && (s)[0]) ? strlen (s) : 0) ANALYSIS SUMMARY: Hits = 56 Lines analyzed = 9442 in approximately 0.26 seconds (36029 lines/second) Physical Source Lines of Code (SLOC) = 6473 Hits@level = [0] 11 [1] 18 [2] 13 [3] 7 [4] 18 [5] 0 Hits@level+ = [0+] 67 [1+] 56 [2+] 38 [3+] 25 [4+] 18 [5+] 0 Hits/KSLOC@level+ = [0+] 10.3507 [1+] 8.65132 [2+] 5.87054 [3+] 3.8622 [4+] 2.78078 [5+] 0 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.