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/freeglut-2.8.1/src/freeglut_init.c Examining data/freeglut-2.8.1/src/freeglut_cursor.c Examining data/freeglut-2.8.1/src/freeglut_font_data.c Examining data/freeglut-2.8.1/src/freeglut_stroke_mono_roman.c Examining data/freeglut-2.8.1/src/freeglut_teapot_data.h Examining data/freeglut-2.8.1/src/freeglut_state.c Examining data/freeglut-2.8.1/src/freeglut_spaceball.c Examining data/freeglut-2.8.1/src/freeglut_menu.c Examining data/freeglut-2.8.1/src/freeglut_callbacks.c Examining data/freeglut-2.8.1/src/freeglut_font.c Examining data/freeglut-2.8.1/src/freeglut_input_devices.c Examining data/freeglut-2.8.1/src/freeglut_xinput.c Examining data/freeglut-2.8.1/src/freeglut_overlay.c Examining data/freeglut-2.8.1/src/freeglut_glutfont_definitions.c Examining data/freeglut-2.8.1/src/freeglut_window.c Examining data/freeglut-2.8.1/src/freeglut_teapot.c Examining data/freeglut-2.8.1/src/freeglut_gamemode.c Examining data/freeglut-2.8.1/src/freeglut_internal.h Examining data/freeglut-2.8.1/src/freeglut_stroke_roman.c Examining data/freeglut-2.8.1/src/freeglut_videoresize.c Examining data/freeglut-2.8.1/src/freeglut_display.c Examining data/freeglut-2.8.1/src/freeglut_ext.c Examining data/freeglut-2.8.1/src/freeglut_geometry.c Examining data/freeglut-2.8.1/src/freeglut_structure.c Examining data/freeglut-2.8.1/src/freeglut_main.c Examining data/freeglut-2.8.1/src/freeglut_misc.c Examining data/freeglut-2.8.1/src/freeglut_joystick.c Examining data/freeglut-2.8.1/progs/demos/subwin/subwin.c Examining data/freeglut-2.8.1/progs/demos/Fractals/fractals.c Examining data/freeglut-2.8.1/progs/demos/Fractals_random/fractals_random.c Examining data/freeglut-2.8.1/progs/demos/smooth_opengl3/smooth_opengl3.c Examining data/freeglut-2.8.1/progs/demos/CallbackMaker/CallbackMaker.c Examining data/freeglut-2.8.1/progs/demos/One/one.c Examining data/freeglut-2.8.1/progs/demos/shapes/shapes.c Examining data/freeglut-2.8.1/progs/demos/Resizer/Resizer.cpp Examining data/freeglut-2.8.1/progs/demos/Lorenz/lorenz.c Examining data/freeglut-2.8.1/progs/demos/spaceball/vmath.c Examining data/freeglut-2.8.1/progs/demos/spaceball/spaceball.c Examining data/freeglut-2.8.1/progs/demos/spaceball/vmath.h Examining data/freeglut-2.8.1/include/GL/freeglut.h Examining data/freeglut-2.8.1/include/GL/freeglut_ext.h Examining data/freeglut-2.8.1/include/GL/glut.h Examining data/freeglut-2.8.1/include/GL/freeglut_std.h FINAL RESULTS: data/freeglut-2.8.1/progs/demos/CallbackMaker/CallbackMaker.c:45:12: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. (void) vsnprintf (buf, sizeof(buf), fmt, args); data/freeglut-2.8.1/progs/demos/CallbackMaker/CallbackMaker.c:142:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(fmt, ap); data/freeglut-2.8.1/progs/demos/CallbackMaker/CallbackMaker.c:152:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(fmt, ap); data/freeglut-2.8.1/progs/demos/Lorenz/lorenz.c:255:12: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. (void) vsnprintf (buf, sizeof(buf), fmt, args); data/freeglut-2.8.1/progs/demos/shapes/shapes.c:238:12: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. (void) vsnprintf (buf, sizeof(buf), fmt, args); data/freeglut-2.8.1/progs/demos/subwin/subwin.c:51:12: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. (void) vsnprintf (buf, sizeof(buf), fmt, args); data/freeglut-2.8.1/progs/demos/subwin/subwin.c:136:9: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(s,str); data/freeglut-2.8.1/src/freeglut_gamemode.c:239:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(displayMode,"%s Problem with requested mode: %lux%lu:%lu@%lu", fggmstr, devModeRequested->dmPelsWidth, devModeRequested->dmPelsHeight, devModeRequested->dmBitsPerPel, devModeRequested->dmDisplayFrequency); data/freeglut-2.8.1/src/freeglut_joystick.c:219:9: [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(cp, di.udi_vendor); data/freeglut-2.8.1/src/freeglut_joystick.c:221:9: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(cp, di.udi_product); data/freeglut-2.8.1/src/freeglut_joystick.c:1403:13: [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( joy->name, &cp[1] ); data/freeglut-2.8.1/src/freeglut_joystick.c:1613:9: [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. if( access( fgJoystick[ ident ]->fname, F_OK ) != 0 ) data/freeglut-2.8.1/src/freeglut_main.c:35:29: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define VFPRINTF(s,f,a) vfprintf((s),(f),(a)) data/freeglut-2.8.1/progs/demos/Fractals_random/fractals_random.c:71:27: [3] (random) random: 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. double new_x = affine[random].a00 * current_x + affine[random].a01 * current_y + affine[random].b0 ; data/freeglut-2.8.1/progs/demos/Fractals_random/fractals_random.c:71:60: [3] (random) random: 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. double new_x = affine[random].a00 * current_x + affine[random].a01 * current_y + affine[random].b0 ; data/freeglut-2.8.1/progs/demos/Fractals_random/fractals_random.c:71:93: [3] (random) random: 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. double new_x = affine[random].a00 * current_x + affine[random].a01 * current_y + affine[random].b0 ; data/freeglut-2.8.1/progs/demos/Fractals_random/fractals_random.c:72:27: [3] (random) random: 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. double new_y = affine[random].a10 * current_x + affine[random].a11 * current_y + affine[random].b1 ; data/freeglut-2.8.1/progs/demos/Fractals_random/fractals_random.c:72:60: [3] (random) random: 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. double new_y = affine[random].a10 * current_x + affine[random].a11 * current_y + affine[random].b1 ; data/freeglut-2.8.1/progs/demos/Fractals_random/fractals_random.c:72:93: [3] (random) random: 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. double new_y = affine[random].a10 * current_x + affine[random].a11 * current_y + affine[random].b1 ; data/freeglut-2.8.1/progs/demos/Lorenz/lorenz.c:343: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 ( 1023 ) ; data/freeglut-2.8.1/src/freeglut_init.c:743: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 *fps = getenv( "GLUT_FPS" ); data/freeglut-2.8.1/src/freeglut_init.c:757:19: [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. displayName = getenv( "DISPLAY" ); data/freeglut-2.8.1/src/freeglut_input_devices.c:140:23: [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. dial_device = getenv ( "GLUT_DIALS_SERIAL" ); data/freeglut-2.8.1/src/freeglut_joystick.c:1357:16: [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 = getenv( "HOME" ); data/freeglut-2.8.1/src/freeglut_main.c:1876:32: [3] (misc) LoadLibrary: Ensure that the full path to the library is specified, or current directory may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to find library path, if you aren't already. HINSTANCE dxDllLib=LoadLibrary(_T("gx.dll")); data/freeglut-2.8.1/progs/demos/CallbackMaker/CallbackMaker.c:38:12: [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 buf[256]; data/freeglut-2.8.1/progs/demos/CallbackMaker/CallbackMaker.c:148: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 dummy_string[STRING_LENGTH]; data/freeglut-2.8.1/progs/demos/CallbackMaker/CallbackMaker.c:465: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 dummy_string[STRING_LENGTH]; data/freeglut-2.8.1/progs/demos/Fractals/fractals.c:47:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char window_title [ 80 ] ; data/freeglut-2.8.1/progs/demos/Fractals/fractals.c:227:16: [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 *fptr = fopen ( fnme, "rt" ) ; data/freeglut-2.8.1/progs/demos/Fractals/fractals.c:229: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 inputline [ 256 ] ; data/freeglut-2.8.1/progs/demos/Fractals/fractals.c:271:5: [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 ( window_title, "Koch Snowflake" ) ; data/freeglut-2.8.1/progs/demos/Fractals_random/fractals_random.c:51:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char window_title [ 80 ] ; data/freeglut-2.8.1/progs/demos/Fractals_random/fractals_random.c:272:16: [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 *fptr = fopen ( fnme, "rt" ) ; data/freeglut-2.8.1/progs/demos/Fractals_random/fractals_random.c:274: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 inputline [ 256 ] ; data/freeglut-2.8.1/progs/demos/Fractals_random/fractals_random.c:316:5: [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 ( window_title, "Koch Snowflake" ) ; data/freeglut-2.8.1/progs/demos/Lorenz/lorenz.c:87: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 ( new_position, position, 3 * sizeof(double) ) ; /* Save the present values */ data/freeglut-2.8.1/progs/demos/Lorenz/lorenz.c:128: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 inputline [ INPUT_LINE_LENGTH ] ; data/freeglut-2.8.1/progs/demos/Lorenz/lorenz.c:148: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 ( red_position[i], red_position[0], 3 * sizeof(double) ) ; data/freeglut-2.8.1/progs/demos/Lorenz/lorenz.c:149: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 ( grn_position[i], grn_position[0], 3 * sizeof(double) ) ; data/freeglut-2.8.1/progs/demos/Lorenz/lorenz.c:248:12: [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 buf[256]; data/freeglut-2.8.1/progs/demos/shapes/shapes.c:229:12: [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 buf[256]; data/freeglut-2.8.1/progs/demos/subwin/subwin.c:42:12: [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 buf[256]; data/freeglut-2.8.1/progs/demos/subwin/subwin.c:120:2: [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 *s,str[2]; data/freeglut-2.8.1/src/freeglut_cursor.c:52: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 cursorNoneBits[ 32 ]; data/freeglut-2.8.1/src/freeglut_gamemode.c:166: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 displayMode[300]; data/freeglut-2.8.1/src/freeglut_init.c:952: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 ( buffer, displayMode, len ); data/freeglut-2.8.1/src/freeglut_input_devices.c:143:20: [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 devname[256]; data/freeglut-2.8.1/src/freeglut_input_devices.c:258:10: [2] (misc) open: 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). fd = open(device, O_RDWR | O_NONBLOCK ); data/freeglut-2.8.1/src/freeglut_joystick.c:171: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 fname [128 ]; data/freeglut-2.8.1/src/freeglut_joystick.c:235: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[50]; data/freeglut-2.8.1/src/freeglut_joystick.c:241:9: [2] (misc) open: 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 = open(buf, O_RDONLY); data/freeglut-2.8.1/src/freeglut_joystick.c:426: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 fname [ 128 ]; data/freeglut-2.8.1/src/freeglut_joystick.c:432: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 [ 128 ]; data/freeglut-2.8.1/src/freeglut_joystick.c:695: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 ( axes, joy->os->cache_axes, sizeof(float) * joy->num_axes ); data/freeglut-2.8.1/src/freeglut_joystick.c:714:21: [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( axes, joy->tmp_axes, data/freeglut-2.8.1/src/freeglut_joystick.c:740:21: [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( axes, joy->tmp_axes, sizeof(float) * joy->num_axes ); data/freeglut-2.8.1/src/freeglut_joystick.c:751: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 ( axes, joy->tmp_axes, sizeof(float) * joy->num_axes ); data/freeglut-2.8.1/src/freeglut_joystick.c:1012: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 buffer [ 256 ]; data/freeglut-2.8.1/src/freeglut_joystick.c:1014: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 OEMKey [ 256 ]; data/freeglut-2.8.1/src/freeglut_joystick.c:1164: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( joy->isp_needs, temp_isp_needs, sizeof (temp_isp_needs ) ); data/freeglut-2.8.1/src/freeglut_joystick.c:1239:32: [2] (misc) open: 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). rv = ( *( joy->hidDev ) )->open( joy->hidDev, 0 ); data/freeglut-2.8.1/src/freeglut_joystick.c:1325:19: [2] (misc) open: 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). joy->os->fd = open( joy->os->fname, O_RDONLY | O_NONBLOCK); data/freeglut-2.8.1/src/freeglut_joystick.c:1366:19: [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). joyfile = fopen( joyfname, "r" ); data/freeglut-2.8.1/src/freeglut_joystick.c:1446:15: [2] (misc) open: 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). joy->fd = open( joy->fname, O_RDONLY ); data/freeglut-2.8.1/src/freeglut_joystick.c:1782: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( fgJoystick[ ident ]->min, axes, data/freeglut-2.8.1/src/freeglut_joystick.c:1788: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( fgJoystick[ ident ]->max, axes, data/freeglut-2.8.1/src/freeglut_joystick.c:1794: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( fgJoystick[ ident ]->center, axes, data/freeglut-2.8.1/src/freeglut_joystick.c:1801: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( axes, fgJoystick[ ident ]->min, data/freeglut-2.8.1/src/freeglut_joystick.c:1807: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( axes, fgJoystick[ ident ]->max, data/freeglut-2.8.1/src/freeglut_joystick.c:1813: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( axes, fgJoystick[ ident ]->center, data/freeglut-2.8.1/src/freeglut_main.c:764: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[32 * 2 + 1]; data/freeglut-2.8.1/src/freeglut_main.c:957: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[ 61 ]; data/freeglut-2.8.1/src/freeglut_main.c:1346:21: [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 keys[32]; data/freeglut-2.8.1/src/freeglut_main.c:1384: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 asciiCode[ 32 ]; data/freeglut-2.8.1/src/freeglut_spaceball.c:460: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/freeglut-2.8.1/src/freeglut_xinput.c:31: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. unsigned char flags[2] = { 0, 0 }; data/freeglut-2.8.1/progs/demos/subwin/subwin.c:131: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(s)+1>MAXSTR) { data/freeglut-2.8.1/src/freeglut_gamemode.c:737:9: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep( 100 ); data/freeglut-2.8.1/src/freeglut_init.c:950: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 ( displayMode ); data/freeglut-2.8.1/src/freeglut_input_devices.c:300:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(port->fd,&ch,1)) return ch; data/freeglut-2.8.1/src/freeglut_joystick.c:218:26: [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). cp = calloc( 1, strlen(di.udi_vendor) + strlen(di.udi_product) + 2); data/freeglut-2.8.1/src/freeglut_joystick.c:218:50: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). cp = calloc( 1, strlen(di.udi_vendor) + strlen(di.udi_product) + 2); data/freeglut-2.8.1/src/freeglut_joystick.c:220:9: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(cp, " "); data/freeglut-2.8.1/src/freeglut_joystick.c:222:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(out, cp, outlen - 1); data/freeglut-2.8.1/src/freeglut_joystick.c:622:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int status = read ( joy->os->fd, &joy->os->ajs, sizeof(joy->os->ajs) ); data/freeglut-2.8.1/src/freeglut_joystick.c:641:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ( ( len = read ( joy->os->fd, joy->os->hid_data_buf, joy->os->hid_dlen ) ) == joy->os->hid_dlen ) data/freeglut-2.8.1/src/freeglut_joystick.c:703:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). status = read ( joy->fd, &joy->js, sizeof(struct js_event) ); data/freeglut-2.8.1/src/freeglut_joystick.c:761:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). status = read( joy->fd, &joy->js, JS_RETURN ); data/freeglut-2.8.1/src/freeglut_joystick.c:1280:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( joy->name, joy->jsCaps.szPname, sizeof( joy->name ) ); data/freeglut-2.8.1/src/freeglut_misc.c:50: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). const size_t len = strlen( extension ); data/freeglut-2.8.1/src/freeglut_window.c:554: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). int i,len=strlen(str); data/freeglut-2.8.1/src/freeglut_window.c:1756: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). text.nitems = strlen( title ); data/freeglut-2.8.1/src/freeglut_window.c:1798: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). text.nitems = strlen( title ); ANALYSIS SUMMARY: Hits = 94 Lines analyzed = 31574 in approximately 1.30 seconds (24324 lines/second) Physical Source Lines of Code (SLOC) = 22756 Hits@level = [0] 139 [1] 17 [2] 52 [3] 12 [4] 13 [5] 0 Hits@level+ = [0+] 233 [1+] 94 [2+] 77 [3+] 25 [4+] 13 [5+] 0 Hits/KSLOC@level+ = [0+] 10.2391 [1+] 4.13078 [2+] 3.38372 [3+] 1.09861 [4+] 0.571278 [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.