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/xgalaga-2.1.1.0/main.c Examining data/xgalaga-2.1.1.0/images.c Examining data/xgalaga-2.1.1.0/data.c Examining data/xgalaga-2.1.1.0/paths.c Examining data/xgalaga-2.1.1.0/pathfile.c Examining data/xgalaga-2.1.1.0/explosions.c Examining data/xgalaga-2.1.1.0/score.c Examining data/xgalaga-2.1.1.0/highscore.c Examining data/xgalaga-2.1.1.0/prize.c Examining data/xgalaga-2.1.1.0/sound.c Examining data/xgalaga-2.1.1.0/nas_sound.c Examining data/xgalaga-2.1.1.0/frate.c Examining data/xgalaga-2.1.1.0/linux-joystick.c Examining data/xgalaga-2.1.1.0/xgal.sndsrv.freebsd.c Examining data/xgalaga-2.1.1.0/xgal.sndsrv.linux.c Examining data/xgalaga-2.1.1.0/xgal.sndsrv.sun.c Examining data/xgalaga-2.1.1.0/libsprite/Wproto.h Examining data/xgalaga-2.1.1.0/libsprite/allincludes.h Examining data/xgalaga-2.1.1.0/libsprite/border.c Examining data/xgalaga-2.1.1.0/libsprite/buffer.c Examining data/xgalaga-2.1.1.0/libsprite/circle.c Examining data/xgalaga-2.1.1.0/libsprite/cleararea.c Examining data/xgalaga-2.1.1.0/libsprite/color.c Examining data/xgalaga-2.1.1.0/libsprite/copyright2.h Examining data/xgalaga-2.1.1.0/libsprite/cursor.c Examining data/xgalaga-2.1.1.0/libsprite/data.c Examining data/xgalaga-2.1.1.0/libsprite/data.h Examining data/xgalaga-2.1.1.0/libsprite/defs.h Examining data/xgalaga-2.1.1.0/libsprite/event.c Examining data/xgalaga-2.1.1.0/libsprite/fill.c Examining data/xgalaga-2.1.1.0/libsprite/image.c Examining data/xgalaga-2.1.1.0/libsprite/init.c Examining data/xgalaga-2.1.1.0/libsprite/line.c Examining data/xgalaga-2.1.1.0/libsprite/makewindow.c Examining data/xgalaga-2.1.1.0/libsprite/mapwindow.c Examining data/xgalaga-2.1.1.0/libsprite/menu.c Examining data/xgalaga-2.1.1.0/libsprite/misc.c Examining data/xgalaga-2.1.1.0/libsprite/mouse.c Examining data/xgalaga-2.1.1.0/libsprite/point.c Examining data/xgalaga-2.1.1.0/libsprite/proto.h Examining data/xgalaga-2.1.1.0/libsprite/scale.c Examining data/xgalaga-2.1.1.0/libsprite/scroll.c Examining data/xgalaga-2.1.1.0/libsprite/sector.c Examining data/xgalaga-2.1.1.0/libsprite/struct.h Examining data/xgalaga-2.1.1.0/libsprite/text.c Examining data/xgalaga-2.1.1.0/libsprite/tile.c Examining data/xgalaga-2.1.1.0/libsprite/triangle.c Examining data/xgalaga-2.1.1.0/libsprite/Wlib.h Examining data/xgalaga-2.1.1.0/Wproto.h Examining data/xgalaga-2.1.1.0/acconfig.h Examining data/xgalaga-2.1.1.0/copyright.h Examining data/xgalaga-2.1.1.0/copyright2.h Examining data/xgalaga-2.1.1.0/data.h Examining data/xgalaga-2.1.1.0/defs.h Examining data/xgalaga-2.1.1.0/images.h Examining data/xgalaga-2.1.1.0/linux_pcsp.h Examining data/xgalaga-2.1.1.0/pathfile.h Examining data/xgalaga-2.1.1.0/paths.h Examining data/xgalaga-2.1.1.0/proto.h Examining data/xgalaga-2.1.1.0/sound.h Examining data/xgalaga-2.1.1.0/struct.h Examining data/xgalaga-2.1.1.0/xpm.h Examining data/xgalaga-2.1.1.0/Wlib.h Examining data/xgalaga-2.1.1.0/title.c FINAL RESULTS: data/xgalaga-2.1.1.0/highscore.c:73: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(new_name, getUsersFullName()); data/xgalaga-2.1.1.0/highscore.c:78:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s_", new_name); data/xgalaga-2.1.1.0/highscore.c:115: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(cp2, pass->pw_name); data/xgalaga-2.1.1.0/highscore.c:236: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(global_scores[j].name, global_scores[j-1].name); data/xgalaga-2.1.1.0/highscore.c:241: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(global_scores[i].name, name); data/xgalaga-2.1.1.0/highscore.c:257: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(global_scores[j].name, global_scores[j-1].name); data/xgalaga-2.1.1.0/highscore.c:261: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(global_scores[i].name, name); data/xgalaga-2.1.1.0/highscore.c:274: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(my_scores[j].name, my_scores[j-1].name); data/xgalaga-2.1.1.0/highscore.c:278: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(my_scores[i].name, name); data/xgalaga-2.1.1.0/highscore.c:373:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, " %2d. %-20s %7ld %5ld", i+1, data/xgalaga-2.1.1.0/highscore.c:385:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, " %2d. %-20s %7ld %5ld", i+1, data/xgalaga-2.1.1.0/libsprite/image.c:11: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(imagedir, dir); data/xgalaga-2.1.1.0/libsprite/image.c:59:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(imagedir,"%s/%s",imagedir,(image)->filename); data/xgalaga-2.1.1.0/libsprite/image.c:142:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf,"%s %s...",image->compiled_in ? "Storing" : "Loading", data/xgalaga-2.1.1.0/libsprite/image.c:168:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(imagedirend,"%s.xpm",image->filename); data/xgalaga-2.1.1.0/libsprite/image.c:219:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(imagedirend,"%s.xbm",image->filename); data/xgalaga-2.1.1.0/libsprite/init.c:208:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(defaultstring, "color.%s", colortable[i].name); data/xgalaga-2.1.1.0/libsprite/init.c:263:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(defaultstring, "color.%s", colortable[i].name); data/xgalaga-2.1.1.0/libsprite/makewindow.c:41:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s.geometry", name); data/xgalaga-2.1.1.0/libsprite/makewindow.c:89:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s.parent", name); data/xgalaga-2.1.1.0/libsprite/makewindow.c:121:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s.cursor", name); data/xgalaga-2.1.1.0/libsprite/makewindow.c:177:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s.mapped", name); data/xgalaga-2.1.1.0/libsprite/makewindow.c:188:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s.buffered", name); data/xgalaga-2.1.1.0/libsprite/makewindow.c:300: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(newname,name); data/xgalaga-2.1.1.0/nas_sound.c:177: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(sound_table[num_sounds].name, filename); data/xgalaga-2.1.1.0/nas_sound.c:181:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fbuf, "%s/%s", str, filename); data/xgalaga-2.1.1.0/nas_sound.c:183:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fbuf, "%s/%s", unixSoundPath, filename); data/xgalaga-2.1.1.0/nas_sound.c:186: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(sound_table[num_sounds].filename, fbuf); data/xgalaga-2.1.1.0/pathfile.c:71: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(buf + strlen(buf), nextline); data/xgalaga-2.1.1.0/pathfile.c:307:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "%s", LEVELDIR); data/xgalaga-2.1.1.0/pathfile.c:317: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(real_level_path, filename); data/xgalaga-2.1.1.0/pathfile.c:320:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "%s/level%d.xgl", real_level_path, lev); data/xgalaga-2.1.1.0/pathfile.c:329:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "%s/level%d.xgl", real_level_path, lev); data/xgalaga-2.1.1.0/sound.c:66:7: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (filename, SOUNDSERVER); data/xgalaga-2.1.1.0/sound.c:71:7: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(filename, argv); data/xgalaga-2.1.1.0/title.c:239:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (vbuf, "v%s", VERSION); data/xgalaga-2.1.1.0/xgal.sndsrv.freebsd.c:60: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 (s, argv[1]); data/xgalaga-2.1.1.0/xgal.sndsrv.freebsd.c:62: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 (s, FILENAME[i]); data/xgalaga-2.1.1.0/xgal.sndsrv.freebsd.c:64: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 (FILENAME[i],s); data/xgalaga-2.1.1.0/xgal.sndsrv.linux.c:73: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 (s, argv[1]); data/xgalaga-2.1.1.0/xgal.sndsrv.linux.c:75: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 (s, FILENAME[i]); data/xgalaga-2.1.1.0/xgal.sndsrv.linux.c:77: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 (FILENAME[i],s); data/xgalaga-2.1.1.0/xgal.sndsrv.sun.c:67: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 (s, argv[1]); data/xgalaga-2.1.1.0/xgal.sndsrv.sun.c:69: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 (s, FILENAME[i]); data/xgalaga-2.1.1.0/xgal.sndsrv.sun.c:71: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 (FILENAME[i],s); data/xgalaga-2.1.1.0/defs.h:50:11: [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. # define random() rand() data/xgalaga-2.1.1.0/defs.h:52:11: [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. # define random() lrand48() data/xgalaga-2.1.1.0/defs.h:52:20: [3] (random) lrand48: 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. # define random() lrand48() data/xgalaga-2.1.1.0/highscore.c:164: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. if((home = getenv("HOME"))) { data/xgalaga-2.1.1.0/highscore.c:361:28: [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. W_SetRGB16(W_DarkGrey, random()%65535,random()%65535,random()%65535); data/xgalaga-2.1.1.0/highscore.c:361:43: [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. W_SetRGB16(W_DarkGrey, random()%65535,random()%65535,random()%65535); data/xgalaga-2.1.1.0/highscore.c:361:58: [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. W_SetRGB16(W_DarkGrey, random()%65535,random()%65535,random()%65535); data/xgalaga-2.1.1.0/highscore.c:432: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. if((home = getenv("HOME"))) { data/xgalaga-2.1.1.0/main.c:127:22: [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. stars[i].x = random()%WINWIDTH; data/xgalaga-2.1.1.0/main.c:128:22: [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. stars[i].y = random()%WINHEIGHT; data/xgalaga-2.1.1.0/main.c:129: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. stars[i].speed = (random()%3)+1; data/xgalaga-2.1.1.0/main.c:130: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. switch(random()%5) { data/xgalaga-2.1.1.0/main.c:178:30: [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. stars[i].x = random() % WINWIDTH; data/xgalaga-2.1.1.0/main.c:179:24: [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. switch(random()%5) { data/xgalaga-2.1.1.0/main.c:336:11: [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. ((random()%10000) < (level + 2 *(48-(livecount)))))) { data/xgalaga-2.1.1.0/main.c:337: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. switch(random()%2) { data/xgalaga-2.1.1.0/main.c:408:40: [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. if(numetorps < maxetorps && (!(random()%tc))) { data/xgalaga-2.1.1.0/main.c:551:44: [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. switch(random()%8) { data/xgalaga-2.1.1.0/main.c:585:36: [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. if(random()%2) { data/xgalaga-2.1.1.0/main.c:601:52: [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. if(numetorps < maxetorps && (!(random()%tc))) { data/xgalaga-2.1.1.0/main.c:719:38: [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. if(!(random()%(gotlemon ? 3 : PRIZECHANCE))) data/xgalaga-2.1.1.0/nas_sound.c:180:20: [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 ((str = getenv("XGAL_SOUND_DIR")) != NULL) data/xgalaga-2.1.1.0/prize.c:85:15: [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. p->type = random()%NUMPRIZES; data/xgalaga-2.1.1.0/prize.c:225:10: [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. if(!(random()%(gotlemon ? 3 : PRIZECHANCE))) data/xgalaga-2.1.1.0/highscore.c:43: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 new_name[20]; data/xgalaga-2.1.1.0/highscore.c:51: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[20]; data/xgalaga-2.1.1.0/highscore.c:69: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 buf[21]; data/xgalaga-2.1.1.0/highscore.c:87: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 fullname[80]; data/xgalaga-2.1.1.0/highscore.c:139: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 my_file_name [256], *home; data/xgalaga-2.1.1.0/highscore.c:141:11: [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). hsf = open(SCOREFILE, O_WRONLY | O_TRUNC | O_CREAT, 0666); data/xgalaga-2.1.1.0/highscore.c:173:8: [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). hsf = open(my_file_name, O_WRONLY | O_TRUNC | O_CREAT, 0644); data/xgalaga-2.1.1.0/highscore.c:358: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 buf[60]; data/xgalaga-2.1.1.0/highscore.c:368: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(buf, "Rank Name Score Level"); data/xgalaga-2.1.1.0/highscore.c:380: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(buf, "Rank Name Score Level"); data/xgalaga-2.1.1.0/highscore.c:396: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 my_file_name[256], *home; data/xgalaga-2.1.1.0/highscore.c:399:11: [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). hsf = open(SCOREFILE, O_RDONLY); data/xgalaga-2.1.1.0/highscore.c:434:8: [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). hsf = open(my_file_name, O_RDONLY); data/xgalaga-2.1.1.0/libsprite/color.c:61:2: [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(xc, &xcolor, sizeof(xcolor)); data/xgalaga-2.1.1.0/libsprite/event.c:95:4: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy(&buttonEvent, wevent, sizeof(W_Event)); data/xgalaga-2.1.1.0/libsprite/event.c:234:3: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy(wevent, &buttonEvent, sizeof(W_Event)); data/xgalaga-2.1.1.0/libsprite/event.c:257:6: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy(wevent, &buttonEvent, sizeof(W_Event)); data/xgalaga-2.1.1.0/libsprite/image.c:135: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[BUFSIZ]; data/xgalaga-2.1.1.0/libsprite/image.c:265:23: [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). image->frames = atoi(attributes.extensions[i].lines[0]); data/xgalaga-2.1.1.0/libsprite/init.c:154: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 defaultstring[100]; data/xgalaga-2.1.1.0/libsprite/init.c:188: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. W_Root, (char *) solid, TILESIDE, TILESIDE, data/xgalaga-2.1.1.0/libsprite/init.c:275: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(&allocated_colors[7], &foo, sizeof(foo)); data/xgalaga-2.1.1.0/libsprite/init.c:279: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(&allocated_colors[0], &foo, sizeof(foo)); data/xgalaga-2.1.1.0/libsprite/init.c:283: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(&allocated_colors[1], &foo, sizeof(foo)); data/xgalaga-2.1.1.0/libsprite/init.c:287: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(&allocated_colors[2], &foo, sizeof(foo)); data/xgalaga-2.1.1.0/libsprite/init.c:291: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(&allocated_colors[4], &foo, sizeof(foo)); data/xgalaga-2.1.1.0/libsprite/init.c:295: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(&allocated_colors[3], &foo, sizeof(foo)); data/xgalaga-2.1.1.0/libsprite/init.c:299: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(&allocated_colors[6], &foo, sizeof(foo)); data/xgalaga-2.1.1.0/libsprite/init.c:303: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(&allocated_colors[5], &foo, sizeof(foo)); data/xgalaga-2.1.1.0/libsprite/makewindow.c:34: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 buf[100]; data/xgalaga-2.1.1.0/libsprite/makewindow.c:50: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). *width = atoi(adefault); data/xgalaga-2.1.1.0/libsprite/makewindow.c:57:12: [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). *height = atoi(adefault); data/xgalaga-2.1.1.0/libsprite/makewindow.c:67:10: [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). *x = atoi(adefault + 1); data/xgalaga-2.1.1.0/libsprite/makewindow.c:72:10: [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). *y = atoi(s + 1); data/xgalaga-2.1.1.0/libsprite/makewindow.c:85: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 buf[100]; data/xgalaga-2.1.1.0/libsprite/makewindow.c:116: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 buf[100]; data/xgalaga-2.1.1.0/libsprite/makewindow.c:175: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 buf[100]; data/xgalaga-2.1.1.0/libsprite/makewindow.c:186: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 buf[100]; data/xgalaga-2.1.1.0/libsprite/makewindow.c:301:2: [2] (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 string. strcat(newname,"_border"); data/xgalaga-2.1.1.0/linux-joystick.c:51: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). js_device = open("/dev/js0",O_RDONLY|O_NONBLOCK); data/xgalaga-2.1.1.0/main.c:220: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[20]; data/xgalaga-2.1.1.0/main.c:226:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf, "LEVEL %d", level+1); data/xgalaga-2.1.1.0/main.c:236: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, "Torps: %d Hits: %d", shots, hits); data/xgalaga-2.1.1.0/main.c:240: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, "(%d%%)", 100 * hits / shots); data/xgalaga-2.1.1.0/main.c:1304:27: [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). && atoi(argv[ac+1]) >= 1) data/xgalaga-2.1.1.0/main.c:1307:24: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). nlev = atoi(argv[ac+1]); data/xgalaga-2.1.1.0/nas_sound.c:42: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 errorString[255]; data/xgalaga-2.1.1.0/nas_sound.c:159: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 fbuf[1024]; data/xgalaga-2.1.1.0/pathfile.c:55: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 nextline[MAXLINE]; data/xgalaga-2.1.1.0/pathfile.c:136: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 dir[40]; data/xgalaga-2.1.1.0/pathfile.c:147:10: [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). sx = atoi(pstr); data/xgalaga-2.1.1.0/pathfile.c:148:10: [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). sy = atoi(comma+1); data/xgalaga-2.1.1.0/pathfile.c:193:13: [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). duration = atoi(fnd); data/xgalaga-2.1.1.0/pathfile.c:283:17: [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). al_delays[i] = atoi(chk); data/xgalaga-2.1.1.0/pathfile.c:293: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 filename[MAXFILENAME]; data/xgalaga-2.1.1.0/pathfile.c:294: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 readline[MAXLINE]; data/xgalaga-2.1.1.0/pathfile.c:309:6: [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(filename, "./levels"); data/xgalaga-2.1.1.0/pathfile.c:321:10: [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). lf = fopen(filename, "r"); data/xgalaga-2.1.1.0/pathfile.c:330:8: [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). lf = fopen(filename, "r"); data/xgalaga-2.1.1.0/score.c:15: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 scorestr[40] = "Score: 0000000", shipstr[4] =""; data/xgalaga-2.1.1.0/score.c:78: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(scorestr, "Score: %07d Level: %02d %c", score, level, playSounds ? ' ':'Q'); data/xgalaga-2.1.1.0/score.c:80: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(scorestr, "Sore: %07d Level: %02d", score, level); data/xgalaga-2.1.1.0/score.c:92:2: [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(shipstr, "%d", ships); data/xgalaga-2.1.1.0/sound.c:33: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 sound_flags[20]; /* Sound Flag for sound 1-19 */ data/xgalaga-2.1.1.0/sound.c:39: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 *argv[4]; data/xgalaga-2.1.1.0/sound.c:40: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 filename[512]; data/xgalaga-2.1.1.0/title.c:69: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 buf[40]; data/xgalaga-2.1.1.0/title.c:75:6: [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, "- %d", (i+1)*100); data/xgalaga-2.1.1.0/title.c:77:6: [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/xgalaga-2.1.1.0/title.c:116: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 *chFBuf, chLBuf[LINESIZE+1]; data/xgalaga-2.1.1.0/title.c:123:11: [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). hsf = open (CREDITSFILE, O_RDONLY); data/xgalaga-2.1.1.0/title.c:180: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 chLBuf[LINESIZE+1]; data/xgalaga-2.1.1.0/title.c:205: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 chLBuf[LINESIZE+1]; data/xgalaga-2.1.1.0/title.c:236: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 vbuf[10]; data/xgalaga-2.1.1.0/xgal.sndsrv.freebsd.c:33: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. signed char *sound_buffer[NUM_SOUNDS]; data/xgalaga-2.1.1.0/xgal.sndsrv.freebsd.c:49: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 s[1024]; data/xgalaga-2.1.1.0/xgal.sndsrv.freebsd.c:85: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). dsp = open(dspdev, O_RDWR); data/xgalaga-2.1.1.0/xgal.sndsrv.freebsd.c:114: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). mixer = open("/dev/mixer",O_RDWR | O_NONBLOCK); data/xgalaga-2.1.1.0/xgal.sndsrv.freebsd.c:148:8: [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(FILENAME[k], O_RDONLY); data/xgalaga-2.1.1.0/xgal.sndsrv.freebsd.c:184: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. unsigned char final[512]; /* Final Mixing Buffer */ data/xgalaga-2.1.1.0/xgal.sndsrv.freebsd.c:261: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 filename[512]; data/xgalaga-2.1.1.0/xgal.sndsrv.linux.c:46: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 *sound_buffer[NUM_SOUNDS]; data/xgalaga-2.1.1.0/xgal.sndsrv.linux.c:62: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 s[1024]; data/xgalaga-2.1.1.0/xgal.sndsrv.linux.c:100: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). dsp = open(dspdev, O_WRONLY); /* sound is ok*/ data/xgalaga-2.1.1.0/xgal.sndsrv.linux.c:129: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). mixer = open("/dev/mixer",O_RDWR | O_NONBLOCK); data/xgalaga-2.1.1.0/xgal.sndsrv.linux.c:152:8: [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(FILENAME[k], O_RDONLY); data/xgalaga-2.1.1.0/xgal.sndsrv.linux.c:190: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. unsigned char final[fragsize]; /* Final Mixing Buffer */ data/xgalaga-2.1.1.0/xgal.sndsrv.sun.c:24:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(s,d,l) memcpy(d,s,l) data/xgalaga-2.1.1.0/xgal.sndsrv.sun.c:24:22: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(s,d,l) memcpy(d,s,l) data/xgalaga-2.1.1.0/xgal.sndsrv.sun.c:40: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. signed char *sound_buffer[NUM_SOUNDS]; data/xgalaga-2.1.1.0/xgal.sndsrv.sun.c:56: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 s[1024]; data/xgalaga-2.1.1.0/xgal.sndsrv.sun.c:90: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). dsp = open(dspdev, O_RDWR); data/xgalaga-2.1.1.0/xgal.sndsrv.sun.c:119:8: [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(FILENAME[k], O_RDONLY); data/xgalaga-2.1.1.0/xgal.sndsrv.sun.c:155: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. unsigned char final[512]; /* Final Mixing Buffer */ data/xgalaga-2.1.1.0/xgal.sndsrv.sun.c:190:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy(playing+i+1,playing+i,(playnum-i)*sizeof(int)); data/xgalaga-2.1.1.0/xgal.sndsrv.sun.c:191:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy(position+i+1,position+i,(playnum-i)*sizeof(int)); data/xgalaga-2.1.1.0/highscore.c:74:10: [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). nnpos = strlen(new_name); data/xgalaga-2.1.1.0/highscore.c:370:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). W_MakeLine(baseWin, WINWIDTH/2-((strlen(buf)*W_Textwidth)/2), 111, data/xgalaga-2.1.1.0/highscore.c:371: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). WINWIDTH/2 + ((strlen(buf)*W_Textwidth)/2), 111, W_Red); data/xgalaga-2.1.1.0/highscore.c:382:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). W_MakeLine(baseWin, WINWIDTH/2-((strlen(buf)*W_Textwidth)/2), 123+(NUM_GLOBAL_SCORES+1)*W_Textheight, data/xgalaga-2.1.1.0/highscore.c:383: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). WINWIDTH/2 + ((strlen(buf)*W_Textwidth)/2), 123+(NUM_GLOBAL_SCORES+1)*W_Textheight, W_Red); data/xgalaga-2.1.1.0/highscore.c:413:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(hsf, &global_scores[i].uid, sizeof(long)) < sizeof(long)) data/xgalaga-2.1.1.0/highscore.c:416:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(hsf, global_scores[i].name, 20) < 20) data/xgalaga-2.1.1.0/highscore.c:418:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(hsf, &global_scores[i].score, sizeof(long)) < sizeof(long)) data/xgalaga-2.1.1.0/highscore.c:420:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(hsf, &global_scores[i].level, sizeof(long)) < sizeof(long)) data/xgalaga-2.1.1.0/highscore.c:444:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(hsf, my_scores[i].name, 20) < 20) data/xgalaga-2.1.1.0/highscore.c:446:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(hsf, &my_scores[i].score, sizeof(long)) < sizeof(long)) data/xgalaga-2.1.1.0/highscore.c:448:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(hsf, &my_scores[i].level, sizeof(long)) < sizeof(long)) data/xgalaga-2.1.1.0/libsprite/image.c:10: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). imagedir = malloc(strlen(dir)+256); data/xgalaga-2.1.1.0/libsprite/image.c:150:52: [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(imagedirend == NULL) imagedirend = imagedir + strlen(imagedir); data/xgalaga-2.1.1.0/libsprite/makewindow.c:298:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char *newname = (char*) malloc (strlen(name) + 8); data/xgalaga-2.1.1.0/libsprite/menu.c:34:27: [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). items[n].string, (int)strlen(items[n].string)); data/xgalaga-2.1.1.0/libsprite/menu.c:72:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(news, str, (unsigned)len); data/xgalaga-2.1.1.0/libsprite/scroll.c:25:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(newstring, str, (unsigned)len); data/xgalaga-2.1.1.0/libsprite/scroll.c:72: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). WIN_EDGE, MENU_PAD + y, list->string,(int)strlen(list->string)); data/xgalaga-2.1.1.0/libsprite/text.c:135: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). y = strlen(string); data/xgalaga-2.1.1.0/linux-joystick.c:29:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(read(js_device,&event,sizeof(struct js_event))>0) { data/xgalaga-2.1.1.0/main.c:230:120: [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). W_MaskText(baseWin, WINWIDTH/2 - (W_StringWidth(buf, W_BigFont)/2), WINHEIGHT/2-W_BigTextheight/2, W_Red, buf, strlen(buf), W_BigFont); data/xgalaga-2.1.1.0/main.c:237:44: [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). W_MaskText(baseWin, x, y, W_Yellow, buf, strlen(buf), W_RegularFont); data/xgalaga-2.1.1.0/main.c:241:43: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). W_MaskText(baseWin, x, y, W_Green, buf, strlen(buf), W_RegularFont); data/xgalaga-2.1.1.0/nas_sound.c:176:40: [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). sound_table[num_sounds].name = malloc(strlen(filename) + 1); data/xgalaga-2.1.1.0/nas_sound.c:185:44: [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). sound_table[num_sounds].filename = malloc(strlen(fbuf) + 1); data/xgalaga-2.1.1.0/pathfile.c:64: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). nextline[strlen(nextline) - 1] = 0; data/xgalaga-2.1.1.0/pathfile.c:66:5: [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(nextline) + strlen(buf) >= MAXLINE) { data/xgalaga-2.1.1.0/pathfile.c:66: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(strlen(nextline) + strlen(buf) >= MAXLINE) { data/xgalaga-2.1.1.0/pathfile.c:71: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). strcpy(buf + strlen(buf), nextline); data/xgalaga-2.1.1.0/pathfile.c:73: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). if(nextline[strlen(nextline) -1] != '\\') data/xgalaga-2.1.1.0/pathfile.c:76:10: [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) -1] = ' '; data/xgalaga-2.1.1.0/pathfile.c:316:27: [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). real_level_path = malloc(strlen(filename) + 1); data/xgalaga-2.1.1.0/score.c:83: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). basex = WINWIDTH/2 - ((strlen(scorestr)/2)*W_Textwidth); data/xgalaga-2.1.1.0/score.c:84:54: [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). W_MaskText(shellWin, basex, 1, W_Grey, scorestr, strlen(scorestr), W_RegularFont); data/xgalaga-2.1.1.0/score.c:85:58: [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). W_MaskText(shellWin, basex+1, 0, W_Yellow, scorestr, strlen(scorestr), W_RegularFont); data/xgalaga-2.1.1.0/score.c:94: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). W_MaskText(shellWin, basex, 1, W_Grey, shipstr, strlen(shipstr), W_RegularFont); data/xgalaga-2.1.1.0/score.c:95:54: [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). W_MaskText(shellWin, basex+1, 0, W_Yellow, shipstr, strlen(shipstr), W_RegularFont); data/xgalaga-2.1.1.0/title.c:52:40: [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). W_MaskText(baseWin, WINWIDTH/2 - ((strlen(text)*W_Textwidth)/2), y, color, data/xgalaga-2.1.1.0/title.c:53: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). text, strlen(text), W_RegularFont); data/xgalaga-2.1.1.0/title.c:79: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). W_Yellow, buf, strlen(buf), W_RegularFont); data/xgalaga-2.1.1.0/title.c:126:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). l = read (hsf, chFBuf, 8000); data/xgalaga-2.1.1.0/title.c:138:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (gchLBuf+(lines*(LINESIZE+1)), chLBuf, LINESIZE); data/xgalaga-2.1.1.0/title.c:156:15: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (gchLBuf+(lines*(LINESIZE+1)), chLBuf, LINESIZE); data/xgalaga-2.1.1.0/title.c:187:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (chLBuf, gchLBuf+i*(LINESIZE+1), LINESIZE); data/xgalaga-2.1.1.0/title.c:212:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (chLBuf, gchLBuf+i*(LINESIZE+1), LINESIZE); data/xgalaga-2.1.1.0/xgal.sndsrv.freebsd.c:61:16: [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 (s[(int)strlen(s) - 1] == '/') FILENAME[i]++; data/xgalaga-2.1.1.0/xgal.sndsrv.freebsd.c:63:32: [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). FILENAME[i] = malloc ((int)strlen (s)); data/xgalaga-2.1.1.0/xgal.sndsrv.freebsd.c:166:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(fd,sound_buffer[k],size); data/xgalaga-2.1.1.0/xgal.sndsrv.freebsd.c:191:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i=read(STDIN_FILENO,&k,sizeof(k)); data/xgalaga-2.1.1.0/xgal.sndsrv.linux.c:74:16: [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 (s[(int)strlen(s) - 1] == '/') FILENAME[i]++; data/xgalaga-2.1.1.0/xgal.sndsrv.linux.c:76:32: [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). FILENAME[i] = malloc ((int)strlen (s)+1); data/xgalaga-2.1.1.0/xgal.sndsrv.linux.c:170:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size = read(fd,sound_buffer[k],size); data/xgalaga-2.1.1.0/xgal.sndsrv.linux.c:197:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i=read(STDIN_FILENO,&k,sizeof(k)); data/xgalaga-2.1.1.0/xgal.sndsrv.sun.c:68:16: [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 (s[(int)strlen(s) - 1] == '/') FILENAME[i]++; data/xgalaga-2.1.1.0/xgal.sndsrv.sun.c:70:32: [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). FILENAME[i] = malloc ((int)strlen (s)); data/xgalaga-2.1.1.0/xgal.sndsrv.sun.c:137:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(fd,sound_buffer[k],size); data/xgalaga-2.1.1.0/xgal.sndsrv.sun.c:162:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i=read(STDIN_FILENO,&k,sizeof(k)); ANALYSIS SUMMARY: Hits = 223 Lines analyzed = 18847 in approximately 0.57 seconds (33306 lines/second) Physical Source Lines of Code (SLOC) = 16186 Hits@level = [0] 109 [1] 58 [2] 96 [3] 24 [4] 45 [5] 0 Hits@level+ = [0+] 332 [1+] 223 [2+] 165 [3+] 69 [4+] 45 [5+] 0 Hits/KSLOC@level+ = [0+] 20.5116 [1+] 13.7773 [2+] 10.194 [3+] 4.26294 [4+] 2.78018 [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.