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/marco-1.24.1/src/compositor/compositor-private.h Examining data/marco-1.24.1/src/compositor/compositor-xrender.c Examining data/marco-1.24.1/src/compositor/compositor-xrender.h Examining data/marco-1.24.1/src/compositor/compositor.c Examining data/marco-1.24.1/src/core/async-getprop.c Examining data/marco-1.24.1/src/core/async-getprop.h Examining data/marco-1.24.1/src/core/atomnames.h Examining data/marco-1.24.1/src/core/bell.c Examining data/marco-1.24.1/src/core/bell.h Examining data/marco-1.24.1/src/core/boxes.c Examining data/marco-1.24.1/src/core/constraints.c Examining data/marco-1.24.1/src/core/constraints.h Examining data/marco-1.24.1/src/core/core.c Examining data/marco-1.24.1/src/core/delete.c Examining data/marco-1.24.1/src/core/display-private.h Examining data/marco-1.24.1/src/core/display.c Examining data/marco-1.24.1/src/core/edge-resistance.c Examining data/marco-1.24.1/src/core/edge-resistance.h Examining data/marco-1.24.1/src/core/effects.c Examining data/marco-1.24.1/src/core/effects.h Examining data/marco-1.24.1/src/core/errors.c Examining data/marco-1.24.1/src/core/eventqueue.c Examining data/marco-1.24.1/src/core/eventqueue.h Examining data/marco-1.24.1/src/core/frame-private.h Examining data/marco-1.24.1/src/core/frame.c Examining data/marco-1.24.1/src/core/group-private.h Examining data/marco-1.24.1/src/core/group-props.c Examining data/marco-1.24.1/src/core/group-props.h Examining data/marco-1.24.1/src/core/group.c Examining data/marco-1.24.1/src/core/group.h Examining data/marco-1.24.1/src/core/iconcache.c Examining data/marco-1.24.1/src/core/iconcache.h Examining data/marco-1.24.1/src/core/keybindings.c Examining data/marco-1.24.1/src/core/keybindings.h Examining data/marco-1.24.1/src/core/main.c Examining data/marco-1.24.1/src/core/marco-Xatomtype.h Examining data/marco-1.24.1/src/core/place.c Examining data/marco-1.24.1/src/core/place.h Examining data/marco-1.24.1/src/core/prefs.c Examining data/marco-1.24.1/src/core/schema-bindings.c Examining data/marco-1.24.1/src/core/screen-private.h Examining data/marco-1.24.1/src/core/screen.c Examining data/marco-1.24.1/src/core/session.c Examining data/marco-1.24.1/src/core/session.h Examining data/marco-1.24.1/src/core/stack.c Examining data/marco-1.24.1/src/core/stack.h Examining data/marco-1.24.1/src/core/testasyncgetprop.c Examining data/marco-1.24.1/src/core/testboxes.c Examining data/marco-1.24.1/src/core/util.c Examining data/marco-1.24.1/src/core/window-private.h Examining data/marco-1.24.1/src/core/window-props.c Examining data/marco-1.24.1/src/core/window-props.h Examining data/marco-1.24.1/src/core/window.c Examining data/marco-1.24.1/src/core/workspace.c Examining data/marco-1.24.1/src/core/workspace.h Examining data/marco-1.24.1/src/core/xprops.c Examining data/marco-1.24.1/src/include/all-keybindings.h Examining data/marco-1.24.1/src/include/boxes.h Examining data/marco-1.24.1/src/include/common.h Examining data/marco-1.24.1/src/include/compositor.h Examining data/marco-1.24.1/src/include/core.h Examining data/marco-1.24.1/src/include/display.h Examining data/marco-1.24.1/src/include/errors.h Examining data/marco-1.24.1/src/include/frame.h Examining data/marco-1.24.1/src/include/main.h Examining data/marco-1.24.1/src/include/prefs.h Examining data/marco-1.24.1/src/include/resizepopup.h Examining data/marco-1.24.1/src/include/screen.h Examining data/marco-1.24.1/src/include/tabpopup.h Examining data/marco-1.24.1/src/include/tile-preview.h Examining data/marco-1.24.1/src/include/types.h Examining data/marco-1.24.1/src/include/ui.h Examining data/marco-1.24.1/src/include/util.h Examining data/marco-1.24.1/src/include/window.h Examining data/marco-1.24.1/src/include/xprops.h Examining data/marco-1.24.1/src/tools/marco-message.c Examining data/marco-1.24.1/src/tools/marco-window-demo.c Examining data/marco-1.24.1/src/ui/draw-workspace.c Examining data/marco-1.24.1/src/ui/draw-workspace.h Examining data/marco-1.24.1/src/ui/fixedtip.c Examining data/marco-1.24.1/src/ui/fixedtip.h Examining data/marco-1.24.1/src/ui/frames.c Examining data/marco-1.24.1/src/ui/frames.h Examining data/marco-1.24.1/src/ui/gradient.c Examining data/marco-1.24.1/src/ui/gradient.h Examining data/marco-1.24.1/src/ui/menu.c Examining data/marco-1.24.1/src/ui/menu.h Examining data/marco-1.24.1/src/ui/metaaccellabel.c Examining data/marco-1.24.1/src/ui/metaaccellabel.h Examining data/marco-1.24.1/src/ui/preview-widget.c Examining data/marco-1.24.1/src/ui/preview-widget.h Examining data/marco-1.24.1/src/ui/resizepopup.c Examining data/marco-1.24.1/src/ui/tabpopup.c Examining data/marco-1.24.1/src/ui/testgradient.c Examining data/marco-1.24.1/src/ui/theme-parser.c Examining data/marco-1.24.1/src/ui/theme-parser.h Examining data/marco-1.24.1/src/ui/theme-viewer.c Examining data/marco-1.24.1/src/ui/theme.c Examining data/marco-1.24.1/src/ui/theme.h Examining data/marco-1.24.1/src/ui/tile-preview.c Examining data/marco-1.24.1/src/ui/ui.c Examining data/marco-1.24.1/src/wm-tester/focus-window.c Examining data/marco-1.24.1/src/wm-tester/main.c Examining data/marco-1.24.1/src/wm-tester/test-gravity.c Examining data/marco-1.24.1/src/wm-tester/test-resizing.c Examining data/marco-1.24.1/src/wm-tester/test-size-hints.c FINAL RESULTS: data/marco-1.24.1/src/core/main.c:457:7: [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. if (g_get_home_dir ()) data/marco-1.24.1/src/core/main.c:458:16: [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. if (chdir (g_get_home_dir ()) < 0) data/marco-1.24.1/src/core/main.c:460:21: [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. g_get_home_dir ()); data/marco-1.24.1/src/core/session.c:350:30: [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. prop5val.value = (char*) g_get_home_dir (); data/marco-1.24.1/src/core/session.c:1083:35: [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. session_file = g_strconcat (g_get_home_dir (), data/marco-1.24.1/src/core/testasyncgetprop.c:280: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. if (getenv ("MARCO_SYNC") != NULL) data/marco-1.24.1/src/core/testboxes.c:37:3: [3] (random) srand: 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. srand(time(NULL)); data/marco-1.24.1/src/ui/theme-parser.c:4371:37: [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. theme_dir = g_build_filename (g_get_home_dir (), data/marco-1.24.1/src/wm-tester/main.c:112:15: [3] (random) g_random_int_range: 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. n_windows = g_random_int_range (0, create_count); data/marco-1.24.1/src/wm-tester/main.c:125:24: [3] (random) g_random_int_range: 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. g_random_int_range (0, data/marco-1.24.1/src/wm-tester/main.c:127:24: [3] (random) g_random_int_range: 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. g_random_int_range (0, data/marco-1.24.1/src/wm-tester/main.c:135:15: [3] (random) g_random_int_range: 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. t = g_random_int_range (- (len / 3), len); data/marco-1.24.1/src/wm-tester/main.c:161:19: [3] (random) g_random_int_range: 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. n_windows = g_random_int_range (0, destroy_count); data/marco-1.24.1/src/wm-tester/main.c:168:33: [3] (random) g_random_int_range: 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. g_random_int_range (0, len)); data/marco-1.24.1/src/compositor/compositor-xrender.c:885:15: [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 (&pixmap, prop, 4); data/marco-1.24.1/src/core/boxes.c:57: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 rect_string[RECT_LENGTH]; data/marco-1.24.1/src/core/boxes.c:110: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 rect_string[EDGE_LENGTH]; data/marco-1.24.1/src/core/constraints.c:1368: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 spanning_region[1 + 28 * g_list_length (region_spanning_rectangles)]; data/marco-1.24.1/src/core/delete.c:155: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 buf[257]; data/marco-1.24.1/src/core/edge-resistance.c:786: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 big_buffer[(EDGE_LENGTH+2)*max_edges]; data/marco-1.24.1/src/core/main.c:121: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 yearbuffer[256]; data/marco-1.24.1/src/core/main.c:202: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 buf[256]; data/marco-1.24.1/src/core/place.c:595: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 xinerama_location_string[RECT_LENGTH]; data/marco-1.24.1/src/core/prefs.c:140:8: [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 *commands[MAX_COMMANDS] = { NULL, }; data/marco-1.24.1/src/core/prefs.c:144:8: [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 *workspace_names[MAX_REASONABLE_WORKSPACES] = { NULL, }; data/marco-1.24.1/src/core/prefs.c:2003:11: [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). i = atoi (p); data/marco-1.24.1/src/core/prefs.c:2114:7: [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). i = atoi (p); data/marco-1.24.1/src/core/schema-bindings.c:98: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 buffer[10240]; data/marco-1.24.1/src/core/schema-bindings.c:100: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). source_file = fopen(source_filename, "r"); data/marco-1.24.1/src/core/schema-bindings.c:108: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). target_file = fopen(target_filename, "w"); data/marco-1.24.1/src/core/screen.c:234: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. unsigned char hints[16]; data/marco-1.24.1/src/core/screen.c:339: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 buf[128]; data/marco-1.24.1/src/core/screen.c:367: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 (buf, "WM_S%d", number); data/marco-1.24.1/src/core/session.c:234: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 buf[256]; data/marco-1.24.1/src/core/session.c:309: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 pid[32]; data/marco-1.24.1/src/core/session.c:337:5: [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 (pid, "%d", getpid ()); data/marco-1.24.1/src/core/session.c:590: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 *restartv[10]; data/marco-1.24.1/src/core/session.c:591: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 *clonev[10]; data/marco-1.24.1/src/core/session.c:592: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 *discardv[10]; data/marco-1.24.1/src/core/session.c:855: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). outfile = fopen (full_save_file (), "w"); data/marco-1.24.1/src/core/session.c:1262:46: [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). pd->info->stack_position = atoi (val); data/marco-1.24.1/src/core/session.c:1296:51: [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). GINT_TO_POINTER (atoi (attribute_values[i]))); data/marco-1.24.1/src/core/session.c:1342:44: [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). pd->info->saved_rect.x = atoi (val); data/marco-1.24.1/src/core/session.c:1350:44: [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). pd->info->saved_rect.y = atoi (val); data/marco-1.24.1/src/core/session.c:1358:48: [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). pd->info->saved_rect.width = atoi (val); data/marco-1.24.1/src/core/session.c:1366:49: [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). pd->info->saved_rect.height = atoi (val); data/marco-1.24.1/src/core/session.c:1408:36: [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). pd->info->rect.x = atoi (val); data/marco-1.24.1/src/core/session.c:1413:36: [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). pd->info->rect.y = atoi (val); data/marco-1.24.1/src/core/session.c:1418:40: [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). pd->info->rect.width = atoi (val); data/marco-1.24.1/src/core/session.c:1423:41: [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). pd->info->rect.height = atoi (val); data/marco-1.24.1/src/core/testasyncgetprop.c:91: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 buf[64]; data/marco-1.24.1/src/core/testboxes.c:397: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 rect1[RECT_LENGTH], rect2[RECT_LENGTH]; data/marco-1.24.1/src/core/testboxes.c:398: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 region_list[(RECT_LENGTH + 2) * g_list_length (region)]; data/marco-1.24.1/src/core/testboxes.c:511: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. char region_list[(RECT_LENGTH + 2) * g_list_length (region)]; data/marco-1.24.1/src/core/testboxes.c:529: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 region_list2[(RECT_LENGTH + 2) * g_list_length (region)]; data/marco-1.24.1/src/core/testboxes.c:646: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 region_list[(RECT_LENGTH+2) * g_list_length (region)]; data/marco-1.24.1/src/core/testboxes.c:647: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_list[ (RECT_LENGTH+2) * g_list_length (tmp)]; data/marco-1.24.1/src/core/testboxes.c:1105: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 big_buffer1[(EDGE_LENGTH+2)*FUDGE], big_buffer2[(EDGE_LENGTH+2)*FUDGE]; data/marco-1.24.1/src/core/testboxes.c:1194: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 big_buffer1[(EDGE_LENGTH+2)*FUDGE], big_buffer2[(EDGE_LENGTH+2)*FUDGE]; data/marco-1.24.1/src/core/window-props.c:435: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 hostname[HOST_NAME_MAX + 1]; data/marco-1.24.1/src/core/xprops.c:335: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 (*hints_p, results->prop, MIN (real_size, max_size)); data/marco-1.24.1/src/ui/gradient.c:135: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 (&(pixels[i*rowstride]), pixels, rowstride); data/marco-1.24.1/src/ui/gradient.c:203: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 (&(ptr[j*4]), ptr, j*4); data/marco-1.24.1/src/ui/gradient.c:204: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 (&(ptr[j*4]), ptr, (width - j)*4); data/marco-1.24.1/src/ui/gradient.c:269: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 (&(pixels[j]), &ptr[4*(int)offset], width); data/marco-1.24.1/src/ui/gradient.c:351: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 (&(pixels[i*rowstride]), pixels, rowstride); data/marco-1.24.1/src/ui/gradient.c:409:13: [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 (&(ptr[x*4]), ptr, x*4); data/marco-1.24.1/src/ui/gradient.c:410: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 (&(ptr[x*4]), ptr, (width - x)*4); data/marco-1.24.1/src/ui/gradient.c:436: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 (&(ptr[x*4]), ptr, x*4); data/marco-1.24.1/src/ui/gradient.c:437: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 (&(ptr[x*4]), ptr, (width - x)*4); data/marco-1.24.1/src/ui/gradient.c:443: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 (ptr, tmp, rowstride); data/marco-1.24.1/src/ui/gradient.c:507: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 (&(pixels[j]), &ptr[3*(int)offset], width); data/marco-1.24.1/src/ui/gradient.c:826: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 (&(ptr[j*4]), ptr, j*4); data/marco-1.24.1/src/ui/gradient.c:827: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 (&(ptr[j*4]), ptr, (width - j)*4); data/marco-1.24.1/src/ui/theme-parser.c:3499: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). version = 1000 * atoi (major_str); data/marco-1.24.1/src/ui/theme-parser.c:3502: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). version += atoi (minor_str + 1); data/marco-1.24.1/src/ui/theme.c:1999: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[7] = { '\0' }; data/marco-1.24.1/src/ui/theme.c:3443: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 (dest_pixels + dest_rowstride * i, pixels, n_channels * width); data/marco-1.24.1/src/wm-tester/test-gravity.c:237:15: [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[256]; data/marco-1.24.1/src/wm-tester/test-gravity.c:244:15: [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, data/marco-1.24.1/src/wm-tester/test-gravity.c:252:15: [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, data/marco-1.24.1/src/compositor/compositor-xrender.c:1584:7: [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 * 1000); data/marco-1.24.1/src/core/effects.c:570: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). text_length = strlen (text); data/marco-1.24.1/src/core/screen.c:1957:30: [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 (name) + 1); data/marco-1.24.1/src/core/session.c:318: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). prop1val.length = strlen ("marco"); data/marco-1.24.1/src/core/session.c:328: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). prop2val.length = strlen (prop2val.value); data/marco-1.24.1/src/core/session.c:343: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). prop4val.length = strlen (prop4val.value); data/marco-1.24.1/src/core/session.c:351: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). prop5val.length = strlen (prop5val.value); data/marco-1.24.1/src/core/session.c:617:30: [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). prop1.vals[i].length = strlen (restartv[i]); data/marco-1.24.1/src/core/session.c:637:30: [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). prop2.vals[i].length = strlen (clonev[i]); data/marco-1.24.1/src/core/session.c:661:30: [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). prop3.vals[i].length = strlen (discardv[i]); data/marco-1.24.1/src/core/testasyncgetprop.c:136: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). s = malloc (strlen (str) + 1); data/marco-1.24.1/src/core/testasyncgetprop.c:142: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). g_strlcpy (s, str, (strlen (str) + 1)); data/marco-1.24.1/src/core/xprops.c:506: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). p = p + strlen (p) + 1; data/marco-1.24.1/src/core/xprops.c:549: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). 8, PropModeReplace, (guchar*) val, strlen (val)); data/marco-1.24.1/src/core/xprops.c:822: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). len_name = strlen ((char *) results->prop); data/marco-1.24.1/src/core/xprops.c:835: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). len_class = strlen ((char *)results->prop + len_name + 1); data/marco-1.24.1/src/core/xprops.c:1139: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). xmalloc_new_str = ag_Xmalloc (strlen (new_str) + 1); data/marco-1.24.1/src/core/xprops.c:1142: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). g_strlcpy (xmalloc_new_str, new_str, (strlen (new_str) + 1)); data/marco-1.24.1/src/ui/menu.c:229: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). new_name = g_malloc0 (strlen (name) * 2 + 6 + 1); data/marco-1.24.1/src/wm-tester/test-gravity.c:250: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). buf, strlen (buf)); data/marco-1.24.1/src/wm-tester/test-gravity.c:258: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). buf, strlen (buf)); ANALYSIS SUMMARY: Hits = 102 Lines analyzed = 80846 in approximately 1.61 seconds (50333 lines/second) Physical Source Lines of Code (SLOC) = 58831 Hits@level = [0] 104 [1] 21 [2] 67 [3] 14 [4] 0 [5] 0 Hits@level+ = [0+] 206 [1+] 102 [2+] 81 [3+] 14 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 3.50156 [1+] 1.73378 [2+] 1.37683 [3+] 0.23797 [4+] 0 [5+] 0 Dot directories skipped = 3 (--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.