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/xball-3.0.1/scrollbar.c Examining data/xball-3.0.1/names.h Examining data/xball-3.0.1/sim.c Examining data/xball-3.0.1/sim.h Examining data/xball-3.0.1/list.h Examining data/xball-3.0.1/help.h Examining data/xball-3.0.1/menu.h Examining data/xball-3.0.1/room.h Examining data/xball-3.0.1/act_area.h Examining data/xball-3.0.1/items.c Examining data/xball-3.0.1/list.c Examining data/xball-3.0.1/items.h Examining data/xball-3.0.1/miscx.c Examining data/xball-3.0.1/act_area.c Examining data/xball-3.0.1/item.h Examining data/xball-3.0.1/miscx.h Examining data/xball-3.0.1/xball_sys.h Examining data/xball-3.0.1/demo.h Examining data/xball-3.0.1/file_sel.h Examining data/xball-3.0.1/color_l.c Examining data/xball-3.0.1/color_l.h Examining data/xball-3.0.1/table.h Examining data/xball-3.0.1/file_sel.c Examining data/xball-3.0.1/misc.h Examining data/xball-3.0.1/intf.h Examining data/xball-3.0.1/filemenu.c Examining data/xball-3.0.1/patchlevel.h Examining data/xball-3.0.1/scrollbar.h Examining data/xball-3.0.1/help.c Examining data/xball-3.0.1/X11/Xaw_d/demo.c Examining data/xball-3.0.1/X11/Xaw_d/DrawingAP.h Examining data/xball-3.0.1/X11/Xaw_d/DrawingA.c Examining data/xball-3.0.1/X11/Xaw_d/DrawingA.h Examining data/xball-3.0.1/table.c Examining data/xball-3.0.1/fallback.h Examining data/xball-3.0.1/item.c Examining data/xball-3.0.1/menu.c Examining data/xball-3.0.1/demo.c Examining data/xball-3.0.1/misc.c Examining data/xball-3.0.1/room.c Examining data/xball-3.0.1/xball.c Examining data/xball-3.0.1/xball_sys.c FINAL RESULTS: data/xball-3.0.1/act_area.c:35:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(name,"%s_action_area", XtName(parent)); data/xball-3.0.1/demo.c:286:13: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. sscanf(in_line,"load_bitmap %s %d,%d", str,&x,&y); data/xball-3.0.1/demo.c:296:13: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. sscanf(in_line,"set_velocity %s %d,%d", str,&x_vel,&y_vel); data/xball-3.0.1/demo.c:365:13: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. sscanf(in_line,"%*s %s", str); data/xball-3.0.1/demo.c:375:13: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. sscanf(in_line,"%*s %s", str); data/xball-3.0.1/demo.c:468:13: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. sscanf(in_line,"visible %s", str); data/xball-3.0.1/filemenu.c:132:2: [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(cwd, dir); data/xball-3.0.1/filemenu.c:140:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cwd, "%s/%s", cwd, dir); data/xball-3.0.1/filemenu.c:168:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(pathname, "%s/%s", cwd, entry->d_name); data/xball-3.0.1/filemenu.c:170:6: [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(pathname, entry->d_name); data/xball-3.0.1/filemenu.c:274:7: [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(*glob_path, remove_current_prefix(cwd)); data/xball-3.0.1/filemenu.c:277:7: [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(*glob_path, filename); data/xball-3.0.1/filemenu.c:335:7: [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(fileMenuDir, dir); data/xball-3.0.1/filemenu.c:340:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(menulabel, " %s ", dir); data/xball-3.0.1/filemenu.c:490:5: [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(cwd,init_path); data/xball-3.0.1/help.c:194:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(txt,"%s_action_area", XtName(parent)); data/xball-3.0.1/help.c:300:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buff, "%s_popup", HELP_DIALOG); data/xball-3.0.1/menu.c:214:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(widget_path,"*%s", widget_name); data/xball-3.0.1/menu.c:347:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(pull_down_name, "%sPullDown", menu_button_name); data/xball-3.0.1/misc.c:45:5: [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( ret_str, str); data/xball-3.0.1/filemenu.c:230:3: [3] (buffer) getwd: This does not protect against buffer overflows by itself, so use with caution (CWE-120, CWE-20). Use getcwd instead. getwd(wd); data/xball-3.0.1/filemenu.c:476:7: [3] (buffer) getwd: This does not protect against buffer overflows by itself, so use with caution (CWE-120, CWE-20). Use getcwd instead. getwd(cwd); data/xball-3.0.1/filemenu.c:485:7: [3] (buffer) getwd: This does not protect against buffer overflows by itself, so use with caution (CWE-120, CWE-20). Use getcwd instead. getwd(cwd); data/xball-3.0.1/misc.c:58:16: [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. return random() % (max - min) + min; data/xball-3.0.1/act_area.c:31: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[50]; data/xball-3.0.1/color_l.c:107: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 colorname[50]; /* Temp color name string */ data/xball-3.0.1/color_l.c:117:17: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!(rgb = fopen(passed_file_name, "r"))) data/xball-3.0.1/color_l.c:162: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. XtFree( (char *)colors[ shade_index]); data/xball-3.0.1/demo.c:198: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 in_line[MAX_LEN]; /* The current demo file line read in */ data/xball-3.0.1/demo.c:201: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 str[MAX_LEN]; data/xball-3.0.1/demo.c:506:27: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((demo->file_ptr = fopen(demo->file_name, "r")) == (FILE *)0) data/xball-3.0.1/filemenu.c:107: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 cwd[MAXPATHLEN] = ""; /* current working directory */ data/xball-3.0.1/filemenu.c:108: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 fileMenuDir[MAXPATHLEN];/* current directory of file menu */ data/xball-3.0.1/filemenu.c:156: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 pathname[LINESIZ]; data/xball-3.0.1/filemenu.c:214:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. XtFree((char *)namelist[j]); data/xball-3.0.1/filemenu.c:226: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 wd[MAXPATHLEN]; data/xball-3.0.1/filemenu.c:323: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 menulabel[LINESIZ]; data/xball-3.0.1/help.c:191: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 txt[100]; data/xball-3.0.1/help.c:289: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 buff[50]; data/xball-3.0.1/menu.c:211: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 widget_path[50]; data/xball-3.0.1/menu.c:304: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 pull_down_name[30]; data/xball-3.0.1/menu.c:690: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 buff[50]; data/xball-3.0.1/scrollbar.c:362: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 buff[15]; data/xball-3.0.1/scrollbar.c:365: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(buff,"%d", value); data/xball-3.0.1/color_l.c:133:28: [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). color->last_char = strlen( color->name) - 1; data/xball-3.0.1/color_l.c:232:21: [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). return (colorname[strlen(colorname)-1] == '4' && data/xball-3.0.1/demo.c:191:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). #define is_command(comm) (strncmp(comm,in_line,strlen(comm)) == 0) data/xball-3.0.1/demo.c:482:21: [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). in_line[strlen(in_line)-1] = '\0'; /* Kill newline */ data/xball-3.0.1/filemenu.c:92: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). #define LASTCH(s) (s[strlen(s)-1]) data/xball-3.0.1/filemenu.c:93:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). #define SECLASTCH(s) (s[strlen(s)-2]) data/xball-3.0.1/filemenu.c:134:9: [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). for (i=strlen(cwd); cwd[i] != '/' && i > 0; i--); data/xball-3.0.1/filemenu.c:137:6: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. strcpy(cwd, "/"); data/xball-3.0.1/filemenu.c:174:2: [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(entry->d_name, "/"); data/xball-3.0.1/filemenu.c:179:2: [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(entry->d_name, "*"); data/xball-3.0.1/filemenu.c:231:24: [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 (!strncmp(wd,path,strlen(wd))) data/xball-3.0.1/filemenu.c:234: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). temp_str = &path[strlen(wd)]; data/xball-3.0.1/filemenu.c:273: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). *glob_path = XtMalloc(strlen(filename)+strlen(cwd)+2); data/xball-3.0.1/filemenu.c:273:46: [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). *glob_path = XtMalloc(strlen(filename)+strlen(cwd)+2); data/xball-3.0.1/filemenu.c:275:11: [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(*glob_path) != 0) data/xball-3.0.1/filemenu.c:276:2: [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(*glob_path, "/"); data/xball-3.0.1/filemenu.c:486:7: [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(cwd,"/"); data/xball-3.0.1/misc.c:32:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( tmp, str, len + 1); data/xball-3.0.1/misc.c:43: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). char *ret_str = malloc( strlen( str) + 1); data/xball-3.0.1/sim.c:175:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(STEP - delta); data/xball-3.0.1/xball.c:58:46: [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 (argc > 1 && strncmp(argv[1],"-help", strlen(argv[1])) == 0) ANALYSIS SUMMARY: Hits = 65 Lines analyzed = 7209 in approximately 0.20 seconds (36500 lines/second) Physical Source Lines of Code (SLOC) = 4467 Hits@level = [0] 32 [1] 21 [2] 20 [3] 4 [4] 20 [5] 0 Hits@level+ = [0+] 97 [1+] 65 [2+] 44 [3+] 24 [4+] 20 [5+] 0 Hits/KSLOC@level+ = [0+] 21.7148 [1+] 14.5512 [2+] 9.85001 [3+] 5.37273 [4+] 4.47728 [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.