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/xosd-2.2.14/src/libxosd/xosd.c Examining data/xosd-2.2.14/src/libxosd/intern.h Examining data/xosd-2.2.14/src/testprog.c Examining data/xosd-2.2.14/src/bmp_plugin/bmp_osd.c Examining data/xosd-2.2.14/src/bmp_plugin/bmp_osd.h Examining data/xosd-2.2.14/src/bmp_plugin/dlg_font.c Examining data/xosd-2.2.14/src/bmp_plugin/dlg_config_old.c Examining data/xosd-2.2.14/src/bmp_plugin/dlg_colour.c Examining data/xosd-2.2.14/src/bmp_plugin/dlg_config.c Examining data/xosd-2.2.14/src/xmms_plugin/dlg_font.c Examining data/xosd-2.2.14/src/xmms_plugin/xmms_osd.c Examining data/xosd-2.2.14/src/xmms_plugin/xmms_osd.h Examining data/xosd-2.2.14/src/xmms_plugin/dlg_config_old.c Examining data/xosd-2.2.14/src/xmms_plugin/dlg_colour.c Examining data/xosd-2.2.14/src/xmms_plugin/dlg_config.c Examining data/xosd-2.2.14/src/xosd.h Examining data/xosd-2.2.14/src/osd_cat.c Examining data/xosd-2.2.14/debian/test/01timeout.c FINAL RESULTS: data/xosd-2.2.14/src/bmp_plugin/bmp_osd.c:391:7: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(title, len, data/xosd-2.2.14/src/libxosd/xosd.c:940:13: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. if (vsnprintf(buf, sizeof(buf), string, a) >= sizeof(buf)) { data/xosd-2.2.14/src/xmms_plugin/xmms_osd.c:391:7: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(title, len, data/xosd-2.2.14/src/libxosd/xosd.c:664: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. display = getenv("DISPLAY"); data/xosd-2.2.14/src/osd_cat.c:77:7: [3] (buffer) getopt_long: 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. getopt_long(argc, argv, "l:A:a::f:c:d:o:i:s:p:O:S:u:b:P:T:hw", data/xosd-2.2.14/src/bmp_plugin/dlg_colour.c:33: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_colour[8]; data/xosd-2.2.14/src/bmp_plugin/dlg_colour.c:43: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_colour, "#%2.2x%2.2x%2.2x", data/xosd-2.2.14/src/bmp_plugin/dlg_config.c:167: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. const char *icon_names[3][3] = { data/xosd-2.2.14/src/libxosd/xosd.c:936:7: [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[XOSD_MAX_PRINTF_BUF_SIZE]; data/xosd-2.2.14/src/libxosd/xosd.c:950: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(l->string, string, ret + 1); data/xosd-2.2.14/src/osd_cat.c:46:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[1024]; data/xosd-2.2.14/src/osd_cat.c:84:29: [2] (integer) atoi: 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). scroll_age = optarg ? atoi(optarg) : delay; data/xosd-2.2.14/src/osd_cat.c:122:15: [2] (integer) atoi: 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). delay = atoi(optarg); data/xosd-2.2.14/src/osd_cat.c:125:17: [2] (integer) atoi: 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). voffset = atoi(optarg); data/xosd-2.2.14/src/osd_cat.c:128:24: [2] (integer) atoi: 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). outline_offset = atoi(optarg); data/xosd-2.2.14/src/osd_cat.c:139:17: [2] (integer) atoi: 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). hoffset = atoi(optarg); data/xosd-2.2.14/src/osd_cat.c:142:16: [2] (integer) atoi: 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). shadow = atoi(optarg); data/xosd-2.2.14/src/osd_cat.c:145:15: [2] (integer) atoi: 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). lines = atoi(optarg); data/xosd-2.2.14/src/osd_cat.c:163:20: [2] (integer) atoi: 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). percentage = atoi(optarg); data/xosd-2.2.14/src/osd_cat.c:218: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 ((fp = fopen(argv[optind], "r")) == NULL) { data/xosd-2.2.14/src/xmms_plugin/dlg_colour.c:33: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_colour[8]; data/xosd-2.2.14/src/xmms_plugin/dlg_colour.c:43: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_colour, "#%2.2x%2.2x%2.2x", data/xosd-2.2.14/src/xmms_plugin/dlg_config.c:167: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. const char *icon_names[3][3] = { data/xosd-2.2.14/src/bmp_plugin/bmp_osd.c:387:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = 13 + strlen(current.title) + (withtime ? 11 : 0); data/xosd-2.2.14/src/bmp_plugin/dlg_config.c:177:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int pixmap_path_len = strlen(pixmap_path); data/xosd-2.2.14/src/bmp_plugin/dlg_config.c:202:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). icon_name_len = strlen(icon_names[i][j]) + pixmap_path_len + 2; data/xosd-2.2.14/src/libxosd/xosd.c:86:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(osd->pipefd[0], &c, sizeof(c)); data/xosd-2.2.14/src/libxosd/xosd.c:188: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). int len = strlen(string); data/xosd-2.2.14/src/libxosd/xosd.c:210:45: [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). XmbTextExtents(osd->fontset, l->string, strlen(l->string), NULL, &rect); data/xosd-2.2.14/src/libxosd/xosd.c:947: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). ret = strlen(string); data/xosd-2.2.14/src/testprog.c:43:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(100); data/xosd-2.2.14/src/testprog.c:50:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(100); data/xosd-2.2.14/src/testprog.c:58:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(100); data/xosd-2.2.14/src/testprog.c:65:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(100); data/xosd-2.2.14/src/xmms_plugin/dlg_config.c:177:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int pixmap_path_len = strlen(pixmap_path); data/xosd-2.2.14/src/xmms_plugin/dlg_config.c:201:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). icon_name_len = strlen(icon_names[i][j]) + pixmap_path_len + 2; data/xosd-2.2.14/src/xmms_plugin/xmms_osd.c:387:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = 13 + strlen(current.title) + (withtime ? 11 : 0); ANALYSIS SUMMARY: Hits = 37 Lines analyzed = 5707 in approximately 0.19 seconds (30743 lines/second) Physical Source Lines of Code (SLOC) = 3916 Hits@level = [0] 23 [1] 14 [2] 18 [3] 2 [4] 3 [5] 0 Hits@level+ = [0+] 60 [1+] 37 [2+] 23 [3+] 5 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 15.3218 [1+] 9.44842 [2+] 5.87334 [3+] 1.27681 [4+] 0.766088 [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.