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/vagalume-0.8.6/src/vgl-main-menu-gtk.c Examining data/vagalume-0.8.6/src/playlist.h Examining data/vagalume-0.8.6/src/vgl-object.c Examining data/vagalume-0.8.6/src/uimisc.c Examining data/vagalume-0.8.6/src/scrobbler.c Examining data/vagalume-0.8.6/src/imstatus.h Examining data/vagalume-0.8.6/src/audio.h Examining data/vagalume-0.8.6/src/playlist.c Examining data/vagalume-0.8.6/src/vgl-main-menu-hildon22.c Examining data/vagalume-0.8.6/src/uimisc.h Examining data/vagalume-0.8.6/src/radio.c Examining data/vagalume-0.8.6/src/protocol.c Examining data/vagalume-0.8.6/src/vgl-sb-plugin.h Examining data/vagalume-0.8.6/src/compat.c Examining data/vagalume-0.8.6/src/http.h Examining data/vagalume-0.8.6/src/controller.h Examining data/vagalume-0.8.6/src/protocol.h Examining data/vagalume-0.8.6/src/connection.h Examining data/vagalume-0.8.6/src/vgl-bookmark-window.h Examining data/vagalume-0.8.6/src/vgl-tray-icon.c Examining data/vagalume-0.8.6/src/dlwin.h Examining data/vagalume-0.8.6/src/compat.h Examining data/vagalume-0.8.6/src/userconfig.h Examining data/vagalume-0.8.6/src/imstatus.c Examining data/vagalume-0.8.6/src/lastfm-ws.h Examining data/vagalume-0.8.6/src/scrobbler.h Examining data/vagalume-0.8.6/src/vgl-bookmark-window.c Examining data/vagalume-0.8.6/src/util.c Examining data/vagalume-0.8.6/src/xmlrpc.h Examining data/vagalume-0.8.6/src/dbus.h Examining data/vagalume-0.8.6/src/vgl-main-window.h Examining data/vagalume-0.8.6/src/radio.h Examining data/vagalume-0.8.6/src/vgl-main-menu.h Examining data/vagalume-0.8.6/src/connection.c Examining data/vagalume-0.8.6/src/vgl-tray-icon.h Examining data/vagalume-0.8.6/src/vgl-server.h Examining data/vagalume-0.8.6/src/lastfm-ws.c Examining data/vagalume-0.8.6/src/vgl-sb-plugin.c Examining data/vagalume-0.8.6/src/dbus.c Examining data/vagalume-0.8.6/src/md5/md5.c Examining data/vagalume-0.8.6/src/md5/md5.h Examining data/vagalume-0.8.6/src/uimisc-gtk.c Examining data/vagalume-0.8.6/src/vgl-bookmark-mgr.c Examining data/vagalume-0.8.6/src/util.h Examining data/vagalume-0.8.6/src/userconfig.c Examining data/vagalume-0.8.6/src/controller.c Examining data/vagalume-0.8.6/src/dlwin.c Examining data/vagalume-0.8.6/src/audio.c Examining data/vagalume-0.8.6/src/vgl-main-window.c Examining data/vagalume-0.8.6/src/xmlrpc.c Examining data/vagalume-0.8.6/src/vgl-object.h Examining data/vagalume-0.8.6/src/uimisc-hildon22.c Examining data/vagalume-0.8.6/src/vgl-bookmark-mgr.h Examining data/vagalume-0.8.6/src/globaldefs.h Examining data/vagalume-0.8.6/src/main.c Examining data/vagalume-0.8.6/src/http.c Examining data/vagalume-0.8.6/src/vgl-server.c FINAL RESULTS: data/vagalume-0.8.6/src/util.c:102:17: [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. return !access(filename, F_OK); data/vagalume-0.8.6/src/main.c:94:23: [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 ((opt = getopt(argc, argv, "d:s:h")) != -1) { data/vagalume-0.8.6/src/util.c:210:27: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. homedir = g_get_home_dir (); data/vagalume-0.8.6/src/dlwin.c:45: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. char text[bufsize]; data/vagalume-0.8.6/src/dlwin.c:135: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. char text[textsize]; data/vagalume-0.8.6/src/http.c:114:9: [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(dstbuf->buffer + writefrom, src, datasize); data/vagalume-0.8.6/src/http.c:246:21: [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). f = fopen(filename, "wb"); data/vagalume-0.8.6/src/lastfm-ws.c:259:57: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). atol ((char *) err); data/vagalume-0.8.6/src/md5/md5.c:52: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. static const char *const test[7] = { data/vagalume-0.8.6/src/md5/md5.c:203: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(xbuf, data, 64); data/vagalume-0.8.6/src/md5/md5.c:354: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(pms->buf + offset, p, copy); data/vagalume-0.8.6/src/md5/md5.c:368: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(pms->buf, p, left); data/vagalume-0.8.6/src/radio.c:55: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. char value[4]; data/vagalume-0.8.6/src/uimisc.c:497: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. char str[4]; data/vagalume-0.8.6/src/userconfig.c:220: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. char buf[bufsize]; data/vagalume-0.8.6/src/userconfig.c:224:35: [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 (cfgfile != NULL) fd = fopen(cfgfile, "r"); data/vagalume-0.8.6/src/util.c:35: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. unsigned char digest[digestlen]; data/vagalume-0.8.6/src/util.c:44:17: [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(hexdigest + 2*i, "%02x", digest[i]); data/vagalume-0.8.6/src/util.c:226:16: [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 lang[3] = ""; data/vagalume-0.8.6/src/util.c:394: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. char strvalue[maxlen]; data/vagalume-0.8.6/src/util.c:502:27: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). *value = strval ? atol (strval) : -1; data/vagalume-0.8.6/src/vgl-main-window.c:258: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. char count[bufsize]; data/vagalume-0.8.6/src/md5/md5.c:70: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). md5_append(&state, (const md5_byte_t *)test[i], strlen(test[i])); data/vagalume-0.8.6/src/uimisc-gtk.c:224: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). gboolean userpw = (user && pw && strlen(user) > 0 && strlen(pw) > 0); data/vagalume-0.8.6/src/uimisc-gtk.c:224:62: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). gboolean userpw = (user && pw && strlen(user) > 0 && strlen(pw) > 0); data/vagalume-0.8.6/src/uimisc-gtk.c:1029: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). int len = strlen(current); data/vagalume-0.8.6/src/uimisc-hildon22.c:66: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). gboolean userpw = (user && pw && strlen (user) > 0 && strlen (pw) > 0); data/vagalume-0.8.6/src/uimisc-hildon22.c:66:63: [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). gboolean userpw = (user && pw && strlen (user) > 0 && strlen (pw) > 0); data/vagalume-0.8.6/src/uimisc-hildon22.c:876: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_string_truncate (tags, strlen (tags->str)); data/vagalume-0.8.6/src/userconfig.c:232: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). int len = strlen(buf); data/vagalume-0.8.6/src/util.c:40: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). md5_append(&state, (const md5_byte_t *)str, strlen(str)); data/vagalume-0.8.6/src/util.c:117: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). int oldlen = strlen(old); data/vagalume-0.8.6/src/util.c:118: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). int newlen = strlen(new); data/vagalume-0.8.6/src/util.c:232: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). if (env != NULL && strlen(env) > 1) { data/vagalume-0.8.6/src/util.c:233:25: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(lang, env, 2); data/vagalume-0.8.6/src/util.c:236:25: [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(lang, "en", 3); ANALYSIS SUMMARY: Hits = 36 Lines analyzed = 17510 in approximately 0.37 seconds (47853 lines/second) Physical Source Lines of Code (SLOC) = 13600 Hits@level = [0] 10 [1] 14 [2] 19 [3] 2 [4] 1 [5] 0 Hits@level+ = [0+] 46 [1+] 36 [2+] 22 [3+] 3 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 3.38235 [1+] 2.64706 [2+] 1.61765 [3+] 0.220588 [4+] 0.0735294 [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.