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/metacity-3.38.0/libmetacity/meta-button-layout-private.h Examining data/metacity-3.38.0/libmetacity/meta-theme-gtk.c Examining data/metacity-3.38.0/libmetacity/meta-frame-style.c Examining data/metacity-3.38.0/libmetacity/meta-hsla-private.h Examining data/metacity-3.38.0/libmetacity/meta-frame-enums.h Examining data/metacity-3.38.0/libmetacity/meta-color.c Examining data/metacity-3.38.0/libmetacity/meta-css-provider-private.h Examining data/metacity-3.38.0/libmetacity/meta-button.c Examining data/metacity-3.38.0/libmetacity/meta-rectangle-private.h Examining data/metacity-3.38.0/libmetacity/meta-draw-spec.c Examining data/metacity-3.38.0/libmetacity/meta-theme.c Examining data/metacity-3.38.0/libmetacity/meta-theme-metacity.c Examining data/metacity-3.38.0/libmetacity/meta-frame-layout-private.h Examining data/metacity-3.38.0/libmetacity/meta-enum-types.h Examining data/metacity-3.38.0/libmetacity/meta-theme.h Examining data/metacity-3.38.0/libmetacity/meta-theme-gtk-private.h Examining data/metacity-3.38.0/libmetacity/meta-draw-op-private.h Examining data/metacity-3.38.0/libmetacity/meta-enum-types.c Examining data/metacity-3.38.0/libmetacity/meta-frame-borders.c Examining data/metacity-3.38.0/libmetacity/meta-frame-borders.h Examining data/metacity-3.38.0/libmetacity/meta-button.h Examining data/metacity-3.38.0/libmetacity/meta-draw-spec-private.h Examining data/metacity-3.38.0/libmetacity/meta-draw-op.c Examining data/metacity-3.38.0/libmetacity/meta-hsla.c Examining data/metacity-3.38.0/libmetacity/meta-color-private.h Examining data/metacity-3.38.0/libmetacity/meta-frame-style-private.h Examining data/metacity-3.38.0/libmetacity/meta-frame-layout.c Examining data/metacity-3.38.0/libmetacity/meta-style-info-private.h Examining data/metacity-3.38.0/libmetacity/meta-theme-impl.c Examining data/metacity-3.38.0/libmetacity/meta-button-layout.c Examining data/metacity-3.38.0/libmetacity/meta-theme-metacity-private.h Examining data/metacity-3.38.0/libmetacity/meta-style-info.c Examining data/metacity-3.38.0/libmetacity/meta-gradient-spec-private.h Examining data/metacity-3.38.0/libmetacity/meta-theme-impl-private.h Examining data/metacity-3.38.0/libmetacity/meta-gradient-spec.c Examining data/metacity-3.38.0/libmetacity/meta-button-private.h Examining data/metacity-3.38.0/libmetacity/meta-color.h Examining data/metacity-3.38.0/libmetacity/meta-color-spec-private.h Examining data/metacity-3.38.0/libmetacity/meta-css-provider.c Examining data/metacity-3.38.0/libmetacity/meta-color-spec.c Examining data/metacity-3.38.0/src/tools/metacity-message.c Examining data/metacity-3.38.0/src/include/meta-compositor.h Examining data/metacity-3.38.0/src/include/screen.h Examining data/metacity-3.38.0/src/include/tile-preview.h Examining data/metacity-3.38.0/src/include/main.h Examining data/metacity-3.38.0/src/include/ui.h Examining data/metacity-3.38.0/src/include/boxes.h Examining data/metacity-3.38.0/src/include/display.h Examining data/metacity-3.38.0/src/include/errors.h Examining data/metacity-3.38.0/src/include/tabpopup.h Examining data/metacity-3.38.0/src/include/resizepopup.h Examining data/metacity-3.38.0/src/include/frame.h Examining data/metacity-3.38.0/src/include/window.h Examining data/metacity-3.38.0/src/include/xprops.h Examining data/metacity-3.38.0/src/include/common.h Examining data/metacity-3.38.0/src/include/util.h Examining data/metacity-3.38.0/src/include/types.h Examining data/metacity-3.38.0/src/include/prefs.h Examining data/metacity-3.38.0/src/include/core.h Examining data/metacity-3.38.0/src/ui/frames.h Examining data/metacity-3.38.0/src/ui/ui-private.h Examining data/metacity-3.38.0/src/ui/resizepopup.c Examining data/metacity-3.38.0/src/ui/fixedtip.h Examining data/metacity-3.38.0/src/ui/select-image.h Examining data/metacity-3.38.0/src/ui/ui.c Examining data/metacity-3.38.0/src/ui/metaaccellabel.h Examining data/metacity-3.38.0/src/ui/select-workspace.h Examining data/metacity-3.38.0/src/ui/fixedtip.c Examining data/metacity-3.38.0/src/ui/menu.h Examining data/metacity-3.38.0/src/ui/menu.c Examining data/metacity-3.38.0/src/ui/meta-tooltip.c Examining data/metacity-3.38.0/src/ui/frames.c Examining data/metacity-3.38.0/src/ui/metaaccellabel.c Examining data/metacity-3.38.0/src/ui/meta-tooltip.h Examining data/metacity-3.38.0/src/ui/draw-workspace.h Examining data/metacity-3.38.0/src/ui/select-image.c Examining data/metacity-3.38.0/src/ui/tabpopup.c Examining data/metacity-3.38.0/src/ui/tile-preview.c Examining data/metacity-3.38.0/src/ui/draw-workspace.c Examining data/metacity-3.38.0/src/ui/select-workspace.c Examining data/metacity-3.38.0/src/compositor/meta-shadow-xrender.h Examining data/metacity-3.38.0/src/compositor/meta-compositor-none.c Examining data/metacity-3.38.0/src/compositor/meta-compositor-none.h Examining data/metacity-3.38.0/src/compositor/meta-surface.h Examining data/metacity-3.38.0/src/compositor/meta-surface-vulkan.c Examining data/metacity-3.38.0/src/compositor/meta-compositor-private.h Examining data/metacity-3.38.0/src/compositor/meta-shadow-xrender.c Examining data/metacity-3.38.0/src/compositor/meta-compositor.c Examining data/metacity-3.38.0/src/compositor/meta-compositor-xrender.h Examining data/metacity-3.38.0/src/compositor/meta-compositor-external.h Examining data/metacity-3.38.0/src/compositor/meta-compositor-xpresent.h Examining data/metacity-3.38.0/src/compositor/meta-compositor-xrender.c Examining data/metacity-3.38.0/src/compositor/meta-compositor-vulkan.c Examining data/metacity-3.38.0/src/compositor/meta-surface-xrender.h Examining data/metacity-3.38.0/src/compositor/meta-surface-xrender.c Examining data/metacity-3.38.0/src/compositor/meta-surface-vulkan.h Examining data/metacity-3.38.0/src/compositor/meta-surface.c Examining data/metacity-3.38.0/src/compositor/meta-compositor-external.c Examining data/metacity-3.38.0/src/compositor/meta-compositor-vulkan.h Examining data/metacity-3.38.0/src/compositor/meta-compositor-xpresent.c Examining data/metacity-3.38.0/src/compositor/meta-surface-private.h Examining data/metacity-3.38.0/src/core/constraints.c Examining data/metacity-3.38.0/src/core/testboxes.c Examining data/metacity-3.38.0/src/core/display.c Examining data/metacity-3.38.0/src/core/frame.c Examining data/metacity-3.38.0/src/core/atomnames.h Examining data/metacity-3.38.0/src/core/main.c Examining data/metacity-3.38.0/src/core/metacity-Xatomtype.h Examining data/metacity-3.38.0/src/core/errors.c Examining data/metacity-3.38.0/src/core/frame-private.h Examining data/metacity-3.38.0/src/core/prefs.c Examining data/metacity-3.38.0/src/core/above-tab-keycode.c Examining data/metacity-3.38.0/src/core/async-getprop.c Examining data/metacity-3.38.0/src/core/group-private.h Examining data/metacity-3.38.0/src/core/stack-tracker.c Examining data/metacity-3.38.0/src/core/effects.c Examining data/metacity-3.38.0/src/core/keybindings.h Examining data/metacity-3.38.0/src/core/group.c Examining data/metacity-3.38.0/src/core/constraints.h Examining data/metacity-3.38.0/src/core/edge-resistance.h Examining data/metacity-3.38.0/src/core/group-props.c Examining data/metacity-3.38.0/src/core/meta-enum-types.h Examining data/metacity-3.38.0/src/core/core.c Examining data/metacity-3.38.0/src/core/async-getprop.h Examining data/metacity-3.38.0/src/core/meta-enum-types.c Examining data/metacity-3.38.0/src/core/boxes.c Examining data/metacity-3.38.0/src/core/workspace.h Examining data/metacity-3.38.0/src/core/iconcache.c Examining data/metacity-3.38.0/src/core/group.h Examining data/metacity-3.38.0/src/core/testasyncgetprop.c Examining data/metacity-3.38.0/src/core/bell.h Examining data/metacity-3.38.0/src/core/window-props.c Examining data/metacity-3.38.0/src/core/edge-resistance.c Examining data/metacity-3.38.0/src/core/workspace.c Examining data/metacity-3.38.0/src/core/group-props.h Examining data/metacity-3.38.0/src/core/window-private.h Examining data/metacity-3.38.0/src/core/window.c Examining data/metacity-3.38.0/src/core/screen-private.h Examining data/metacity-3.38.0/src/core/place.h Examining data/metacity-3.38.0/src/core/place.c Examining data/metacity-3.38.0/src/core/stack-tracker.h Examining data/metacity-3.38.0/src/core/bell.c Examining data/metacity-3.38.0/src/core/display-private.h Examining data/metacity-3.38.0/src/core/screen.c Examining data/metacity-3.38.0/src/core/stack.c Examining data/metacity-3.38.0/src/core/session.h Examining data/metacity-3.38.0/src/core/session.c Examining data/metacity-3.38.0/src/core/util.c Examining data/metacity-3.38.0/src/core/iconcache.h Examining data/metacity-3.38.0/src/core/keybindings.c Examining data/metacity-3.38.0/src/core/delete.c Examining data/metacity-3.38.0/src/core/window-props.h Examining data/metacity-3.38.0/src/core/xprops.c Examining data/metacity-3.38.0/src/core/effects.h Examining data/metacity-3.38.0/src/core/stack.h Examining data/metacity-3.38.0/theme-viewer/theme-viewer-resources.c Examining data/metacity-3.38.0/theme-viewer/theme-viewer-main.c Examining data/metacity-3.38.0/theme-viewer/theme-viewer-window.h Examining data/metacity-3.38.0/theme-viewer/theme-viewer-window.c Examining data/metacity-3.38.0/theme-viewer/theme-viewer-resources.h FINAL RESULTS: data/metacity-3.38.0/src/core/testasyncgetprop.c:141:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy (s, str); data/metacity-3.38.0/src/core/xprops.c:846:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy (class_hint->res_name, (char *)results->prop); data/metacity-3.38.0/src/core/xprops.c:862:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy (class_hint->res_class, (char *)results->prop + len_name + 1); data/metacity-3.38.0/src/core/xprops.c:1161:19: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy (xmalloc_new_str, new_str); data/metacity-3.38.0/libmetacity/meta-css-provider.c:126:26: [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. path = find_theme_dir (g_get_home_dir (), ".themes", name, variant); data/metacity-3.38.0/src/compositor/meta-compositor-xrender.c:1380:32: [3] (random) g_rand_double: 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_rand_double (priv->rand), data/metacity-3.38.0/src/compositor/meta-compositor-xrender.c:1381:32: [3] (random) g_rand_double: 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_rand_double (priv->rand), data/metacity-3.38.0/src/compositor/meta-compositor-xrender.c:1382:32: [3] (random) g_rand_double: 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_rand_double (priv->rand)); data/metacity-3.38.0/src/core/main.c:482: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/metacity-3.38.0/src/core/main.c:484:18: [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/metacity-3.38.0/src/core/main.c:485:62: [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_warning ("Could not change to home directory %s.", g_get_home_dir ()); data/metacity-3.38.0/src/core/session.c:348:31: [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/metacity-3.38.0/src/core/session.c:1111: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/metacity-3.38.0/src/core/testasyncgetprop.c:279: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 ("METACITY_SYNC") != NULL) data/metacity-3.38.0/src/core/testboxes.c:34: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/metacity-3.38.0/theme-viewer/theme-viewer-window.c:632:34: [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. themes_dir = g_build_filename (g_get_home_dir (), ".themes", NULL); data/metacity-3.38.0/libmetacity/meta-draw-spec.c:198: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/metacity-3.38.0/libmetacity/meta-theme-metacity.c:3552: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/metacity-3.38.0/libmetacity/meta-theme-metacity.c:3555: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/metacity-3.38.0/src/compositor/meta-compositor-xpresent.c:178: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 error_text[64]; data/metacity-3.38.0/src/compositor/meta-compositor-xrender.c:610: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/metacity-3.38.0/src/core/boxes.c:55: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/metacity-3.38.0/src/core/boxes.c:108: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/metacity-3.38.0/src/core/constraints.c:1285: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/metacity-3.38.0/src/core/delete.c:153: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/metacity-3.38.0/src/core/edge-resistance.c:674: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/metacity-3.38.0/src/core/main.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 yearbuffer[256]; data/metacity-3.38.0/src/core/main.c:145: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/metacity-3.38.0/src/core/place.c:555: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 monitor_location_string[RECT_LENGTH]; data/metacity-3.38.0/src/core/screen.c:277: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/metacity-3.38.0/src/core/screen.c:304: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/metacity-3.38.0/src/core/session.c:232: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/metacity-3.38.0/src/core/session.c:307: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/metacity-3.38.0/src/core/session.c:335: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/metacity-3.38.0/src/core/session.c:587: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/metacity-3.38.0/src/core/session.c:588: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/metacity-3.38.0/src/core/session.c:589: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/metacity-3.38.0/src/core/session.c:882: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/metacity-3.38.0/src/core/session.c:1289: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/metacity-3.38.0/src/core/session.c:1323: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/metacity-3.38.0/src/core/session.c:1369: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/metacity-3.38.0/src/core/session.c:1377: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/metacity-3.38.0/src/core/session.c:1385: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/metacity-3.38.0/src/core/session.c:1393: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/metacity-3.38.0/src/core/session.c:1435: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/metacity-3.38.0/src/core/session.c:1440: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/metacity-3.38.0/src/core/session.c:1445: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/metacity-3.38.0/src/core/session.c:1450: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/metacity-3.38.0/src/core/stack-tracker.c:432: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 (copy->data, stack->data, sizeof (Window) * stack->len); data/metacity-3.38.0/src/core/testasyncgetprop.c:90: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/metacity-3.38.0/src/core/testboxes.c:407: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/metacity-3.38.0/src/core/testboxes.c:408: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/metacity-3.38.0/src/core/testboxes.c:521: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/metacity-3.38.0/src/core/testboxes.c:539: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/metacity-3.38.0/src/core/testboxes.c:656: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/metacity-3.38.0/src/core/testboxes.c:657: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/metacity-3.38.0/src/core/testboxes.c:1115: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/metacity-3.38.0/src/core/testboxes.c:1204: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/metacity-3.38.0/src/core/window-props.c:526: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/metacity-3.38.0/src/core/xprops.c:336: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/metacity-3.38.0/src/compositor/meta-compositor-xrender.c:1388: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/metacity-3.38.0/src/core/screen.c:1714: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/metacity-3.38.0/src/core/session.c:316: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 ("metacity"); data/metacity-3.38.0/src/core/session.c:326: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/metacity-3.38.0/src/core/session.c:341: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/metacity-3.38.0/src/core/session.c:349: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/metacity-3.38.0/src/core/session.c:614: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/metacity-3.38.0/src/core/session.c:634: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/metacity-3.38.0/src/core/session.c:658: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/metacity-3.38.0/src/core/testasyncgetprop.c:135: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/metacity-3.38.0/src/core/xprops.c:509: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/metacity-3.38.0/src/core/xprops.c:552: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/metacity-3.38.0/src/core/xprops.c:838: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/metacity-3.38.0/src/core/xprops.c:851: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/metacity-3.38.0/src/core/xprops.c:1158: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/metacity-3.38.0/src/ui/menu.c:206: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/metacity-3.38.0/theme-viewer/theme-viewer-resources.c:4805:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). __pragma(section(".CRT$XCU",read)) \ data/metacity-3.38.0/theme-viewer/theme-viewer-resources.c:4813:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). __pragma(section(".CRT$XCU",read)) \ data/metacity-3.38.0/theme-viewer/theme-viewer-resources.c:4825:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). section(".CRT$XCU",read) data/metacity-3.38.0/theme-viewer/theme-viewer-resources.c:4832:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). section(".CRT$XCU",read) ANALYSIS SUMMARY: Hits = 80 Lines analyzed = 85101 in approximately 1.95 seconds (43695 lines/second) Physical Source Lines of Code (SLOC) = 62237 Hits@level = [0] 78 [1] 20 [2] 44 [3] 12 [4] 4 [5] 0 Hits@level+ = [0+] 158 [1+] 80 [2+] 60 [3+] 16 [4+] 4 [5+] 0 Hits/KSLOC@level+ = [0+] 2.53868 [1+] 1.28541 [2+] 0.964057 [3+] 0.257082 [4+] 0.0642705 [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.