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/tworld-1.3.2/res.c Examining data/tworld-1.3.2/play.c Examining data/tworld-1.3.2/score.h Examining data/tworld-1.3.2/score.c Examining data/tworld-1.3.2/unslist.h Examining data/tworld-1.3.2/solution.h Examining data/tworld-1.3.2/encoding.c Examining data/tworld-1.3.2/play.h Examining data/tworld-1.3.2/mslogic.c Examining data/tworld-1.3.2/res.h Examining data/tworld-1.3.2/oshw-sdl/sdltimer.c Examining data/tworld-1.3.2/oshw-sdl/sdlsfx.c Examining data/tworld-1.3.2/oshw-sdl/sdlin.c Examining data/tworld-1.3.2/oshw-sdl/sdlgen.h Examining data/tworld-1.3.2/oshw-sdl/sdlerr.c Examining data/tworld-1.3.2/oshw-sdl/ccicon.c Examining data/tworld-1.3.2/oshw-sdl/sdltext.c Examining data/tworld-1.3.2/oshw-sdl/sdltile.c Examining data/tworld-1.3.2/oshw-sdl/sdlout.c Examining data/tworld-1.3.2/oshw-sdl/sdloshw.c Examining data/tworld-1.3.2/help.c Examining data/tworld-1.3.2/tworld.c Examining data/tworld-1.3.2/err.h Examining data/tworld-1.3.2/logic.h Examining data/tworld-1.3.2/cmdline.c Examining data/tworld-1.3.2/series.h Examining data/tworld-1.3.2/state.h Examining data/tworld-1.3.2/help.h Examining data/tworld-1.3.2/ver.h Examining data/tworld-1.3.2/encoding.h Examining data/tworld-1.3.2/gen.h Examining data/tworld-1.3.2/cmdline.h Examining data/tworld-1.3.2/messages.h Examining data/tworld-1.3.2/err.c Examining data/tworld-1.3.2/messages.c Examining data/tworld-1.3.2/lxlogic.c Examining data/tworld-1.3.2/defs.h Examining data/tworld-1.3.2/fileio.c Examining data/tworld-1.3.2/fileio.h Examining data/tworld-1.3.2/oshw.h Examining data/tworld-1.3.2/random.c Examining data/tworld-1.3.2/random.h Examining data/tworld-1.3.2/series.c Examining data/tworld-1.3.2/solution.c Examining data/tworld-1.3.2/unslist.c FINAL RESULTS: data/tworld-1.3.2/fileio.c:389:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(dest, path); data/tworld-1.3.2/fileio.c:434:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(path, filename); data/tworld-1.3.2/fileio.c:493:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(filename, dent->d_name); data/tworld-1.3.2/oshw-sdl/sdlerr.c:39:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. p += sprintf(p, "%s: ", prefix); data/tworld-1.3.2/oshw-sdl/sdlerr.c:41:7: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. p += vsprintf(p, fmt, args); data/tworld-1.3.2/oshw-sdl/sdlerr.c:43:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. p += sprintf(p, " [%s:%lu]", cfile, lineno); data/tworld-1.3.2/oshw-sdl/sdlerr.c:87:2: [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, args); data/tworld-1.3.2/oshw-sdl/sdlout.c:528:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "Password: %s", state->game->passwd); data/tworld-1.3.2/oshw-sdl/sdlout.c:561:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "(Best time: %s)", decimal(besttime, 0)); data/tworld-1.3.2/oshw-sdl/sdlout.c:563:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "Best time: %s", decimal(besttime, 0)); data/tworld-1.3.2/oshw-sdl/sdlout.c:580:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "This level is reported to be unsolvable: %s.", data/tworld-1.3.2/play.c:215:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. p += sprintf(p, "%s-step", state.stepping & 4 ? "odd" : "even"); data/tworld-1.3.2/play.c:261:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(msg, "random slide: %s", dirname); data/tworld-1.3.2/res.c:193:6: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if (sscanf(buf, "%[^=]=%s", name, item) != 2) { data/tworld-1.3.2/res.c:205:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(allresources[ruleset][i], item); data/tworld-1.3.2/res.c:208: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(allresources[j][i], item); data/tworld-1.3.2/score.c:149:14: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. used += 1 + sprintf(textheap + used, "1+%s", data/tworld-1.3.2/score.c:160:15: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. used += 1 + sprintf(textheap + used, "1+%s", data/tworld-1.3.2/score.c:166:19: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. used += 1 + sprintf(textheap + used, "1+%s", data/tworld-1.3.2/score.c:174:15: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. used += 1 + sprintf(textheap + used, "1+%s", data/tworld-1.3.2/score.c:184:15: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. used += 1 + sprintf(textheap + used, "4-%s", game->name); data/tworld-1.3.2/score.c:204:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. used += 1 + sprintf(textheap + used, "3+%s", cdecimal(totalscore, zchar)); data/tworld-1.3.2/score.c:271:14: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. used += 1 + sprintf(textheap + used, "1+%s", data/tworld-1.3.2/score.c:278:18: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. used += 1 + sprintf(textheap + used, "1+%s", data/tworld-1.3.2/score.c:293:18: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. used += 1 + sprintf(textheap + used, "1+%s", decimal(secs, zchar)); data/tworld-1.3.2/score.c:300:15: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. used += 1 + sprintf(textheap + used, " - .%s", data/tworld-1.3.2/series.c:403:9: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if (sscanf(buf, "file = %s", datfilename) != 1) { data/tworld-1.3.2/series.c:414:6: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if (sscanf(buf, "%[^= \t] = %s", name, value) != 2) { data/tworld-1.3.2/series.c:660:14: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. used += 1 + sprintf(textheap + used, data/tworld-1.3.2/series.c:663:14: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. used += 1 + sprintf(textheap + used, data/tworld-1.3.2/tworld.c:1433:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(dir, override); data/tworld-1.3.2/tworld.c:1660:6: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(start->savefilename, start->filename); data/tworld-1.3.2/tworld.c:1661:6: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(start->filename, buf); data/tworld-1.3.2/tworld.c:1876:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(lastseries, spec.series.filebase); data/tworld-1.3.2/unslist.c:178:7: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. n = sscanf(p, "%*d: %s", token); data/tworld-1.3.2/unslist.c:211: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(note, getstring(unslist[i].note)); data/tworld-1.3.2/lxlogic.c:99:9: [3] (random) setstate: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. #define setstate(p) (state = (p)->state) data/tworld-1.3.2/lxlogic.c:1657:5: [3] (random) setstate: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. setstate(logic); data/tworld-1.3.2/lxlogic.c:1799:5: [3] (random) setstate: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. setstate(logic); data/tworld-1.3.2/mslogic.c:62:9: [3] (random) setstate: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. #define setstate(p) (state = (p)->state) data/tworld-1.3.2/mslogic.c:2072:5: [3] (random) setstate: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. setstate(logic); data/tworld-1.3.2/mslogic.c:2167:5: [3] (random) setstate: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. setstate(logic); data/tworld-1.3.2/tworld.c:1475:25: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (!save && (dir = getenv("TWORLDSAVEDIR")) && *dir) { data/tworld-1.3.2/tworld.c:1483:13: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((dir = getenv("TWORLDDIR")) && *dir) { data/tworld-1.3.2/tworld.c:1504:16: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((dir = getenv("HOME")) && *dir && strlen(dir) < maxpath - 8) data/tworld-1.3.2/cmdline.c:149:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/tworld-1.3.2/defs.h:195: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[256]; /* name of the level */ data/tworld-1.3.2/defs.h:196: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 passwd[256]; /* the level's password */ data/tworld-1.3.2/defs.h:230: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 filebase[256]; /* the level set's filename */ data/tworld-1.3.2/defs.h:231: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[256]; /* the filename minus any path */ data/tworld-1.3.2/defs.h:232: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 solheader[256]; /* extra solution header bytes */ data/tworld-1.3.2/encoding.c:279:6: [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(state->hinttext, data, size); data/tworld-1.3.2/encoding.c:348: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(ending.name, "CONGRATULATIONS!"); data/tworld-1.3.2/fileio.c:86:6: [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(file->name, name, n); data/tworld-1.3.2/fileio.c:94:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file->fp = fopen(name, mode); data/tworld-1.3.2/fileio.c:398:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dest, dir, n); data/tworld-1.3.2/fileio.c:406: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(dest + n, path, m + 1); data/tworld-1.3.2/fileio.c:442:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(path, dir, n); data/tworld-1.3.2/fileio.c:444:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(path + n, filename, m + 1); data/tworld-1.3.2/fileio.c:454:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[PATH_MAX + 1]; data/tworld-1.3.2/fileio.c: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(buf, dir, n); data/tworld-1.3.2/fileio.c:468: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 + n, filename, m + 1); data/tworld-1.3.2/messages.c:26:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256], *line; data/tworld-1.3.2/messages.c:72:6: [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(line + linelen, buf, buflen); data/tworld-1.3.2/oshw-sdl/sdlerr.c:33:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char errbuf[4096]; data/tworld-1.3.2/oshw-sdl/sdlgen.h:18: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. signed char w[256]; /* width of each character */ data/tworld-1.3.2/oshw-sdl/sdlgen.h:20: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 *bits[256]; /* pointers to each glyph */ data/tworld-1.3.2/oshw-sdl/sdlin.c:47:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char keystates[SDLK_LAST]; data/tworld-1.3.2/oshw-sdl/sdlin.c:230:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char const joystick_trans[KS_count] = { data/tworld-1.3.2/oshw-sdl/sdlin.c:243:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char const keyboard_trans[KS_count] = { data/tworld-1.3.2/oshw-sdl/sdloshw.c:88:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[512] = "Tile World"; data/tworld-1.3.2/oshw-sdl/sdlout.c:42: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 msg[64]; /* text of the message */ data/tworld-1.3.2/oshw-sdl/sdlout.c:370:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(msgdisplay.msg, msg, msgdisplay.msglen); data/tworld-1.3.2/oshw-sdl/sdlout.c:387:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[32]; data/tworld-1.3.2/oshw-sdl/sdlout.c:514:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[512]; data/tworld-1.3.2/oshw-sdl/sdlout.c:522: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(buf, "Level %d", state->game->number); data/tworld-1.3.2/oshw-sdl/sdlout.c:551:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf, " (+%d)", state->stepping); data/tworld-1.3.2/oshw-sdl/sdlout.c:553:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf, " (odd+%d)", state->stepping & 3); data/tworld-1.3.2/oshw-sdl/sdlout.c:555:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf, " (odd)"); data/tworld-1.3.2/oshw-sdl/sdlout.c:989:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(colstmp, cols, table->cols * sizeof *colstmp); data/tworld-1.3.2/oshw-sdl/sdlsfx.c:238: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(wavecvt, wavein, lengthin); data/tworld-1.3.2/oshw-sdl/sdlsfx.c:335:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[16]; data/tworld-1.3.2/oshw-sdl/sdlsfx.c:347: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(buf, "Volume: %d", v); data/tworld-1.3.2/oshw-sdl/sdltext.c:21: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 brk[267]; data/tworld-1.3.2/play.c:210: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 msg[32], *p; data/tworld-1.3.2/play.c:217:11: [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. p += sprintf(p, " +%d", state.stepping & 3); data/tworld-1.3.2/play.c:247: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 msg[32]; data/tworld-1.3.2/res.c:70: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. typedef char resourceitem[256]; data/tworld-1.3.2/res.c:139: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(allresources[Ruleset_None][RES_IMG_TILES], "tiles.bmp"); data/tworld-1.3.2/res.c:140: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(allresources[Ruleset_None][RES_IMG_FONT], "font.bmp"); data/tworld-1.3.2/res.c:141: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(allresources[Ruleset_None][RES_CLR_BKGND], "000000"); data/tworld-1.3.2/res.c:142: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(allresources[Ruleset_None][RES_CLR_TEXT], "FFFFFF"); data/tworld-1.3.2/res.c:143: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(allresources[Ruleset_None][RES_CLR_BOLD], "FFFF00"); data/tworld-1.3.2/res.c:144: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(allresources[Ruleset_None][RES_CLR_DIM], "C0C0C0"); data/tworld-1.3.2/res.c:145: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(&allresources[Ruleset_MS], globalresources, data/tworld-1.3.2/res.c:147: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(&allresources[Ruleset_Lynx], globalresources, data/tworld-1.3.2/res.c:163:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/tworld-1.3.2/res.c:164: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[256]; data/tworld-1.3.2/score.c:21:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[32]; data/tworld-1.3.2/score.c: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. static char buf[32]; data/tworld-1.3.2/score.c:130:17: [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. used += 1 + sprintf(textheap + used, "1+Level"); data/tworld-1.3.2/score.c:132:17: [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. used += 1 + sprintf(textheap + used, "1-Name"); data/tworld-1.3.2/score.c:134:17: [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. used += 1 + sprintf(textheap + used, "1+Base"); data/tworld-1.3.2/score.c:136:17: [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. used += 1 + sprintf(textheap + used, "1+Bonus"); data/tworld-1.3.2/score.c:138:17: [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. used += 1 + sprintf(textheap + used, "1+Score"); data/tworld-1.3.2/score.c:141:17: [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. used += 1 + sprintf(textheap + used, "4- "); data/tworld-1.3.2/score.c:153:18: [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. used += 1 + sprintf(textheap + used, "1-%.64s", game->name); data/tworld-1.3.2/score.c:156:15: [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. used += 1 + sprintf(textheap + used, "3.*BAD*"); data/tworld-1.3.2/score.c:170:7: [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(textheap + used, "1+---"); data/tworld-1.3.2/score.c:202:17: [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. used += 1 + sprintf(textheap + used, "2-Total Score"); data/tworld-1.3.2/score.c:253:17: [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. used += 1 + sprintf(textheap + used, "1+Level"); data/tworld-1.3.2/score.c:255:17: [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. used += 1 + sprintf(textheap + used, "1-Name"); data/tworld-1.3.2/score.c:257:17: [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. used += 1 + sprintf(textheap + used, "1+Time"); data/tworld-1.3.2/score.c:259:17: [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. used += 1 + sprintf(textheap + used, "1+Solution"); data/tworld-1.3.2/score.c:262:17: [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. used += 1 + sprintf(textheap + used, "1+---"); data/tworld-1.3.2/score.c:274:14: [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. used += 1 + sprintf(textheap + used, "1-%.64s", game->name); data/tworld-1.3.2/score.c:286:18: [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. used += 1 + sprintf(textheap + used, "1.*BAD*"); data/tworld-1.3.2/series.c:210:6: [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(game->name, data, size); data/tworld-1.3.2/series.c:393:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char datfilename[256]; data/tworld-1.3.2/series.c:394:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/tworld-1.3.2/series.c:395: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[256]; data/tworld-1.3.2/series.c:396:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char value[256]; data/tworld-1.3.2/series.c:420:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(series->name, "%.*s", (int)(sizeof series->name - 1), data/tworld-1.3.2/series.c:511: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(series->filebase, "%.*s", (int)(sizeof series->filebase - 1), data/tworld-1.3.2/series.c:513: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(series->name, "%.*s", (int)(sizeof series->name - 1), data/tworld-1.3.2/series.c:623:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char const *rulesetname[Ruleset_Count]; data/tworld-1.3.2/series.c:655:17: [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. used += 1 + sprintf(textheap + used, "1-Filename"); data/tworld-1.3.2/series.c:657:17: [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. used += 1 + sprintf(textheap + used, "1.Ruleset"); data/tworld-1.3.2/series.c:687: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(dest->mapfilename, list[index].mapfilename, n); data/tworld-1.3.2/solution.c:210:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(to->list, from->list, from->count * sizeof *from->list); data/tworld-1.3.2/solution.c:277: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 zeroes[16] = ""; data/tworld-1.3.2/solution.c:512: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(game->passwd, game->solutiondata + 2, 4); data/tworld-1.3.2/solution.c:526:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(game->name, game->solutiondata + 16, size); data/tworld-1.3.2/solution.c:581:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, datname, n); data/tworld-1.3.2/solution.c:582:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf + n, ".tws", 5); data/tworld-1.3.2/solution.c:814:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sdata->pool + sdata->allocated, filename, n); data/tworld-1.3.2/state.h:226: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 hinttext[256]; /* text of the hint */ data/tworld-1.3.2/tworld.c:556: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(stk + 1, subtitle, n); data/tworld-1.3.2/tworld.c:580: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(subtitlestack + 1, subtitle, n); data/tworld-1.3.2/tworld.c:664: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(gs->series.savefilename, "%.*s", getpathbufferlen(), data/tworld-1.3.2/tworld.c:758: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 passwd[5] = ""; data/tworld-1.3.2/tworld.c:787: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 yn[2]; data/tworld-1.3.2/tworld.c:877: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 yn[2]; data/tworld-1.3.2/tworld.c:1541:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(start->savefilename, "%.*s", getpathbufferlen(), val); data/tworld-1.3.2/tworld.c:1543:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(start->filename, "%.*s", getpathbufferlen(), val); data/tworld-1.3.2/tworld.c:1548: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(start->selectfilename, "%.*s", getpathbufferlen(), val); data/tworld-1.3.2/tworld.c:1617:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/tworld-1.3.2/tworld.c:1858: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 lastseries[sizeof spec.series.filebase]; data/tworld-1.3.2/unslist.c:77: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(strings + stringsused, str, len); data/tworld-1.3.2/unslist.c:153:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256], token[256]; data/tworld-1.3.2/cmdline.c:60:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(p); data/tworld-1.3.2/fileio.c:84: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). n = strlen(name) + 1; data/tworld-1.3.2/fileio.c:165:10: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = fgetc(file->fp); data/tworld-1.3.2/fileio.c:219:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(buf); data/tworld-1.3.2/fileio.c:222:11: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = fgetc(file->fp); data/tworld-1.3.2/fileio.c:250:17: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((byte = fgetc(file->fp)) == EOF) data/tworld-1.3.2/fileio.c:273:17: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((byte = fgetc(file->fp)) != EOF) { data/tworld-1.3.2/fileio.c:275:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((byte = fgetc(file->fp)) != EOF) { data/tworld-1.3.2/fileio.c:301:17: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((byte = fgetc(file->fp)) != EOF) { data/tworld-1.3.2/fileio.c:303:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((byte = fgetc(file->fp)) != EOF) { data/tworld-1.3.2/fileio.c:305:18: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((byte = fgetc(file->fp)) != EOF) { data/tworld-1.3.2/fileio.c:307:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((byte = fgetc(file->fp)) != EOF) { data/tworld-1.3.2/fileio.c:384: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). n = strlen(path); data/tworld-1.3.2/fileio.c:392:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(dir); data/tworld-1.3.2/fileio.c:401:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). m = strlen(path); data/tworld-1.3.2/fileio.c:427:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). m = strlen(filename); data/tworld-1.3.2/fileio.c:436: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). n = strlen(dir); data/tworld-1.3.2/fileio.c:460:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(dir); data/tworld-1.3.2/fileio.c:461:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). m = strlen(filename); data/tworld-1.3.2/fileio.c:492: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). xalloc(filename, strlen(dent->d_name) + 1); data/tworld-1.3.2/oshw-sdl/sdloshw.c:92: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). p = buf + strlen(buf); data/tworld-1.3.2/oshw-sdl/sdlout.c:367: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). msgdisplay.msglen = strlen(msg); data/tworld-1.3.2/oshw-sdl/sdlout.c:1043: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). len = strlen(input); data/tworld-1.3.2/oshw-sdl/sdltext.c:105:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen((char const*)text); data/tworld-1.3.2/oshw-sdl/sdltext.c:251:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = text ? strlen((char const*)text) : 0; data/tworld-1.3.2/oshw-sdl/sdltext.c:341:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen((char const*)text); data/tworld-1.3.2/oshw-sdl/sdltext.c:399:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = text ? strlen(text) : 0; data/tworld-1.3.2/series.c:224:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!game->passwd[0] || strlen(game->passwd) != 4) data/tworld-1.3.2/series.c:640: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). if (col < (int)strlen(serieslist[n].name)) data/tworld-1.3.2/series.c:641: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). col = strlen(serieslist[n].name); data/tworld-1.3.2/series.c:684:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(list[index].mapfilename) + 1; data/tworld-1.3.2/solution.c:280:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(setname) + 1; data/tworld-1.3.2/solution.c:575: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). n = strlen(datname); data/tworld-1.3.2/solution.c:810: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). n = strlen(filename) + 1; data/tworld-1.3.2/solution.c:841:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). s.prefixlen = n = strlen(series->name); data/tworld-1.3.2/solution.c:866: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). n = strlen(s.pool + offset) + 1; data/tworld-1.3.2/tworld.c:108:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(start); data/tworld-1.3.2/tworld.c:175:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). w = strlen(table->items[n] + 2); data/tworld-1.3.2/tworld.c:208: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). w = table->sep + strlen(table->items[n] + 2); data/tworld-1.3.2/tworld.c:254: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). z = (w - strlen(table->items[n] + 2)) / 2; data/tworld-1.3.2/tworld.c:551:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(subtitle) + 1; data/tworld-1.3.2/tworld.c:578:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(subtitle) + 1; data/tworld-1.3.2/tworld.c:1455: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). if (series && strlen(series) >= maxpath) { data/tworld-1.3.2/tworld.c:1460: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 (seriesdat && strlen(seriesdat) >= maxpath) { data/tworld-1.3.2/tworld.c:1465:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (res && strlen(res) >= maxpath) { data/tworld-1.3.2/tworld.c:1470: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). if (save && strlen(save) >= maxpath) { data/tworld-1.3.2/tworld.c:1476: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(dir) < maxpath) data/tworld-1.3.2/tworld.c:1484:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(dir) < maxpath - 8) data/tworld-1.3.2/tworld.c:1504:43: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((dir = getenv("HOME")) && *dir && strlen(dir) < maxpath - 8) data/tworld-1.3.2/unslist.c:68: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). len = strlen(str) + 1; ANALYSIS SUMMARY: Hits = 200 Lines analyzed = 17484 in approximately 0.50 seconds (35310 lines/second) Physical Source Lines of Code (SLOC) = 12877 Hits@level = [0] 44 [1] 50 [2] 105 [3] 9 [4] 36 [5] 0 Hits@level+ = [0+] 244 [1+] 200 [2+] 150 [3+] 45 [4+] 36 [5+] 0 Hits/KSLOC@level+ = [0+] 18.9485 [1+] 15.5316 [2+] 11.6487 [3+] 3.4946 [4+] 2.79568 [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.