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/adplug-2.3.3+dfsg/adplugdb/getopt.c Examining data/adplug-2.3.3+dfsg/adplugdb/mygetopt.h Examining data/adplug-2.3.3+dfsg/adplugdb/adplugdb.cpp Examining data/adplug-2.3.3+dfsg/src/diskopl.cpp Examining data/adplug-2.3.3+dfsg/src/dfm.h Examining data/adplug-2.3.3+dfsg/src/rix.cpp Examining data/adplug-2.3.3+dfsg/src/cmf.cpp Examining data/adplug-2.3.3+dfsg/src/mad.h Examining data/adplug-2.3.3+dfsg/src/adtrack.h Examining data/adplug-2.3.3+dfsg/src/psi.cpp Examining data/adplug-2.3.3+dfsg/src/bam.h Examining data/adplug-2.3.3+dfsg/src/imf.h Examining data/adplug-2.3.3+dfsg/src/vgm.h Examining data/adplug-2.3.3+dfsg/src/woodyopl.h Examining data/adplug-2.3.3+dfsg/src/debug.c Examining data/adplug-2.3.3+dfsg/src/u6m.h Examining data/adplug-2.3.3+dfsg/src/xad.h Examining data/adplug-2.3.3+dfsg/src/fmc.cpp Examining data/adplug-2.3.3+dfsg/src/rat.h Examining data/adplug-2.3.3+dfsg/src/mkj.cpp Examining data/adplug-2.3.3+dfsg/src/a2m.h Examining data/adplug-2.3.3+dfsg/src/dro.cpp Examining data/adplug-2.3.3+dfsg/src/sop.h Examining data/adplug-2.3.3+dfsg/src/amd.h Examining data/adplug-2.3.3+dfsg/src/nukedopl.c Examining data/adplug-2.3.3+dfsg/src/s3m.h Examining data/adplug-2.3.3+dfsg/src/cff.h Examining data/adplug-2.3.3+dfsg/src/bmf.cpp Examining data/adplug-2.3.3+dfsg/src/nemuopl.h Examining data/adplug-2.3.3+dfsg/src/mus.cpp Examining data/adplug-2.3.3+dfsg/src/rad2.cpp Examining data/adplug-2.3.3+dfsg/src/realopl.cpp Examining data/adplug-2.3.3+dfsg/src/herad.cpp Examining data/adplug-2.3.3+dfsg/src/nemuopl.cpp Examining data/adplug-2.3.3+dfsg/src/adlib.cpp Examining data/adplug-2.3.3+dfsg/src/mkj.h Examining data/adplug-2.3.3+dfsg/src/player.h Examining data/adplug-2.3.3+dfsg/src/player.cpp Examining data/adplug-2.3.3+dfsg/src/adplug.cpp Examining data/adplug-2.3.3+dfsg/src/realopl.h Examining data/adplug-2.3.3+dfsg/src/xsm.h Examining data/adplug-2.3.3+dfsg/src/lds.cpp Examining data/adplug-2.3.3+dfsg/src/rol.h Examining data/adplug-2.3.3+dfsg/src/hyp.h Examining data/adplug-2.3.3+dfsg/src/adlibemu.h Examining data/adplug-2.3.3+dfsg/src/dro.h Examining data/adplug-2.3.3+dfsg/src/wemuopl.h Examining data/adplug-2.3.3+dfsg/src/diskopl.h Examining data/adplug-2.3.3+dfsg/src/players.h Examining data/adplug-2.3.3+dfsg/src/dtm.cpp Examining data/adplug-2.3.3+dfsg/src/kemuopl.h Examining data/adplug-2.3.3+dfsg/src/s3m.cpp Examining data/adplug-2.3.3+dfsg/src/msc.cpp Examining data/adplug-2.3.3+dfsg/src/got.cpp Examining data/adplug-2.3.3+dfsg/src/sng.h Examining data/adplug-2.3.3+dfsg/src/lds.h Examining data/adplug-2.3.3+dfsg/src/load_helper.h Examining data/adplug-2.3.3+dfsg/src/rix.h Examining data/adplug-2.3.3+dfsg/src/fprovide.h Examining data/adplug-2.3.3+dfsg/src/mus.h Examining data/adplug-2.3.3+dfsg/src/rad2.h Examining data/adplug-2.3.3+dfsg/src/hyp.cpp Examining data/adplug-2.3.3+dfsg/src/mdi.cpp Examining data/adplug-2.3.3+dfsg/src/cmfmcsop.cpp Examining data/adplug-2.3.3+dfsg/src/dro2.h Examining data/adplug-2.3.3+dfsg/src/vgm.cpp Examining data/adplug-2.3.3+dfsg/src/raw.h Examining data/adplug-2.3.3+dfsg/src/fmopl.h Examining data/adplug-2.3.3+dfsg/src/fprovide.cpp Examining data/adplug-2.3.3+dfsg/src/xsm.cpp Examining data/adplug-2.3.3+dfsg/src/protrack.cpp Examining data/adplug-2.3.3+dfsg/src/sng.cpp Examining data/adplug-2.3.3+dfsg/src/adtrack.cpp Examining data/adplug-2.3.3+dfsg/src/analopl.cpp Examining data/adplug-2.3.3+dfsg/src/dtm.h Examining data/adplug-2.3.3+dfsg/src/ksm.h Examining data/adplug-2.3.3+dfsg/src/adlib.h Examining data/adplug-2.3.3+dfsg/src/woodyopl.cpp Examining data/adplug-2.3.3+dfsg/src/jbm.h Examining data/adplug-2.3.3+dfsg/src/hsc.h Examining data/adplug-2.3.3+dfsg/src/raw.cpp Examining data/adplug-2.3.3+dfsg/src/flash.cpp Examining data/adplug-2.3.3+dfsg/src/herad.h Examining data/adplug-2.3.3+dfsg/src/players.cpp Examining data/adplug-2.3.3+dfsg/src/jbm.cpp Examining data/adplug-2.3.3+dfsg/src/cff.cpp Examining data/adplug-2.3.3+dfsg/src/emuopl.h Examining data/adplug-2.3.3+dfsg/src/opl.h Examining data/adplug-2.3.3+dfsg/src/database.cpp Examining data/adplug-2.3.3+dfsg/src/adlibemu.c Examining data/adplug-2.3.3+dfsg/src/sa2.h Examining data/adplug-2.3.3+dfsg/src/got.h Examining data/adplug-2.3.3+dfsg/src/ksm.cpp Examining data/adplug-2.3.3+dfsg/src/psi.h Examining data/adplug-2.3.3+dfsg/src/mididata.h Examining data/adplug-2.3.3+dfsg/src/nukedopl.h Examining data/adplug-2.3.3+dfsg/src/rat.cpp Examining data/adplug-2.3.3+dfsg/src/rol.cpp Examining data/adplug-2.3.3+dfsg/src/fmc.h Examining data/adplug-2.3.3+dfsg/src/dro2.cpp Examining data/adplug-2.3.3+dfsg/src/protrack.h Examining data/adplug-2.3.3+dfsg/src/surroundopl.h Examining data/adplug-2.3.3+dfsg/src/sop.cpp Examining data/adplug-2.3.3+dfsg/src/cmfmcsop.h Examining data/adplug-2.3.3+dfsg/src/bam.cpp Examining data/adplug-2.3.3+dfsg/src/debug.h Examining data/adplug-2.3.3+dfsg/src/d00.h Examining data/adplug-2.3.3+dfsg/src/surroundopl.cpp Examining data/adplug-2.3.3+dfsg/src/dmo.h Examining data/adplug-2.3.3+dfsg/src/mtk.cpp Examining data/adplug-2.3.3+dfsg/src/hsp.cpp Examining data/adplug-2.3.3+dfsg/src/database.h Examining data/adplug-2.3.3+dfsg/src/emuopl.cpp Examining data/adplug-2.3.3+dfsg/src/adl.h Examining data/adplug-2.3.3+dfsg/src/bmf.h Examining data/adplug-2.3.3+dfsg/src/adplug.h Examining data/adplug-2.3.3+dfsg/src/msc.h Examining data/adplug-2.3.3+dfsg/src/d00.cpp Examining data/adplug-2.3.3+dfsg/src/mad.cpp Examining data/adplug-2.3.3+dfsg/src/imf.cpp Examining data/adplug-2.3.3+dfsg/src/mdi.h Examining data/adplug-2.3.3+dfsg/src/version.h Examining data/adplug-2.3.3+dfsg/src/fmopl.c Examining data/adplug-2.3.3+dfsg/src/flash.h Examining data/adplug-2.3.3+dfsg/src/dfm.cpp Examining data/adplug-2.3.3+dfsg/src/cmf.h Examining data/adplug-2.3.3+dfsg/src/sa2.cpp Examining data/adplug-2.3.3+dfsg/src/mid.h Examining data/adplug-2.3.3+dfsg/src/temuopl.h Examining data/adplug-2.3.3+dfsg/src/hsp.h Examining data/adplug-2.3.3+dfsg/src/hybrid.h Examining data/adplug-2.3.3+dfsg/src/u6m.cpp Examining data/adplug-2.3.3+dfsg/src/adl.cpp Examining data/adplug-2.3.3+dfsg/src/a2m.cpp Examining data/adplug-2.3.3+dfsg/src/silentopl.h Examining data/adplug-2.3.3+dfsg/src/dmo.cpp Examining data/adplug-2.3.3+dfsg/src/mid.cpp Examining data/adplug-2.3.3+dfsg/src/hybrid.cpp Examining data/adplug-2.3.3+dfsg/src/analopl.h Examining data/adplug-2.3.3+dfsg/src/amd.cpp Examining data/adplug-2.3.3+dfsg/src/xad.cpp Examining data/adplug-2.3.3+dfsg/src/temuopl.cpp Examining data/adplug-2.3.3+dfsg/src/mtk.h Examining data/adplug-2.3.3+dfsg/src/hsc.cpp FINAL RESULTS: data/adplug-2.3.3+dfsg/adplugdb/adplugdb.cpp:128:3: [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. vfprintf(stderr, fmt, argptr); data/adplug-2.3.3+dfsg/src/debug.c:44:5: [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. vfprintf(log, fmt, argptr); data/adplug-2.3.3+dfsg/src/debug.c:47:5: [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. vfprintf(stderr, fmt, argptr); data/adplug-2.3.3+dfsg/src/herad.cpp:69:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(scomp, ", %s packed", (comp == HERAD_COMP_HSQ ? "HSQ" : "SQX")); data/adplug-2.3.3+dfsg/src/herad.cpp:71:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(type, "HERAD System %s (version %d%s)", (AGD ? "AGD" : "SDB"), (v2 ? 2 : 1), scomp); data/adplug-2.3.3+dfsg/src/ksm.cpp:59: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(fn, filename.c_str()); data/adplug-2.3.3+dfsg/src/mid.cpp:88:20: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define midiprintf printf data/adplug-2.3.3+dfsg/src/mid.cpp:199: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(pfilename,fname.c_str()); data/adplug-2.3.3+dfsg/src/players.cpp:67: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(extensions + extlength - 1, ext); data/adplug-2.3.3+dfsg/src/rol.cpp:199: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(fn,filename.data()); data/adplug-2.3.3+dfsg/src/sa2.cpp:256: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(bufinst,buf); data/adplug-2.3.3+dfsg/src/vgm.cpp:288:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tmpstr, "Video Game Music %x.%x (%s)", major, minor, chip); data/adplug-2.3.3+dfsg/src/vgm.cpp:325:7: [4] (shell) system: 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. char system[256]; system[0] = 0; data/adplug-2.3.3+dfsg/src/vgm.cpp:325:20: [4] (shell) system: 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. char system[256]; system[0] = 0; data/adplug-2.3.3+dfsg/src/vgm.cpp:339:12: [4] (shell) system: 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. wcstombs(system, GD3.system_en, 256); data/adplug-2.3.3+dfsg/src/vgm.cpp:343:12: [4] (shell) system: 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. wcstombs(system, GD3.system_jp, 256); data/adplug-2.3.3+dfsg/src/vgm.cpp:350:6: [4] (shell) system: 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. if (system[0] && date[0]) data/adplug-2.3.3+dfsg/src/vgm.cpp:352:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str_sys, "%s / %s", system, date); data/adplug-2.3.3+dfsg/src/vgm.cpp:352:31: [4] (shell) system: 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. sprintf(str_sys, "%s / %s", system, date); data/adplug-2.3.3+dfsg/src/vgm.cpp:354:11: [4] (shell) system: 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. else if (system[0]) data/adplug-2.3.3+dfsg/src/vgm.cpp:356: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(str_sys, system); data/adplug-2.3.3+dfsg/src/vgm.cpp:356:19: [4] (shell) system: 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. strcpy(str_sys, system); data/adplug-2.3.3+dfsg/src/vgm.cpp:360: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(str_sys, date); data/adplug-2.3.3+dfsg/src/vgm.cpp:368:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str_game, "%s (%s)", game, str_sys); data/adplug-2.3.3+dfsg/src/vgm.cpp:372:4: [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(str_game, game); data/adplug-2.3.3+dfsg/src/vgm.cpp:377: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(str_game, str_sys); data/adplug-2.3.3+dfsg/src/vgm.cpp:381:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str_desc, "%s\r\n\r\n%s", str_game, notes); data/adplug-2.3.3+dfsg/src/vgm.cpp:385: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(str_desc, str_game); data/adplug-2.3.3+dfsg/adplugdb/adplugdb.cpp:310:16: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while((opt = getopt(argc, argv, "d:t:qvhVsck")) != -1) data/adplug-2.3.3+dfsg/adplugdb/adplugdb.cpp:349:17: [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. cfg.homedir = getenv("HOME"); data/adplug-2.3.3+dfsg/adplugdb/getopt.c:210:9: [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. #ifndef getenv data/adplug-2.3.3+dfsg/adplugdb/getopt.c:211:14: [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. extern char *getenv (); data/adplug-2.3.3+dfsg/adplugdb/getopt.c:403:21: [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. posixly_correct = getenv ("POSIXLY_CORRECT"); data/adplug-2.3.3+dfsg/adplugdb/getopt.c:972:1: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (argc, argv, optstring) data/adplug-2.3.3+dfsg/adplugdb/getopt.c:1002:11: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt (argc, argv, "abc:d:0123456789"); data/adplug-2.3.3+dfsg/adplugdb/mygetopt.h:138:12: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt (int __argc, char *const *__argv, const char *__shortopts); data/adplug-2.3.3+dfsg/adplugdb/mygetopt.h:140:12: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt (int, char *const *, const char *); data/adplug-2.3.3+dfsg/adplugdb/mygetopt.h:142:12: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt (); data/adplug-2.3.3+dfsg/adplugdb/mygetopt.h:146:12: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts, data/adplug-2.3.3+dfsg/adplugdb/mygetopt.h:161:12: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt (int, char **, const char *); data/adplug-2.3.3+dfsg/adplugdb/mygetopt.h:164:12: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt_long (int, char **, const char *, data/adplug-2.3.3+dfsg/adplugdb/mygetopt.h:177:12: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt (); data/adplug-2.3.3+dfsg/adplugdb/mygetopt.h:179:12: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt_long (); data/adplug-2.3.3+dfsg/src/a2m.cpp:64:22: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/a2m.cpp:65: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 id[10]; data/adplug-2.3.3+dfsg/src/a2m.cpp:71:18: [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. const unsigned char convfx[16] = {0,1,2,23,24,3,5,4,6,9,17,13,11,19,7,14}; data/adplug-2.3.3+dfsg/src/a2m.cpp:72:18: [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. const unsigned char convinf1[16] = {0,1,2,6,7,8,9,4,5,3,10,11,12,13,14,15}; data/adplug-2.3.3+dfsg/src/a2m.cpp:118: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(songname,orgptr,43); orgptr += 43; data/adplug-2.3.3+dfsg/src/a2m.cpp:119: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(author,orgptr,43); orgptr += 43; data/adplug-2.3.3+dfsg/src/a2m.cpp:120: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(instname,orgptr,250*33); orgptr += 250*33; data/adplug-2.3.3+dfsg/src/a2m.cpp:154: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(order,orgptr,128); orgptr += 128; data/adplug-2.3.3+dfsg/src/a2m.h:75: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 songname[43], author[43], instname[250][33]; data/adplug-2.3.3+dfsg/src/adl.cpp:2361:22: [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). binistream *f = fp.open(filename); data/adplug-2.3.3+dfsg/src/adl.cpp:2447: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(_trackEntries, p, _EntriesSize); data/adplug-2.3.3+dfsg/src/adl.cpp:2452: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(_trackEntries16, p, _EntriesSize); data/adplug-2.3.3+dfsg/src/adl.cpp:2461: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(_soundDataPtr, p, soundDataSize*sizeof(uint8)); data/adplug-2.3.3+dfsg/src/adl.cpp:2559: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 tmpstr[25]; data/adplug-2.3.3+dfsg/src/adl.cpp:2561: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(tmpstr, "Westwood ADL (version %d)", _version); data/adplug-2.3.3+dfsg/src/adlibemu.c:93: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. static unsigned char adlibreg[256], ksl[8][16]; data/adplug-2.3.3+dfsg/src/adlibemu.c:94: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. static unsigned char modulatorbase[9] = {0,1,2,8,9,10,16,17,18}; data/adplug-2.3.3+dfsg/src/adlibemu.c:96: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. static unsigned char base2cell[22] = {0,1,2,0,1,2,0,0,3,4,5,3,4,5,0,0,6,7,8,6,7,8}; data/adplug-2.3.3+dfsg/src/adtrack.cpp:47:22: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/adtrack.cpp: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 note[2]; data/adplug-2.3.3+dfsg/src/adtrack.cpp:64:14: [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). instf = fp.open(instfilename); data/adplug-2.3.3+dfsg/src/amd.cpp:34:22: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/amd.cpp:36: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 id[9]; data/adplug-2.3.3+dfsg/src/amd.cpp:41:18: [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. const unsigned char convfx[10] = {0,1,2,9,17,11,13,18,3,14}; data/adplug-2.3.3+dfsg/src/amd.cpp:42:18: [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. const unsigned char convvol[64] = { data/adplug-2.3.3+dfsg/src/amd.h:48: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 songname[24],author[24],instname[26][23]; data/adplug-2.3.3+dfsg/src/analopl.h:41: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 keyregs[2][9][2]; // shadow key register data/adplug-2.3.3+dfsg/src/bam.cpp:70:28: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/bam.cpp:71: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 id[4]; data/adplug-2.3.3+dfsg/src/bmf.cpp:119: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(bmf.title, &tune[ptr], len + 1); data/adplug-2.3.3+dfsg/src/bmf.cpp:130: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(bmf.author, &tune[ptr], len + 1); data/adplug-2.3.3+dfsg/src/bmf.h:50: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 title[36]; data/adplug-2.3.3+dfsg/src/bmf.h: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 author[36]; data/adplug-2.3.3+dfsg/src/bmf.h:57:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[11]; data/adplug-2.3.3+dfsg/src/bmf.h:58:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char data[13]; data/adplug-2.3.3+dfsg/src/bmf.h:86:25: [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 const unsigned char bmf_adlib_registers[117]; data/adplug-2.3.3+dfsg/src/bmf.h:89:25: [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 const unsigned char bmf_default_instrument[13]; data/adplug-2.3.3+dfsg/src/cff.cpp:42:22: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/cff.cpp:43:18: [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. const unsigned char conv_inst[11] = { 2,1,10,9,4,3,6,5,0,8,7 }; data/adplug-2.3.3+dfsg/src/cff.cpp:102: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(&instruments[i],&module[i*32],sizeof(cff_instrument)); data/adplug-2.3.3+dfsg/src/cff.cpp:114: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(song_title,&module[0x614],20); data/adplug-2.3.3+dfsg/src/cff.cpp:115: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(song_author,&module[0x600],20); data/adplug-2.3.3+dfsg/src/cff.cpp:118: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(order,&module[0x628],64); data/adplug-2.3.3+dfsg/src/cff.cpp:123:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char old_event_byte2[9]; data/adplug-2.3.3+dfsg/src/cff.cpp:403:13: [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 temp_string[256]; data/adplug-2.3.3+dfsg/src/cff.cpp:452: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 translated_string[256]; data/adplug-2.3.3+dfsg/src/cff.cpp:456: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(translated_string,dictionary[code - 0x104],(*(dictionary[code - 0x104])) + 1); data/adplug-2.3.3+dfsg/src/cff.cpp:464: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(string,translated_string,256); data/adplug-2.3.3+dfsg/src/cff.cpp:500: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(&heap[heap_length],string,string[0] + 1); data/adplug-2.3.3+dfsg/src/cff.h:76:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char the_string[256]; data/adplug-2.3.3+dfsg/src/cff.h:81: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 id[16]; data/adplug-2.3.3+dfsg/src/cff.h:85: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. unsigned char reserved[12]; data/adplug-2.3.3+dfsg/src/cff.h:90: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. unsigned char data[12]; data/adplug-2.3.3+dfsg/src/cff.h:91: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[21]; data/adplug-2.3.3+dfsg/src/cff.h:94: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 song_title[20]; data/adplug-2.3.3+dfsg/src/cff.h:95: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 song_author[20]; data/adplug-2.3.3+dfsg/src/cmf.cpp:111:22: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/cmf.cpp:113: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 cSig[4]; data/adplug-2.3.3+dfsg/src/cmfmcsop.cpp:114:21: [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). binistream* f = fp.open(filename); data/adplug-2.3.3+dfsg/src/cmfmcsop.h:70: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 name[14]; data/adplug-2.3.3+dfsg/src/d00.cpp:61:22: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/d00.cpp:458: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. unsigned char volume[9],dummy[5]; data/adplug-2.3.3+dfsg/src/d00.cpp:466: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(&tpoin, filedata + dataofs, sizeof(Stpoin)); data/adplug-2.3.3+dfsg/src/d00.cpp:495: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 tmpstr[40]; data/adplug-2.3.3+dfsg/src/d00.cpp:497: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(tmpstr,"EdLib packed (version %d)",version > 1 ? header->version : header1->version); data/adplug-2.3.3+dfsg/src/d00.h: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 id[6]; data/adplug-2.3.3+dfsg/src/d00.h:57: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 songname[32],author[32],dummy[32]; data/adplug-2.3.3+dfsg/src/d00.h:76: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. unsigned char data[11],tunelev,timer,sr,dummy[2]; data/adplug-2.3.3+dfsg/src/debug.c:34:9: [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). log = fopen(filename,"wt"); data/adplug-2.3.3+dfsg/src/dfm.cpp:35:22: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/dfm.cpp:38:18: [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. const unsigned char convfx[8] = {255,255,17,19,23,24,255,13}; data/adplug-2.3.3+dfsg/src/dfm.cpp:121: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 tmpstr[20]; data/adplug-2.3.3+dfsg/src/dfm.cpp:123: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(tmpstr,"Digital-FM %d.%d",header.hiver,header.lover); data/adplug-2.3.3+dfsg/src/dfm.h:46: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 id[4]; data/adplug-2.3.3+dfsg/src/dfm.h:50: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 songinfo[33]; data/adplug-2.3.3+dfsg/src/dfm.h:51: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 instname[32][12]; data/adplug-2.3.3+dfsg/src/diskopl.cpp:33:7: [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). f = fopen(filename.c_str(),"wb"); data/adplug-2.3.3+dfsg/src/diskopl.h:44:25: [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 const unsigned char op_table[9]; data/adplug-2.3.3+dfsg/src/dmo.cpp:59: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 chkhdr[16]; data/adplug-2.3.3+dfsg/src/dmo.cpp:67: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). f = fp.open(filename); data/adplug-2.3.3+dfsg/src/dro.cpp:59:21: [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). binistream *f = fp.open(filename); data/adplug-2.3.3+dfsg/src/dro.cpp:62: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 id[8]; data/adplug-2.3.3+dfsg/src/dro.h:46: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 title[40]; data/adplug-2.3.3+dfsg/src/dro.h:47: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 author[40]; data/adplug-2.3.3+dfsg/src/dro.h:48: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 desc[1023]; data/adplug-2.3.3+dfsg/src/dro2.cpp:52:21: [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). binistream *f = fp.open(filename); data/adplug-2.3.3+dfsg/src/dro2.cpp:55: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 id[8]; data/adplug-2.3.3+dfsg/src/dro2.h:45: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 title[40]; data/adplug-2.3.3+dfsg/src/dro2.h:46: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 author[40]; data/adplug-2.3.3+dfsg/src/dro2.h:47: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 desc[1023]; data/adplug-2.3.3+dfsg/src/dtm.cpp:37:22: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/dtm.cpp:38:18: [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. const unsigned char conv_inst[11] = { 2,1,10,9,4,3,6,5,0,8,7 }; data/adplug-2.3.3+dfsg/src/dtm.h:46: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 id[12]; data/adplug-2.3.3+dfsg/src/dtm.h:48: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 title[20]; data/adplug-2.3.3+dfsg/src/dtm.h:49: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 author[20]; data/adplug-2.3.3+dfsg/src/dtm.h:54: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 desc[80*16]; data/adplug-2.3.3+dfsg/src/dtm.h:58: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[13]; data/adplug-2.3.3+dfsg/src/dtm.h:59: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. unsigned char data[12]; data/adplug-2.3.3+dfsg/src/emuopl.cpp:122: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)[i] = (outbuf[i] >> 8) ^ 0x80; data/adplug-2.3.3+dfsg/src/flash.h:53:25: [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 const unsigned char flash_adlib_registers[99]; data/adplug-2.3.3+dfsg/src/flash.h:56:25: [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 const unsigned char flash_default_instrument[8]; data/adplug-2.3.3+dfsg/src/fmc.cpp:34:22: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/fmc.cpp:35:18: [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. const unsigned char conv_fx[16] = {0,1,2,3,4,8,255,255,255,255,26,11,12,13,14,15}; data/adplug-2.3.3+dfsg/src/fmc.h:50:4: [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 id[4]; data/adplug-2.3.3+dfsg/src/fmc.h:51:4: [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 title[21]; data/adplug-2.3.3+dfsg/src/fmc.h:87:4: [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[21]; data/adplug-2.3.3+dfsg/src/fmopl.c:1251: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). opl_dbg_fp = fopen("opllog.opl","wb"); data/adplug-2.3.3+dfsg/src/fprovide.cpp:55:35: [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). binistream *CProvider_Filesystem::open(std::string filename) const data/adplug-2.3.3+dfsg/src/fprovide.h:35:23: [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). virtual binistream *open(std::string) const = 0; data/adplug-2.3.3+dfsg/src/fprovide.h:46:23: [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). virtual binistream *open(std::string filename) const; data/adplug-2.3.3+dfsg/src/got.cpp:41:21: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/herad.cpp:67: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 scomp[12 + 1] = ""; data/adplug-2.3.3+dfsg/src/herad.cpp:70: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 type[40 + 1]; data/adplug-2.3.3+dfsg/src/herad.cpp:240: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. std::memcpy(dst, src, sizeof(uint16_t)); data/adplug-2.3.3+dfsg/src/herad.cpp:513:21: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/herad.cpp:558: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(data, out, size); data/adplug-2.3.3+dfsg/src/herad.cpp:569: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(data, out, size); data/adplug-2.3.3+dfsg/src/herad.cpp:637: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(track[i].data, data + offset, track[i].size); data/adplug-2.3.3+dfsg/src/herad.cpp:644: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(inst[i].data, data + offset + i * HERAD_INST_SIZE, HERAD_INST_SIZE); data/adplug-2.3.3+dfsg/src/hsc.cpp:36:22: [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). binistream *f = fp.open(filename); data/adplug-2.3.3+dfsg/src/hsc.h:60: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 instr[128][12]; // instrument data data/adplug-2.3.3+dfsg/src/hsc.h:61: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 song[0x80]; // song-arrangement (MPU-401 Trakker enhanced) data/adplug-2.3.3+dfsg/src/hsc.h:66: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 adl_freq[9]; // adlib frequency registers data/adplug-2.3.3+dfsg/src/hsp.cpp:33:22: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/hsp.cpp:63: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(instr, org, 128 * 12); // instruments data/adplug-2.3.3+dfsg/src/hsp.cpp:69: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(song, org + 128 * 12, 51); // tracklist data/adplug-2.3.3+dfsg/src/hsp.cpp:70: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(patterns, org + 128 * 12 + 51, orgsize - 128 * 12 - 51); // patterns data/adplug-2.3.3+dfsg/src/hybrid.h:41: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 name[7]; data/adplug-2.3.3+dfsg/src/hybrid.h:86:24: [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 const unsigned char hyb_adlib_registers[99]; data/adplug-2.3.3+dfsg/src/hybrid.h:88:24: [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 const unsigned char hyb_default_instrument[11]; data/adplug-2.3.3+dfsg/src/hyp.h:51:25: [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 const unsigned char hyp_adlib_registers[99]; data/adplug-2.3.3+dfsg/src/imf.cpp:58:22: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/imf.cpp:64: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 header[5]; data/adplug-2.3.3+dfsg/src/jbm.cpp:49:23: [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 const unsigned char percmx_tab[4] = { 0x14, 0x12, 0x15, 0x11 }; data/adplug-2.3.3+dfsg/src/jbm.cpp:50:23: [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 const unsigned char perchn_tab[5] = { 6, 7, 8, 8, 7 }; data/adplug-2.3.3+dfsg/src/jbm.cpp:51: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. static unsigned char percmaskoff[5] = { 0xef, 0xf7, 0xfb, 0xfd, 0xfe }; data/adplug-2.3.3+dfsg/src/jbm.cpp:52: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. static unsigned char percmaskon[5] = { 0x10, 0x08, 0x04, 0x02, 0x01 }; data/adplug-2.3.3+dfsg/src/jbm.cpp:68:22: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/jbm.h:68: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. unsigned char frq[2]; data/adplug-2.3.3+dfsg/src/ksm.cpp:63:3: [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(fn + i + 1, "insts.dat"); data/adplug-2.3.3+dfsg/src/ksm.cpp:65: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). f = fp.open(fn); data/adplug-2.3.3+dfsg/src/ksm.cpp:75: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). f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/ksm.cpp:234: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 instbuf[11]; data/adplug-2.3.3+dfsg/src/ksm.h:53: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 trinst[16],trquant[16],trchan[16],trvol[16],inst[256][11],databuf[2048],chanfreq[18],chantrack[18]; data/adplug-2.3.3+dfsg/src/ksm.h:54: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 instname[256][20]; data/adplug-2.3.3+dfsg/src/lds.cpp:94: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). f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/lds.cpp:659: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(c->arp_tab, i->arp_tab, 12); data/adplug-2.3.3+dfsg/src/lds.h:46: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. unsigned char mod_misc, mod_vol, mod_ad, mod_sr, mod_wave, data/adplug-2.3.3+dfsg/src/lds.h:58: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. unsigned char finetune, glideto, portspeed, nextvol, volmod, volcar, data/adplug-2.3.3+dfsg/src/lds.h:81: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 fmchip[0xff], jumping, fadeonoff, allvolume, hardfade, data/adplug-2.3.3+dfsg/src/load_helper.h:31:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(&result, src, sizeof(T)); data/adplug-2.3.3+dfsg/src/mad.cpp:34:22: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/mad.cpp:35:18: [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. const unsigned char conv_inst[10] = { 2,1,10,9,4,3,6,5,8,7 }; data/adplug-2.3.3+dfsg/src/mad.cpp: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 id[4]; f->readString(id, 4); data/adplug-2.3.3+dfsg/src/mad.h:43:4: [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[8]; data/adplug-2.3.3+dfsg/src/mad.h:44:13: [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 data[12]; // last two unused data/adplug-2.3.3+dfsg/src/mdi.cpp:41:21: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/mdi.cpp:55: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 chunk[MIDI_CHUNK_SIZE + 1]; data/adplug-2.3.3+dfsg/src/mid.cpp:194: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. unsigned char ins[28]; data/adplug-2.3.3+dfsg/src/mid.cpp:208: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(pfilename+j,"patch.003"); data/adplug-2.3.3+dfsg/src/mid.cpp:210:12: [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 = fp.open(pfilename); data/adplug-2.3.3+dfsg/src/mid.cpp:256: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(smyinsbank, myinsbank, 128 * 16); data/adplug-2.3.3+dfsg/src/mid.cpp:300:24: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/mid.cpp:302: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. unsigned char s[6]; data/adplug-2.3.3+dfsg/src/mid.cpp:892: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. unsigned char ins[16]; data/adplug-2.3.3+dfsg/src/mid.cpp:1058:8: [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(myinsbank, smyinsbank, 128 * 16); data/adplug-2.3.3+dfsg/src/mid.cpp:1085:8: [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(myinsbank, smyinsbank, 128 * 16); data/adplug-2.3.3+dfsg/src/mid.h:56: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. unsigned char ins[11]; data/adplug-2.3.3+dfsg/src/mid.h:78: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 adlib_data[256]; data/adplug-2.3.3+dfsg/src/mid.h:81: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 myinsbank[128][16], smyinsbank[128][16]; data/adplug-2.3.3+dfsg/src/mididata.h:25:10: [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 midi_fm_instruments[128][14] = data/adplug-2.3.3+dfsg/src/mkj.cpp:35:22: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/mkj.cpp:36: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 id[6]; data/adplug-2.3.3+dfsg/src/msc.cpp:72: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). bf = fp.open (filename); data/adplug-2.3.3+dfsg/src/msc.cpp:177: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 vstr [40]; data/adplug-2.3.3+dfsg/src/msc.cpp:179: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(vstr, "AdLib MSCplay (version %d)", version); data/adplug-2.3.3+dfsg/src/mtk.cpp:34:22: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/mtk.cpp:36: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 id[18]; data/adplug-2.3.3+dfsg/src/mtk.cpp:40: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 songname[34],composername[34],instname[0x80][34]; data/adplug-2.3.3+dfsg/src/mtk.cpp:41: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. unsigned char insts[0x80][12],order[0x80],dummy,patterns[0x32][0x40][9]; data/adplug-2.3.3+dfsg/src/mtk.cpp:110: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(&org[orgptr],&org[orgptr - offs],cnt); data/adplug-2.3.3+dfsg/src/mtk.cpp:117: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(&org[orgptr],&org[orgptr-offs],cmd); data/adplug-2.3.3+dfsg/src/mtk.cpp:132: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(instr,data->insts,0x80 * 12); data/adplug-2.3.3+dfsg/src/mtk.cpp:133: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(song,data->order,0x80); data/adplug-2.3.3+dfsg/src/mtk.cpp:141: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(patterns, data->patterns, cnt); data/adplug-2.3.3+dfsg/src/mtk.h: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 title[34],composer[34],instname[0x80][34]; data/adplug-2.3.3+dfsg/src/mus.cpp:50: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 tmpstr[30]; data/adplug-2.3.3+dfsg/src/mus.cpp:53: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(tmpstr, "IMPlay Song Format v%d.%d", majorVersion, minorVersion); data/adplug-2.3.3+dfsg/src/mus.cpp:55: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(tmpstr, "AdLib MIDI Format v%d.%d", majorVersion, minorVersion); data/adplug-2.3.3+dfsg/src/mus.cpp:61:21: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/mus.cpp:237:21: [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). binistream *f = fp.open(fname); data/adplug-2.3.3+dfsg/src/mus.cpp:280:18: [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. f->readString((char *)insts[i].data, TIMBRE_DEF_LEN * 2); data/adplug-2.3.3+dfsg/src/mus.cpp:289:21: [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). binistream *f = fp.open(fname); data/adplug-2.3.3+dfsg/src/mus.cpp:316: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 signature[BNK_SIGNATURE_LEN + 1]; data/adplug-2.3.3+dfsg/src/mus.h:134: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 tuneName[TUNE_NAME_SIZE]; data/adplug-2.3.3+dfsg/src/mus.h:146: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 name[TIMBRE_NAME_SIZE]; data/adplug-2.3.3+dfsg/src/player.h:82:24: [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 const unsigned char op_table[9]; // the 9 operators as expected by the OPL data/adplug-2.3.3+dfsg/src/players.cpp:39: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(extensions, pd.extensions, extlength); data/adplug-2.3.3+dfsg/src/players.cpp:54: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(extensions, ext, extlength); data/adplug-2.3.3+dfsg/src/protrack.cpp:549: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(notetable, newnotetable, 12 * 2); data/adplug-2.3.3+dfsg/src/protrack.h:63: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. unsigned char data[11],arpstart,arpspeed,arppos,arpspdcnt,misc; data/adplug-2.3.3+dfsg/src/protrack.h:94:25: [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 const unsigned char vibratotab[32]; data/adplug-2.3.3+dfsg/src/psi.h:43: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. unsigned char note_delay[9]; data/adplug-2.3.3+dfsg/src/psi.h:44: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. unsigned char note_curdelay[9]; data/adplug-2.3.3+dfsg/src/psi.h:45: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. unsigned char looping[9]; data/adplug-2.3.3+dfsg/src/psi.h:62:25: [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 const unsigned char psi_adlib_registers[99]; data/adplug-2.3.3+dfsg/src/rad2.cpp:490: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 Name[256]; data/adplug-2.3.3+dfsg/src/rad2.cpp:1862:24: [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). binistream *file = fp.open(filename); data/adplug-2.3.3+dfsg/src/rad2.cpp:1865: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 header[17]; data/adplug-2.3.3+dfsg/src/rad2.cpp:1922: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 type[64]; data/adplug-2.3.3+dfsg/src/rad2.cpp:1923: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(type, "Reality ADlib Tracker (version %d)", rad->GetVersion()); data/adplug-2.3.3+dfsg/src/rat.cpp:59: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(&rat.hdr, &tune[0], sizeof(rat_header)); data/adplug-2.3.3+dfsg/src/rat.cpp:83: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(&rat.tracks[i][j][k], event_ptr, sizeof(rat_event)); data/adplug-2.3.3+dfsg/src/rat.cpp:132: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(&event,&rat.tracks[rat.order[rat.order_pos]][rat.pattern_pos][i],sizeof(rat_event)); data/adplug-2.3.3+dfsg/src/rat.h:35: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 id[3]; data/adplug-2.3.3+dfsg/src/rat.h:37: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 title[32]; data/adplug-2.3.3+dfsg/src/rat.h:52: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. unsigned char reserved_32[12]; data/adplug-2.3.3+dfsg/src/rat.h:53: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. unsigned char patseg[2]; data/adplug-2.3.3+dfsg/src/rat.h:67: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. unsigned char freq[2]; data/adplug-2.3.3+dfsg/src/rat.h:68: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. unsigned char reserved_2[2]; data/adplug-2.3.3+dfsg/src/rat.h:82: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. unsigned char reserved_11[3]; data/adplug-2.3.3+dfsg/src/rat.h:117:25: [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 const unsigned char rat_adlib_bases[18]; data/adplug-2.3.3+dfsg/src/raw.cpp:42:22: [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). binistream *f = fp.open(filename); data/adplug-2.3.3+dfsg/src/raw.cpp:45: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 id[8]; data/adplug-2.3.3+dfsg/src/raw.h:67: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 title[40]; data/adplug-2.3.3+dfsg/src/raw.h:68: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 author[60]; data/adplug-2.3.3+dfsg/src/raw.h:69: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 desc[1023]; data/adplug-2.3.3+dfsg/src/realopl.h:62:25: [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 const unsigned char op_table[9]; data/adplug-2.3.3+dfsg/src/realopl.h:67: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 hardvols[2][22][2]; // volume cache data/adplug-2.3.3+dfsg/src/rix.cpp:74:22: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/rol.cpp:187:24: [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). binistream *f = fp.open(filename); data/adplug-2.3.3+dfsg/src/rol.cpp:207: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(fn+i+1,"standard.bnk"); data/adplug-2.3.3+dfsg/src/rol.cpp:635:31: [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). binistream *bnk_file = fp.open(bnk_filename.c_str()); data/adplug-2.3.3+dfsg/src/rol.h:91: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 comment[ROL_COMMENT_SIZE]; data/adplug-2.3.3+dfsg/src/rol.h:98: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 unused2[ROL_UNUSED2_SIZE]; data/adplug-2.3.3+dfsg/src/rol.h:99: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 filler0[ROL_FILLER0_SIZE]; data/adplug-2.3.3+dfsg/src/rol.h:100: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 filler1[ROL_FILLER1_SIZE]; data/adplug-2.3.3+dfsg/src/rol.h:119: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 name[ROL_MAX_NAME_SIZE]; data/adplug-2.3.3+dfsg/src/rol.h:197: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 name[ROL_MAX_NAME_SIZE]; data/adplug-2.3.3+dfsg/src/rol.h:206: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 signature[ROL_BNK_SIGNATURE_SIZE]; data/adplug-2.3.3+dfsg/src/s3m.cpp:61:23: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/s3m.cpp:409: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 filever[5]; data/adplug-2.3.3+dfsg/src/s3m.cpp:412:16: [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. case 0x1300: strcpy(filever,"3.00"); break; data/adplug-2.3.3+dfsg/src/s3m.cpp:413:16: [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. case 0x1301: strcpy(filever,"3.01"); break; data/adplug-2.3.3+dfsg/src/s3m.cpp:414:16: [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. case 0x1303: strcpy(filever,"3.03"); break; data/adplug-2.3.3+dfsg/src/s3m.cpp:415:16: [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. case 0x1320: strcpy(filever,"3.20"); break; data/adplug-2.3.3+dfsg/src/s3m.cpp:416:12: [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. default: strcpy(filever,"3.??"); data/adplug-2.3.3+dfsg/src/s3m.h:62: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[28]; // song name data/adplug-2.3.3+dfsg/src/s3m.h:63: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. unsigned char kennung,typ,dummy[2]; data/adplug-2.3.3+dfsg/src/s3m.h:65: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 scrm[4]; data/adplug-2.3.3+dfsg/src/s3m.h:66: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. unsigned char gv,is,it,mv,uc,dp,dummy2[8]; data/adplug-2.3.3+dfsg/src/s3m.h:68: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. unsigned char chanset[32]; data/adplug-2.3.3+dfsg/src/s3m.h:73: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[15]; data/adplug-2.3.3+dfsg/src/s3m.h:74: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. unsigned char d00,d01,d02,d03,d04,d05,d06,d07,d08,d09,d0a,d0b,volume,dsk,dummy[2]; data/adplug-2.3.3+dfsg/src/s3m.h:76: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 dummy2[12], name[28],scri[4]; data/adplug-2.3.3+dfsg/src/s3m.h:89: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 orders[256]; data/adplug-2.3.3+dfsg/src/s3m.h:95:25: [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 const unsigned char vibratotab[32]; data/adplug-2.3.3+dfsg/src/sa2.cpp:37:22: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/sa2.cpp:39: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. unsigned char data[11],arpstart,arpspeed,arppos,arpspdcnt; data/adplug-2.3.3+dfsg/src/sa2.cpp:43:18: [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. const unsigned char convfx[16] = {0,1,2,3,4,5,6,255,8,255,10,11,12,13,255,15}; data/adplug-2.3.3+dfsg/src/sa2.cpp:232:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmpstr[40]; data/adplug-2.3.3+dfsg/src/sa2.cpp:234: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(tmpstr,"Surprise! Adlib Tracker 2 (version %d)",header.version); data/adplug-2.3.3+dfsg/src/sa2.cpp:240: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 bufinst[29*17],buf[18]; data/adplug-2.3.3+dfsg/src/sa2.cpp:247: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(buf,instname[i]+1,16); data/adplug-2.3.3+dfsg/src/sa2.h:50: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 sadt[4]; data/adplug-2.3.3+dfsg/src/sa2.h:54: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 instname[29][17]; data/adplug-2.3.3+dfsg/src/sng.cpp:32:22: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/sng.h: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 id[4]; data/adplug-2.3.3+dfsg/src/sop.cpp:36:21: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/sop.cpp:52: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 sign[SOP_SIGN_SIZE + 1]; data/adplug-2.3.3+dfsg/src/sop.cpp:153:19: [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. f->readString((char *)inst[i].data, SOP_INST4OP); data/adplug-2.3.3+dfsg/src/sop.cpp:162:19: [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. f->readString((char *)inst[i].data, SOP_INST2OP); data/adplug-2.3.3+dfsg/src/sop.cpp:178:18: [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. f->readString((char *)track[i].data, track[i].size); data/adplug-2.3.3+dfsg/src/sop.h:92: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 VolumeTable[ 64 * 128 ]; /* Pre-calculated Volume Table */ data/adplug-2.3.3+dfsg/src/sop.h:93: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 voiceNote[20]; /* pitch of last note-on of each voice */ data/adplug-2.3.3+dfsg/src/sop.h:94: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 voiceKeyOn[20]; /* state of keyOn bit of each voice */ data/adplug-2.3.3+dfsg/src/sop.h:95: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 vPitchBend[20]; /* current pitch bend of each voice */ data/adplug-2.3.3+dfsg/src/sop.h:96: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 Ksl[20]; /* KSL value for Slot 1 */ data/adplug-2.3.3+dfsg/src/sop.h:97: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 Ksl2[20]; /* KSL value for Slot 2 */ data/adplug-2.3.3+dfsg/src/sop.h:98: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 Ksl2V[20]; /* Parallel connection? */ data/adplug-2.3.3+dfsg/src/sop.h:99: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 VoiceVolume[20], OP_MASK; data/adplug-2.3.3+dfsg/src/sop.h:100: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 ymbuf[ 2 * YMB_SIZE ]; data/adplug-2.3.3+dfsg/src/sop.h:101: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 OP4[20]; data/adplug-2.3.3+dfsg/src/sop.h:102: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 Stereo[22]; data/adplug-2.3.3+dfsg/src/sop.h:106:24: [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 const unsigned char SlotX[maxVoices * 2]; data/adplug-2.3.3+dfsg/src/sop.h:107:24: [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 const unsigned char VolReg[11 * 2]; data/adplug-2.3.3+dfsg/src/sop.h:195: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 type[36]; data/adplug-2.3.3+dfsg/src/sop.h:196: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(type, "Note Sequencer v%u.%u by sopepos", (version >> 8) & 0xFF, version & 0xFF); data/adplug-2.3.3+dfsg/src/sop.h:229: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 fname[SOP_FILENAME]; data/adplug-2.3.3+dfsg/src/sop.h:230: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 title[SOP_TITLE]; data/adplug-2.3.3+dfsg/src/sop.h:232: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 comment[SOP_COMMENT]; data/adplug-2.3.3+dfsg/src/sop.h:237: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[SOP_INSTNAME + 1]; data/adplug-2.3.3+dfsg/src/sop.h:238: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 longname[SOP_LONGNAME + 1]; data/adplug-2.3.3+dfsg/src/surroundopl.cpp:101:15: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((unsigned char *)buf)[i * 2] = CV_16_8(l); data/adplug-2.3.3+dfsg/src/surroundopl.cpp:102:15: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((unsigned char *)buf)[i * 2 + 1] = CV_16_8(r); data/adplug-2.3.3+dfsg/src/temuopl.cpp:60: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)[i] = (tempbuf[i] >> 8) ^ 0x80; data/adplug-2.3.3+dfsg/src/u6m.cpp:40: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). f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/u6m.cpp:46:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char pseudo_header[6]; data/adplug-2.3.3+dfsg/src/u6m.cpp:912:18: [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. const unsigned char adlib_channel_to_carrier_offset[9] = data/adplug-2.3.3+dfsg/src/u6m.cpp:914:18: [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. const unsigned char adlib_channel_to_modulator_offset[9] = data/adplug-2.3.3+dfsg/src/u6m.h:115: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 vb_current_value[9]; data/adplug-2.3.3+dfsg/src/u6m.h:116: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 vb_double_amplitude[9]; data/adplug-2.3.3+dfsg/src/u6m.h:117: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 vb_multiplier[9]; data/adplug-2.3.3+dfsg/src/u6m.h:118: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 vb_direction_flag[9]; data/adplug-2.3.3+dfsg/src/u6m.h:120: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 carrier_mf[9]; data/adplug-2.3.3+dfsg/src/u6m.h:121:10: [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 carrier_mf_signed_delta[9]; data/adplug-2.3.3+dfsg/src/u6m.h:122: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 carrier_mf_mod_delay_backup[9]; data/adplug-2.3.3+dfsg/src/u6m.h:123: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 carrier_mf_mod_delay[9]; data/adplug-2.3.3+dfsg/src/u6m.h:126:10: [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 channel_freq_signed_delta[9]; data/adplug-2.3.3+dfsg/src/vgm.cpp:56:21: [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). binistream *f = fp.open(filename); data/adplug-2.3.3+dfsg/src/vgm.cpp:72: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 id[4]; data/adplug-2.3.3+dfsg/src/vgm.cpp:277: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 chip[10]; data/adplug-2.3.3+dfsg/src/vgm.cpp:280:3: [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(chip, "OPL3"); data/adplug-2.3.3+dfsg/src/vgm.cpp:282:3: [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(chip, "Dual OPL2"); data/adplug-2.3.3+dfsg/src/vgm.cpp:284:3: [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(chip, "OPL2"); data/adplug-2.3.3+dfsg/src/vgm.cpp:285: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 tmpstr[40]; data/adplug-2.3.3+dfsg/src/vgm.cpp:294: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 str[256]; data/adplug-2.3.3+dfsg/src/vgm.cpp:309: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 str[256]; data/adplug-2.3.3+dfsg/src/vgm.cpp:324: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 game[256]; game[0] = 0; data/adplug-2.3.3+dfsg/src/vgm.cpp:325: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 system[256]; system[0] = 0; data/adplug-2.3.3+dfsg/src/vgm.cpp:326: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 date[256]; date[0] = 0; data/adplug-2.3.3+dfsg/src/vgm.cpp:327: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 notes[256]; notes[0] = 0; data/adplug-2.3.3+dfsg/src/vgm.cpp:349: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 str_sys[256]; str_sys[0] = 0; data/adplug-2.3.3+dfsg/src/vgm.cpp:362: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 str_game[256]; str_game[0] = 0; data/adplug-2.3.3+dfsg/src/vgm.cpp:363: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 str_desc[256]; str_desc[0] = 0; data/adplug-2.3.3+dfsg/src/vgm.h:98:3: [2] (buffer) wchar_t: 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. wchar_t title_en[256], title_jp[256]; data/adplug-2.3.3+dfsg/src/vgm.h:99:3: [2] (buffer) wchar_t: 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. wchar_t game_en[256], game_jp[256]; data/adplug-2.3.3+dfsg/src/vgm.h:100:3: [2] (buffer) wchar_t: 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. wchar_t system_en[256], system_jp[256]; data/adplug-2.3.3+dfsg/src/vgm.h:101:3: [2] (buffer) wchar_t: 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. wchar_t author_en[256], author_jp[256]; data/adplug-2.3.3+dfsg/src/vgm.h:102:3: [2] (buffer) wchar_t: 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. wchar_t date[256], ripper[256], notes[256]; data/adplug-2.3.3+dfsg/src/xad.cpp:48:21: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/xad.h:89: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 title[36]; data/adplug-2.3.3+dfsg/src/xad.h:90:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char author[36]; data/adplug-2.3.3+dfsg/src/xad.h:107: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 adlib[256]; data/adplug-2.3.3+dfsg/src/xsm.cpp:38:22: [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). binistream *f = fp.open(filename); if(!f) return false; data/adplug-2.3.3+dfsg/src/xsm.cpp: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 id[6]; data/adplug-2.3.3+dfsg/src/xsm.h:45: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. unsigned char value[11]; data/adplug-2.3.3+dfsg/adplugdb/getopt.c:233:51: [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 (!defined __STDC__ || !__STDC__) && !defined strlen data/adplug-2.3.3+dfsg/adplugdb/getopt.c:236:12: [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). extern int strlen (const char *); data/adplug-2.3.3+dfsg/adplugdb/getopt.c:434: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). int len = nonoption_flags_max_len = strlen (orig_str); data/adplug-2.3.3+dfsg/adplugdb/getopt.c:659: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). == (unsigned int) strlen (p->name)) data/adplug-2.3.3+dfsg/adplugdb/getopt.c:683: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). nextchar += strlen (nextchar); data/adplug-2.3.3+dfsg/adplugdb/getopt.c:715:17: [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). nextchar += strlen (nextchar); data/adplug-2.3.3+dfsg/adplugdb/getopt.c:731:17: [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). nextchar += strlen (nextchar); data/adplug-2.3.3+dfsg/adplugdb/getopt.c:736: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). nextchar += strlen (nextchar); data/adplug-2.3.3+dfsg/adplugdb/getopt.c:847:51: [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 ((unsigned int) (nameend - nextchar) == strlen (p->name)) data/adplug-2.3.3+dfsg/adplugdb/getopt.c:870: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). nextchar += strlen (nextchar); data/adplug-2.3.3+dfsg/adplugdb/getopt.c:890:19: [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). nextchar += strlen (nextchar); data/adplug-2.3.3+dfsg/adplugdb/getopt.c:904:19: [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). nextchar += strlen (nextchar); data/adplug-2.3.3+dfsg/adplugdb/getopt.c:908: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). nextchar += strlen (nextchar); data/adplug-2.3.3+dfsg/src/bmf.cpp:135:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(bmf.title, xad.title, sizeof(bmf.title)); data/adplug-2.3.3+dfsg/src/bmf.cpp:136:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(bmf.author, xad.author, sizeof(bmf.author)); data/adplug-2.3.3+dfsg/src/database.cpp:65: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). unsigned int idlen = strlen(DB_FILEID_V10); data/adplug-2.3.3+dfsg/src/fprovide.cpp:35:6: [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(fname) < strlen(ext) || data/adplug-2.3.3+dfsg/src/fprovide.cpp:35: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). if(strlen(fname) < strlen(ext) || data/adplug-2.3.3+dfsg/src/fprovide.cpp:36: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). stricmp(fname + strlen(fname) - strlen(ext), ext)) data/adplug-2.3.3+dfsg/src/fprovide.cpp:36: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). stricmp(fname + strlen(fname) - strlen(ext), ext)) data/adplug-2.3.3+dfsg/src/ksm.cpp:60: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). for(i = strlen(fn) - 1; i >= 0; i--) data/adplug-2.3.3+dfsg/src/mid.cpp:201: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). for(i=strlen(pfilename)-1; i >= 0; i--) data/adplug-2.3.3+dfsg/src/mtk.cpp:127:23: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). memset(title,0,34); strncpy(title,data->songname+1,33); data/adplug-2.3.3+dfsg/src/mtk.cpp:128:26: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). memset(composer,0,34); strncpy(composer,data->composername+1,33); data/adplug-2.3.3+dfsg/src/mtk.cpp:131:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(instname[i],data->instname[i]+1,33); data/adplug-2.3.3+dfsg/src/players.cpp:50: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). while(*i) i += strlen(i) + 1; data/adplug-2.3.3+dfsg/src/players.cpp:64:41: [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). unsigned long newlength = extlength + strlen(ext) + 1; data/adplug-2.3.3+dfsg/src/players.cpp:77:39: [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(j = 0; j < n && (*i); j++, i += strlen(i) + 1) ; data/adplug-2.3.3+dfsg/src/rol.cpp:200: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). for (i = strlen(fn) - 1; i >= 0; i--) ANALYSIS SUMMARY: Hits = 409 Lines analyzed = 39170 in approximately 1.07 seconds (36760 lines/second) Physical Source Lines of Code (SLOC) = 27428 Hits@level = [0] 36 [1] 29 [2] 337 [3] 15 [4] 28 [5] 0 Hits@level+ = [0+] 445 [1+] 409 [2+] 380 [3+] 43 [4+] 28 [5+] 0 Hits/KSLOC@level+ = [0+] 16.2243 [1+] 14.9118 [2+] 13.8545 [3+] 1.56774 [4+] 1.02085 [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.