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/dunst-1.5.0/config.h Examining data/dunst-1.5.0/main.c Examining data/dunst-1.5.0/src/dbus.c Examining data/dunst-1.5.0/src/dbus.h Examining data/dunst-1.5.0/src/draw.c Examining data/dunst-1.5.0/src/draw.h Examining data/dunst-1.5.0/src/dunst.c Examining data/dunst-1.5.0/src/dunst.h Examining data/dunst-1.5.0/src/icon.c Examining data/dunst-1.5.0/src/icon.h Examining data/dunst-1.5.0/src/log.c Examining data/dunst-1.5.0/src/log.h Examining data/dunst-1.5.0/src/markup.c Examining data/dunst-1.5.0/src/markup.h Examining data/dunst-1.5.0/src/menu.c Examining data/dunst-1.5.0/src/menu.h Examining data/dunst-1.5.0/src/notification.c Examining data/dunst-1.5.0/src/notification.h Examining data/dunst-1.5.0/src/option_parser.c Examining data/dunst-1.5.0/src/option_parser.h Examining data/dunst-1.5.0/src/queues.c Examining data/dunst-1.5.0/src/queues.h Examining data/dunst-1.5.0/src/rules.c Examining data/dunst-1.5.0/src/rules.h Examining data/dunst-1.5.0/src/settings.c Examining data/dunst-1.5.0/src/settings.h Examining data/dunst-1.5.0/src/utils.c Examining data/dunst-1.5.0/src/utils.h Examining data/dunst-1.5.0/src/x11/screen.c Examining data/dunst-1.5.0/src/x11/screen.h Examining data/dunst-1.5.0/src/x11/x.c Examining data/dunst-1.5.0/src/x11/x.h Examining data/dunst-1.5.0/test/dbus.c Examining data/dunst-1.5.0/test/dunst.c Examining data/dunst-1.5.0/test/greatest.h Examining data/dunst-1.5.0/test/helpers.c Examining data/dunst-1.5.0/test/helpers.h Examining data/dunst-1.5.0/test/icon.c Examining data/dunst-1.5.0/test/log.c Examining data/dunst-1.5.0/test/markup.c Examining data/dunst-1.5.0/test/menu.c Examining data/dunst-1.5.0/test/misc.c Examining data/dunst-1.5.0/test/notification.c Examining data/dunst-1.5.0/test/option_parser.c Examining data/dunst-1.5.0/test/queues.c Examining data/dunst-1.5.0/test/queues.h Examining data/dunst-1.5.0/test/test.c Examining data/dunst-1.5.0/test/utils.c Examining data/dunst-1.5.0/dunstify.c FINAL RESULTS: data/dunst-1.5.0/src/icon.c:16: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, R_OK) != -1); data/dunst-1.5.0/src/notification.c:134:43: [4] (shell) execlp: 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. int ret = execlp(script, data/dunst-1.5.0/test/greatest.h:128:26: [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 GREATEST_FPRINTF fprintf data/dunst-1.5.0/src/utils.c:241:26: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. home_directory = getenv("HOME"); data/dunst-1.5.0/test/icon.c:17:28: [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. const char *home = g_get_home_dir(); data/dunst-1.5.0/test/option_parser.c:125: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. char *home = getenv("HOME"); data/dunst-1.5.0/test/option_parser.c:176: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. char *home = getenv("HOME"); data/dunst-1.5.0/test/option_parser.c:317: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. char *home = getenv("HOME"); data/dunst-1.5.0/test/test.c:27:22: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. char *prog = realpath(argv[0], NULL); data/dunst-1.5.0/test/test.c:36:27: [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. const char *log = getenv("DUNST_TEST_LOG"); data/dunst-1.5.0/test/utils.c:141: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. char *home = getenv("HOME"); data/dunst-1.5.0/dunstify.c:266:53: [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). notify_notification_set_hint_int32(n, name, atoi(value)); data/dunst-1.5.0/src/icon.c:355:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data_chk + (i*rowstride_short), data/dunst-1.5.0/src/menu.c:48: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 error_buf[120]; data/dunst-1.5.0/src/menu.c:118: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(argv, settings.browser_cmd, argc * sizeof(char*)); data/dunst-1.5.0/src/menu.c:255: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[1024]; data/dunst-1.5.0/src/notification.c:422: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 pg[16]; data/dunst-1.5.0/src/notification.c:465:33: [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(pg, "[%3d%%]", n->progress); data/dunst-1.5.0/src/notification.c:475:33: [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(pg, "%d", n->progress); data/dunst-1.5.0/src/option_parser.c:297: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). return atoi(value); data/dunst-1.5.0/src/option_parser.c:538: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). return atoi(str); data/dunst-1.5.0/src/settings.c:45: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). f = fopen(path, "r"); data/dunst-1.5.0/src/settings.c:52: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(path, "r"); data/dunst-1.5.0/src/settings.c:69:39: [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). config_file = fopen(cmdline_config_path, "r"); data/dunst-1.5.0/src/settings.h:47: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 *icons[3]; data/dunst-1.5.0/src/utils.c:55:17: [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, buf, pos); data/dunst-1.5.0/src/utils.c:58: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(tmp + pos, repl, repl_len); data/dunst-1.5.0/src/x11/screen.c:229: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 err_buf[BUFSIZ]; data/dunst-1.5.0/src/x11/screen.c:435: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 err_buf[BUFSIZ]; data/dunst-1.5.0/src/x11/x.c:143: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 astr[sizeof("_NET_WM_CM_S") / sizeof(char) + 8]; data/dunst-1.5.0/src/x11/x.c:146:9: [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(astr, "_NET_WM_CM_S%i", win->cur_screen); data/dunst-1.5.0/src/x11/x.c:468: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 err_buf[BUFSIZ]; data/dunst-1.5.0/src/x11/x.c:809: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 err_buf[BUFSIZ]; data/dunst-1.5.0/test/dbus.c:380: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 msg[50]; data/dunst-1.5.0/test/dbus.c:426: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 msg[50]; data/dunst-1.5.0/test/dbus.c:570: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 msg[50]; data/dunst-1.5.0/test/greatest.h:221: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. unsigned char pad_0[6]; data/dunst-1.5.0/test/greatest.h:235: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. unsigned char pad_0[2]; data/dunst-1.5.0/test/greatest.h:269:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name_buf[GREATEST_TESTNAME_BUF_SIZE]; data/dunst-1.5.0/test/greatest.h:281: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. unsigned char pad_2[4]; data/dunst-1.5.0/test/notification.c:88:9: [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(str, "Markup %a preserved"); data/dunst-1.5.0/test/notification.c:94:9: [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(str, "Markup %a escaped"); data/dunst-1.5.0/test/notification.c:100:9: [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(str, "Markup %a"); data/dunst-1.5.0/test/option_parser.c:391:29: [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 *config_file = fopen(config_path, "r"); data/dunst-1.5.0/test/test.c:37:32: [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). bool printlog = log && atoi(log) ? true : false; data/dunst-1.5.0/test/utils.c:8:9: [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(text, "a aa aaa"); data/dunst-1.5.0/test/utils.c:11:9: [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(text, "Nothing to replace"); data/dunst-1.5.0/test/utils.c:31:9: [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(text, "aaaaa"); data/dunst-1.5.0/test/utils.c:37:9: [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(text, "Nothing to replace"); data/dunst-1.5.0/test/utils.c:40:9: [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(text, "Reverse this"); data/dunst-1.5.0/test/utils.c:43:9: [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(text, "abcdabc"); data/dunst-1.5.0/test/utils.c:114:9: [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(text, "A <simple> string_strip_delimited test"); data/dunst-1.5.0/test/utils.c:118:9: [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(text, "Remove <blink>html <b><i>tags</i></b></blink>"); data/dunst-1.5.0/test/utils.c:122:9: [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(text, "Calls|with|identical|delimiters|are|handled|properly"); data/dunst-1.5.0/test/utils.c:126:9: [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(text, "<Return empty string if there is nothing left>"); data/dunst-1.5.0/test/utils.c:130:9: [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(text, "Nothing is done if there are no delimiters in the string"); data/dunst-1.5.0/dunstify.c:55: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 (strlen(iter->data) > 0) { data/dunst-1.5.0/src/markup.c:82:60: [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). string_replace_at(*str, tag1-*str, strlen(tag1), ""); data/dunst-1.5.0/src/markup.c:86:57: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int repl_len = (tag2 - tag1) + strlen("</a>"); data/dunst-1.5.0/src/markup.c:112: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). text_len = strlen(tag1_end+1); data/dunst-1.5.0/src/markup.c:117: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). repl_len += tag2 ? strlen("</a>") : 0; data/dunst-1.5.0/src/markup.c:152:61: [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). string_replace_at(*str, start-*str, strlen(start), ""); data/dunst-1.5.0/src/markup.c:165: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). alt_e = strstr(alt_s + strlen("alt=\""), "\""); data/dunst-1.5.0/src/markup.c:167: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). src_e = strstr(src_s + strlen("src=\""), "\""); data/dunst-1.5.0/src/markup.c:170: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). alt_s = alt_s ? alt_s + strlen("alt=\"") : NULL; data/dunst-1.5.0/src/markup.c:171: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). src_s = src_s ? src_s + strlen("src=\"") : NULL; data/dunst-1.5.0/src/markup.c:177:59: [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). && ( (alt_s < src_s && alt_e < src_s-strlen("src=\"") && src_e < end) data/dunst-1.5.0/src/markup.c:178:59: [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). ||(src_s < alt_s && src_e < alt_s-strlen("alt=\"") && alt_e < end)) ) { data/dunst-1.5.0/src/markup.c:184:105: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). } else if (alt_s && alt_e && alt_e < end && (!src_s || src_s < alt_s || alt_e < src_s - strlen("src=\""))) { data/dunst-1.5.0/src/markup.c:188:105: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). } else if (src_s && src_e && src_e < end && (!alt_s || alt_s < src_s || src_e < alt_s - strlen("alt=\""))) { data/dunst-1.5.0/src/markup.c:299: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). match = str + pos + strlen("&"); data/dunst-1.5.0/src/menu.c:275: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). size_t wlen = strlen(dmenu_input); data/dunst-1.5.0/src/menu.c:281:32: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t rlen = read(dmenu_to_dunst, buf, sizeof(buf)); data/dunst-1.5.0/src/notification.c:294:38: [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(*needle - *haystack < strlen(*haystack) - 1); data/dunst-1.5.0/src/notification.c:303:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). *needle = *haystack + pos + strlen(input); data/dunst-1.5.0/src/option_parser.c:390:22: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. if (!equal) { data/dunst-1.5.0/src/utils.c:47:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). buf_len = strlen(buf); data/dunst-1.5.0/src/utils.c:48:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). repl_len = strlen(repl); data/dunst-1.5.0/src/utils.c:79: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). needle_len = strlen(needle); data/dunst-1.5.0/src/utils.c:85:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). repl_len = strlen(replacement); data/dunst-1.5.0/src/utils.c:120: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). size_t len = strlen(value); data/dunst-1.5.0/src/x11/x.c:582: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). strlen(title)); data/dunst-1.5.0/test/dbus.c:273:17: [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(500); data/dunst-1.5.0/test/dbus.c:724:17: [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(500); data/dunst-1.5.0/test/dbus.c:759:17: [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(500); data/dunst-1.5.0/test/greatest.h:197:24: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. greatest_equal_cb *equal; data/dunst-1.5.0/test/greatest.h:689: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). size_t filter_len = filter ? strlen(filter) : 0; \ data/dunst-1.5.0/test/greatest.h:705: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). size_t len = strlen(name), size = sizeof(g->name_buf); \ data/dunst-1.5.0/test/greatest.h:707:11: [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. (void)strncat(g->name_buf, name, size - 1); \ data/dunst-1.5.0/test/greatest.h:710: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(&g->name_buf[len+1], g->name_suffix, size-(len+2)); \ data/dunst-1.5.0/test/greatest.h:884:21: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. eq = type_info->equal(exp, got, udata); \ data/dunst-1.5.0/test/icon.c:20:38: [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 (0 != strncmp(home, base, strlen(home))) { data/dunst-1.5.0/test/icon.c:26:43: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). path = string_replace_at(path, 0, strlen(home), "~"); data/dunst-1.5.0/test/utils.c:14:9: [1] (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 character. strcpy(text, ""); data/dunst-1.5.0/test/utils.c:34:9: [1] (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 character. strcpy(text, ""); ANALYSIS SUMMARY: Hits = 95 Lines analyzed = 13562 in approximately 0.39 seconds (35074 lines/second) Physical Source Lines of Code (SLOC) = 9960 Hits@level = [0] 42 [1] 39 [2] 45 [3] 8 [4] 3 [5] 0 Hits@level+ = [0+] 137 [1+] 95 [2+] 56 [3+] 11 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 13.755 [1+] 9.53815 [2+] 5.62249 [3+] 1.10442 [4+] 0.301205 [5+] 0 Dot directories skipped = 2 (--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.