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/task-2.5.1+dfsg/test/variant_and.t.cpp Examining data/task-2.5.1+dfsg/test/test.cpp Examining data/task-2.5.1+dfsg/test/tdb2.t.cpp Examining data/task-2.5.1+dfsg/test/variant_math.t.cpp Examining data/task-2.5.1+dfsg/test/json_test.cpp Examining data/task-2.5.1+dfsg/test/variant_inequal.t.cpp Examining data/task-2.5.1+dfsg/test/variant_match.t.cpp Examining data/task-2.5.1+dfsg/test/variant_not.t.cpp Examining data/task-2.5.1+dfsg/test/variant_or.t.cpp Examining data/task-2.5.1+dfsg/test/t.t.cpp Examining data/task-2.5.1+dfsg/test/util.t.cpp Examining data/task-2.5.1+dfsg/test/rx.t.cpp Examining data/task-2.5.1+dfsg/test/color.t.cpp Examining data/task-2.5.1+dfsg/test/variant_xor.t.cpp Examining data/task-2.5.1+dfsg/test/variant_gt.t.cpp Examining data/task-2.5.1+dfsg/test/i18n.t.cpp Examining data/task-2.5.1+dfsg/test/variant_exp.t.cpp Examining data/task-2.5.1+dfsg/test/msg.t.cpp Examining data/task-2.5.1+dfsg/test/variant_partial.t.cpp Examining data/task-2.5.1+dfsg/test/list.t.cpp Examining data/task-2.5.1+dfsg/test/variant_add.t.cpp Examining data/task-2.5.1+dfsg/test/json.t.cpp Examining data/task-2.5.1+dfsg/test/lexer.t.cpp Examining data/task-2.5.1+dfsg/test/variant_lt.t.cpp Examining data/task-2.5.1+dfsg/test/variant_lte.t.cpp Examining data/task-2.5.1+dfsg/test/view.t.cpp Examining data/task-2.5.1+dfsg/test/nibbler.t.cpp Examining data/task-2.5.1+dfsg/test/variant_multiply.t.cpp Examining data/task-2.5.1+dfsg/test/variant_nomatch.t.cpp Examining data/task-2.5.1+dfsg/test/config.t.cpp Examining data/task-2.5.1+dfsg/test/variant_equal.t.cpp Examining data/task-2.5.1+dfsg/test/test.h Examining data/task-2.5.1+dfsg/test/col.t.cpp Examining data/task-2.5.1+dfsg/test/utf8.t.cpp Examining data/task-2.5.1+dfsg/test/text.t.cpp Examining data/task-2.5.1+dfsg/test/iso8601p.t.cpp Examining data/task-2.5.1+dfsg/test/variant_cast.t.cpp Examining data/task-2.5.1+dfsg/test/autocomplete.t.cpp Examining data/task-2.5.1+dfsg/test/iso8601d.t.cpp Examining data/task-2.5.1+dfsg/test/variant_subtract.t.cpp Examining data/task-2.5.1+dfsg/test/variant_divide.t.cpp Examining data/task-2.5.1+dfsg/test/fs.t.cpp Examining data/task-2.5.1+dfsg/test/variant_modulo.t.cpp Examining data/task-2.5.1+dfsg/test/variant_gte.t.cpp Examining data/task-2.5.1+dfsg/test/eval.t.cpp Examining data/task-2.5.1+dfsg/test/dates.t.cpp Examining data/task-2.5.1+dfsg/src/TLSClient.h Examining data/task-2.5.1+dfsg/src/CLI2.cpp Examining data/task-2.5.1+dfsg/src/Msg.h Examining data/task-2.5.1+dfsg/src/feedback.cpp Examining data/task-2.5.1+dfsg/src/FS.h Examining data/task-2.5.1+dfsg/src/wcwidth6.cpp Examining data/task-2.5.1+dfsg/src/ViewTask.h Examining data/task-2.5.1+dfsg/src/Hooks.h Examining data/task-2.5.1+dfsg/src/Nibbler.h Examining data/task-2.5.1+dfsg/src/Variant.cpp Examining data/task-2.5.1+dfsg/src/ViewTask.cpp Examining data/task-2.5.1+dfsg/src/Config.h Examining data/task-2.5.1+dfsg/src/columns/ColUntil.h Examining data/task-2.5.1+dfsg/src/columns/ColUUID.h Examining data/task-2.5.1+dfsg/src/columns/ColTypeDuration.cpp Examining data/task-2.5.1+dfsg/src/columns/ColTypeDate.h Examining data/task-2.5.1+dfsg/src/columns/ColModified.h Examining data/task-2.5.1+dfsg/src/columns/ColMask.cpp Examining data/task-2.5.1+dfsg/src/columns/ColString.cpp Examining data/task-2.5.1+dfsg/src/columns/ColID.h Examining data/task-2.5.1+dfsg/src/columns/ColDepends.cpp Examining data/task-2.5.1+dfsg/src/columns/ColDescription.cpp Examining data/task-2.5.1+dfsg/src/columns/ColTypeNumeric.h Examining data/task-2.5.1+dfsg/src/columns/ColMask.h Examining data/task-2.5.1+dfsg/src/columns/ColIMask.cpp Examining data/task-2.5.1+dfsg/src/columns/ColUDA.cpp Examining data/task-2.5.1+dfsg/src/columns/ColDue.cpp Examining data/task-2.5.1+dfsg/src/columns/ColID.cpp Examining data/task-2.5.1+dfsg/src/columns/ColRecur.cpp Examining data/task-2.5.1+dfsg/src/columns/ColTypeDate.cpp Examining data/task-2.5.1+dfsg/src/columns/ColEnd.cpp Examining data/task-2.5.1+dfsg/src/columns/ColScheduled.cpp Examining data/task-2.5.1+dfsg/src/columns/ColUUID.cpp Examining data/task-2.5.1+dfsg/src/columns/ColUrgency.cpp Examining data/task-2.5.1+dfsg/src/columns/ColScheduled.h Examining data/task-2.5.1+dfsg/src/columns/ColIMask.h Examining data/task-2.5.1+dfsg/src/columns/ColUrgency.h Examining data/task-2.5.1+dfsg/src/columns/ColDue.h Examining data/task-2.5.1+dfsg/src/columns/ColStatus.h Examining data/task-2.5.1+dfsg/src/columns/ColWait.cpp Examining data/task-2.5.1+dfsg/src/columns/ColTypeDuration.h Examining data/task-2.5.1+dfsg/src/columns/ColParent.cpp Examining data/task-2.5.1+dfsg/src/columns/ColWait.h Examining data/task-2.5.1+dfsg/src/columns/ColDescription.h Examining data/task-2.5.1+dfsg/src/columns/ColTypeNumeric.cpp Examining data/task-2.5.1+dfsg/src/columns/ColTypeString.h Examining data/task-2.5.1+dfsg/src/columns/Column.h Examining data/task-2.5.1+dfsg/src/columns/Column.cpp Examining data/task-2.5.1+dfsg/src/columns/ColRecur.h Examining data/task-2.5.1+dfsg/src/columns/ColStart.cpp Examining data/task-2.5.1+dfsg/src/columns/ColStatus.cpp Examining data/task-2.5.1+dfsg/src/columns/ColEntry.cpp Examining data/task-2.5.1+dfsg/src/columns/ColUDA.h Examining data/task-2.5.1+dfsg/src/columns/ColDepends.h Examining data/task-2.5.1+dfsg/src/columns/ColParent.h Examining data/task-2.5.1+dfsg/src/columns/ColString.h Examining data/task-2.5.1+dfsg/src/columns/ColProject.h Examining data/task-2.5.1+dfsg/src/columns/ColEnd.h Examining data/task-2.5.1+dfsg/src/columns/ColUntil.cpp Examining data/task-2.5.1+dfsg/src/columns/ColModified.cpp Examining data/task-2.5.1+dfsg/src/columns/ColEntry.h Examining data/task-2.5.1+dfsg/src/columns/ColProject.cpp Examining data/task-2.5.1+dfsg/src/columns/ColStart.h Examining data/task-2.5.1+dfsg/src/columns/ColTypeString.cpp Examining data/task-2.5.1+dfsg/src/columns/ColTags.h Examining data/task-2.5.1+dfsg/src/columns/ColTags.cpp Examining data/task-2.5.1+dfsg/src/Hooks.cpp Examining data/task-2.5.1+dfsg/src/Dates.cpp Examining data/task-2.5.1+dfsg/src/Lexer.h Examining data/task-2.5.1+dfsg/src/util.h Examining data/task-2.5.1+dfsg/src/Timer.cpp Examining data/task-2.5.1+dfsg/src/DOM.h Examining data/task-2.5.1+dfsg/src/Eval.h Examining data/task-2.5.1+dfsg/src/Nibbler.cpp Examining data/task-2.5.1+dfsg/src/utf8.h Examining data/task-2.5.1+dfsg/src/l10n/ita-ITA.h Examining data/task-2.5.1+dfsg/src/l10n/fra-FRA.h Examining data/task-2.5.1+dfsg/src/l10n/pol-POL.h Examining data/task-2.5.1+dfsg/src/l10n/esp-ESP.h Examining data/task-2.5.1+dfsg/src/l10n/epo-RUS.h Examining data/task-2.5.1+dfsg/src/l10n/deu-DEU.h Examining data/task-2.5.1+dfsg/src/l10n/por-PRT.h Examining data/task-2.5.1+dfsg/src/l10n/eng-USA.h Examining data/task-2.5.1+dfsg/src/l10n/jpn-JPN.h Examining data/task-2.5.1+dfsg/src/FS.cpp Examining data/task-2.5.1+dfsg/src/main.h Examining data/task-2.5.1+dfsg/src/legacy.cpp Examining data/task-2.5.1+dfsg/src/Msg.cpp Examining data/task-2.5.1+dfsg/src/rules.cpp Examining data/task-2.5.1+dfsg/src/ViewText.h Examining data/task-2.5.1+dfsg/src/ViewText.cpp Examining data/task-2.5.1+dfsg/src/Task.cpp Examining data/task-2.5.1+dfsg/src/Color.h Examining data/task-2.5.1+dfsg/src/util.cpp Examining data/task-2.5.1+dfsg/src/interactive.cpp Examining data/task-2.5.1+dfsg/src/main.cpp Examining data/task-2.5.1+dfsg/src/Variant.h Examining data/task-2.5.1+dfsg/src/TDB2.cpp Examining data/task-2.5.1+dfsg/src/Timer.h Examining data/task-2.5.1+dfsg/src/ISO8601.h Examining data/task-2.5.1+dfsg/src/i18n.h Examining data/task-2.5.1+dfsg/src/DOM.cpp Examining data/task-2.5.1+dfsg/src/ISO8601.cpp Examining data/task-2.5.1+dfsg/src/Context.h Examining data/task-2.5.1+dfsg/src/CLI2.h Examining data/task-2.5.1+dfsg/src/JSON.cpp Examining data/task-2.5.1+dfsg/src/TLSClient.cpp Examining data/task-2.5.1+dfsg/src/RX.cpp Examining data/task-2.5.1+dfsg/src/dependency.cpp Examining data/task-2.5.1+dfsg/src/TDB2.h Examining data/task-2.5.1+dfsg/src/JSON.h Examining data/task-2.5.1+dfsg/src/Lexer.cpp Examining data/task-2.5.1+dfsg/src/lex.cpp Examining data/task-2.5.1+dfsg/src/Context.cpp Examining data/task-2.5.1+dfsg/src/Dates.h Examining data/task-2.5.1+dfsg/src/Filter.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdSummary.h Examining data/task-2.5.1+dfsg/src/commands/CmdTags.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdTags.h Examining data/task-2.5.1+dfsg/src/commands/CmdUDAs.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdAppend.h Examining data/task-2.5.1+dfsg/src/commands/CmdProjects.h Examining data/task-2.5.1+dfsg/src/commands/CmdExport.h Examining data/task-2.5.1+dfsg/src/commands/CmdSync.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdCount.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdColumns.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdDiagnostics.h Examining data/task-2.5.1+dfsg/src/commands/CmdExport.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdAliases.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdCalc.h Examining data/task-2.5.1+dfsg/src/commands/CmdPrepend.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdDone.h Examining data/task-2.5.1+dfsg/src/commands/CmdUndo.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdDone.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdSync.h Examining data/task-2.5.1+dfsg/src/commands/CmdColor.cpp Examining data/task-2.5.1+dfsg/src/commands/Command.h Examining data/task-2.5.1+dfsg/src/commands/CmdDenotate.h Examining data/task-2.5.1+dfsg/src/commands/Command.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdHistory.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdBurndown.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdCalc.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdDuplicate.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdAttributes.h Examining data/task-2.5.1+dfsg/src/commands/CmdAliases.h Examining data/task-2.5.1+dfsg/src/commands/CmdVersion.h Examining data/task-2.5.1+dfsg/src/commands/CmdCalendar.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdStats.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdAdd.h Examining data/task-2.5.1+dfsg/src/commands/CmdAdd.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdCommands.h Examining data/task-2.5.1+dfsg/src/commands/CmdConfig.h Examining data/task-2.5.1+dfsg/src/commands/CmdVersion.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdColumns.h Examining data/task-2.5.1+dfsg/src/commands/CmdUrgency.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdColor.h Examining data/task-2.5.1+dfsg/src/commands/CmdAnnotate.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdDelete.h Examining data/task-2.5.1+dfsg/src/commands/CmdPrepend.h Examining data/task-2.5.1+dfsg/src/commands/CmdDelete.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdInfo.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdStats.h Examining data/task-2.5.1+dfsg/src/commands/CmdImport.h Examining data/task-2.5.1+dfsg/src/commands/CmdCount.h Examining data/task-2.5.1+dfsg/src/commands/CmdDenotate.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdLogo.h Examining data/task-2.5.1+dfsg/src/commands/CmdUnique.h Examining data/task-2.5.1+dfsg/src/commands/CmdUrgency.h Examining data/task-2.5.1+dfsg/src/commands/CmdModify.h Examining data/task-2.5.1+dfsg/src/commands/CmdProjects.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdStart.h Examining data/task-2.5.1+dfsg/src/commands/CmdLogo.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdExec.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdGet.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdReports.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdStop.h Examining data/task-2.5.1+dfsg/src/commands/CmdHistory.h Examining data/task-2.5.1+dfsg/src/commands/CmdTimesheet.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdDuplicate.h Examining data/task-2.5.1+dfsg/src/commands/CmdShow.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdUDAs.h Examining data/task-2.5.1+dfsg/src/commands/CmdCalendar.h Examining data/task-2.5.1+dfsg/src/commands/CmdIDs.h Examining data/task-2.5.1+dfsg/src/commands/CmdTimesheet.h Examining data/task-2.5.1+dfsg/src/commands/CmdEdit.h Examining data/task-2.5.1+dfsg/src/commands/CmdCustom.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdStop.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdContext.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdUndo.h Examining data/task-2.5.1+dfsg/src/commands/CmdInfo.h Examining data/task-2.5.1+dfsg/src/commands/CmdModify.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdIDs.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdStart.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdUnique.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdAnnotate.h Examining data/task-2.5.1+dfsg/src/commands/CmdLog.h Examining data/task-2.5.1+dfsg/src/commands/CmdHelp.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdHelp.h Examining data/task-2.5.1+dfsg/src/commands/CmdCommands.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdImport.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdAttributes.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdCustom.h Examining data/task-2.5.1+dfsg/src/commands/CmdConfig.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdGet.h Examining data/task-2.5.1+dfsg/src/commands/CmdReports.h Examining data/task-2.5.1+dfsg/src/commands/CmdExec.h Examining data/task-2.5.1+dfsg/src/commands/CmdShow.h Examining data/task-2.5.1+dfsg/src/commands/CmdBurndown.h Examining data/task-2.5.1+dfsg/src/commands/CmdContext.h Examining data/task-2.5.1+dfsg/src/commands/CmdSummary.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdAppend.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdLog.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdEdit.cpp Examining data/task-2.5.1+dfsg/src/commands/CmdDiagnostics.cpp Examining data/task-2.5.1+dfsg/src/RX.h Examining data/task-2.5.1+dfsg/src/Filter.h Examining data/task-2.5.1+dfsg/src/Task.h Examining data/task-2.5.1+dfsg/src/Eval.cpp Examining data/task-2.5.1+dfsg/src/sort.cpp Examining data/task-2.5.1+dfsg/src/text.h Examining data/task-2.5.1+dfsg/src/calc.cpp Examining data/task-2.5.1+dfsg/src/Color.cpp Examining data/task-2.5.1+dfsg/src/utf8.cpp Examining data/task-2.5.1+dfsg/src/Config.cpp Examining data/task-2.5.1+dfsg/src/text.cpp Examining data/task-2.5.1+dfsg/src/recur.cpp FINAL RESULTS: data/task-2.5.1+dfsg/src/FS.cpp:639:5: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod (full_name.c_str (), mode); data/task-2.5.1+dfsg/src/FS.cpp:156:10: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. return access (_data.c_str (), F_OK) ? false : true; data/task-2.5.1+dfsg/src/FS.cpp:193:10: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. return access (_data.c_str (), R_OK) ? false : true; data/task-2.5.1+dfsg/src/FS.cpp:199:10: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. return access (_data.c_str (), W_OK) ? false : true; data/task-2.5.1+dfsg/src/FS.cpp:205:10: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. return access (_data.c_str (), X_OK) ? false : true; data/task-2.5.1+dfsg/src/FS.cpp:756:9: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (! access (from.c_str (), F_OK)) data/task-2.5.1+dfsg/src/commands/CmdEdit.cpp:808:18: [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. int exitcode = system (editor.c_str ()); data/task-2.5.1+dfsg/src/commands/CmdExec.cpp:57:10: [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. return system (command_line.c_str ()); data/task-2.5.1+dfsg/src/util.cpp:158:33: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. if (bytes >= 995000000) sprintf (formatted, "%.1f %s", (bytes / 1000000000.0), STRING_UTIL_GIBIBYTES); data/task-2.5.1+dfsg/src/util.cpp:159:33: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. else if (bytes >= 995000) sprintf (formatted, "%.1f %s", (bytes / 1000000.0), STRING_UTIL_MEBIBYTES); data/task-2.5.1+dfsg/src/util.cpp:160:33: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. else if (bytes >= 995) sprintf (formatted, "%.1f %s", (bytes / 1000.0), STRING_UTIL_KIBIBYTES); data/task-2.5.1+dfsg/src/util.cpp:161:33: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. else sprintf (formatted, "%d %s", (int)bytes, STRING_UTIL_BYTES); data/task-2.5.1+dfsg/src/util.cpp:301:12: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. _exit (execvp (executable.c_str (), argv)); data/task-2.5.1+dfsg/src/Context.cpp:115:22: [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. char* override = getenv ("TASKRC"); data/task-2.5.1+dfsg/src/Context.cpp:139: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. override = getenv ("TASKDATA"); data/task-2.5.1+dfsg/src/FS.cpp:239:24: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char *home = getenv("HOME"); data/task-2.5.1+dfsg/src/commands/CmdDiagnostics.cpp:222:15: [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. char* env = getenv ("TASKRC"); data/task-2.5.1+dfsg/src/commands/CmdDiagnostics.cpp:228: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. env = getenv ("TASKDATA"); data/task-2.5.1+dfsg/src/commands/CmdDiagnostics.cpp:250:23: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. else if ((peditor = getenv ("VISUAL")) != NULL) data/task-2.5.1+dfsg/src/commands/CmdDiagnostics.cpp:252:23: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. else if ((peditor = getenv ("EDITOR")) != NULL) data/task-2.5.1+dfsg/src/commands/CmdDiagnostics.cpp:399:22: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char* term = getenv ("TERM"); data/task-2.5.1+dfsg/src/commands/CmdEdit.cpp:793:19: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char* peditor = getenv ("VISUAL"); data/task-2.5.1+dfsg/src/commands/CmdEdit.cpp:795: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. peditor = getenv ("EDITOR"); data/task-2.5.1+dfsg/src/util.cpp:473:8: [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. tz = getenv ("TZ"); data/task-2.5.1+dfsg/src/FS.cpp:357:7: [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). if (open ()) data/task-2.5.1+dfsg/src/FS.cpp:385: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). bool File::open () data/task-2.5.1+dfsg/src/FS.cpp:396:13: [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). _fh = fopen (_data.c_str (), (already_exists ? "r+" : "w+")); data/task-2.5.1+dfsg/src/FS.cpp:518:5: [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). open (); data/task-2.5.1+dfsg/src/FS.cpp:532:5: [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). open (); data/task-2.5.1+dfsg/src/FS.cpp:546:5: [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). open (); data/task-2.5.1+dfsg/src/FS.cpp:556:5: [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). open (); data/task-2.5.1+dfsg/src/FS.cpp:897:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[PATH_MAX]; data/task-2.5.1+dfsg/src/FS.h:82:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). bool open (); data/task-2.5.1+dfsg/src/ISO8601.cpp:1457: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 weekStr[3]; data/task-2.5.1+dfsg/src/ISO8601.cpp:1466:20: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int weekNumber = atoi (weekStr); data/task-2.5.1+dfsg/src/RX.cpp:89: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 message[256]; data/task-2.5.1+dfsg/src/TDB2.cpp:254:17: [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). if (_file.open ()) data/task-2.5.1+dfsg/src/TDB2.cpp:276:17: [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). if (_file.open ()) data/task-2.5.1+dfsg/src/TDB2.cpp:417:13: [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). if (_file.open ()) data/task-2.5.1+dfsg/src/TDB2.cpp:571: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 buffer[256]; // Composed string is actually 246 bytes. Yikes. data/task-2.5.1+dfsg/src/TLSClient.cpp:451: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 header[4] {}; data/task-2.5.1+dfsg/src/TLSClient.cpp:473: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 buffer[MAX_BUF]; data/task-2.5.1+dfsg/src/Task.cpp:182: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 now[16]; data/task-2.5.1+dfsg/src/Task.cpp:183: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 (now, "%u", (unsigned int) time (NULL)); data/task-2.5.1+dfsg/src/Variant.cpp:1784: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 temp[24]; data/task-2.5.1+dfsg/src/Variant.cpp:1785:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (temp, "%d", _integer); data/task-2.5.1+dfsg/src/Variant.cpp:1802: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 temp[24]; data/task-2.5.1+dfsg/src/Variant.cpp:1803:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (temp, "%g", _real); data/task-2.5.1+dfsg/src/commands/CmdBurndown.cpp:469: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 label [12]; data/task-2.5.1+dfsg/src/commands/CmdBurndown.cpp:470: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 (label, "%*d", _max_label, _labels[2]); data/task-2.5.1+dfsg/src/commands/CmdBurndown.cpp:472: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 (label, "%*d", _max_label, _labels[1]); data/task-2.5.1+dfsg/src/commands/CmdBurndown.cpp:528: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 rate[12]; data/task-2.5.1+dfsg/src/commands/CmdBurndown.cpp:530: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 (rate, "%.1f/d", _net_fix_rate); data/task-2.5.1+dfsg/src/commands/CmdBurndown.cpp:721: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 str[12]; data/task-2.5.1+dfsg/src/commands/CmdBurndown.cpp:732:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (str, "%02d", cursor.day ()); data/task-2.5.1+dfsg/src/commands/CmdBurndown.cpp:738:7: [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 (str, "%d", cursor.year ()); data/task-2.5.1+dfsg/src/commands/CmdBurndown.cpp:741:7: [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 (str, "%02d", cursor.weekOfYear (0)); data/task-2.5.1+dfsg/src/commands/CmdBurndown.cpp:746:7: [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 (str, "%d", cursor.year ()); data/task-2.5.1+dfsg/src/commands/CmdBurndown.cpp:749:7: [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 (str, "%02d", cursor.month ()); data/task-2.5.1+dfsg/src/commands/CmdColor.cpp:219: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 label [12]; data/task-2.5.1+dfsg/src/commands/CmdColor.cpp:222:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (label, " %d", g); data/task-2.5.1+dfsg/src/commands/CmdLogo.cpp:110: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 block [24]; data/task-2.5.1+dfsg/src/commands/CmdLogo.cpp:111:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (block, "\033[48;5;%dm \033[0m", value); data/task-2.5.1+dfsg/src/commands/CmdLogo.cpp:124: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 block [24]; data/task-2.5.1+dfsg/src/commands/CmdLogo.cpp:125:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (block, "\033[48;5;%dm \033[0m", value); data/task-2.5.1+dfsg/src/commands/CmdSummary.cpp:200: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 percent[12] = "0%"; data/task-2.5.1+dfsg/src/commands/CmdSummary.cpp:202:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (percent, "%d%%", 100 * c / (c + p)); data/task-2.5.1+dfsg/src/recur.cpp: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. char dueDate[16]; data/task-2.5.1+dfsg/src/recur.cpp:102: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. sprintf (dueDate, "%u", (unsigned int) d.toEpoch ()); data/task-2.5.1+dfsg/src/recur.cpp:110:13: [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 (dueDate, "%u", (unsigned int) (due + (old_wait - old_due)).toEpoch ()); data/task-2.5.1+dfsg/src/recur.cpp:121: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. char indexMask[12]; data/task-2.5.1+dfsg/src/recur.cpp:122: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. sprintf (indexMask, "%u", (unsigned int) i); data/task-2.5.1+dfsg/src/utf8.cpp:115: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 sequence[5] {}; data/task-2.5.1+dfsg/src/util.cpp:156: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 formatted[24]; data/task-2.5.1+dfsg/src/util.cpp:239: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 buffer[100] {}; data/task-2.5.1+dfsg/src/util.cpp:262:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[16384]; data/task-2.5.1+dfsg/test/color.t.cpp:119: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 color [24]; data/task-2.5.1+dfsg/test/color.t.cpp:120: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 codes [64]; data/task-2.5.1+dfsg/test/color.t.cpp:121: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 description [64]; data/task-2.5.1+dfsg/test/color.t.cpp:124: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 (color, "color%d", i); data/task-2.5.1+dfsg/test/color.t.cpp:125: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 (codes, "\033[38;5;%dmfoo\033[0m", i); data/task-2.5.1+dfsg/test/color.t.cpp:126: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 (description, "color%d -> ^[[38;5;%dm", i, i); data/task-2.5.1+dfsg/test/color.t.cpp:133: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 (color, "on color%d", i); data/task-2.5.1+dfsg/test/color.t.cpp:134: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 (codes, "\033[48;5;%dmfoo\033[0m", i); data/task-2.5.1+dfsg/test/color.t.cpp:135: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 (description, "on color%d -> ^[[48;5;%dm", i, i); data/task-2.5.1+dfsg/test/color.t.cpp:146:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (color, "rgb%d%d%d", r, g, b); data/task-2.5.1+dfsg/test/color.t.cpp:147:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (codes, "\033[38;5;%dmfoo\033[0m", code); data/task-2.5.1+dfsg/test/color.t.cpp:148:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (description, "rgb%d%d%d -> ^[[38;5;%dm", r, g, b, code); data/task-2.5.1+dfsg/test/color.t.cpp:158:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (color, "on rgb%d%d%d", r, g, b); data/task-2.5.1+dfsg/test/color.t.cpp:159:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (codes, "\033[48;5;%dmfoo\033[0m", code); data/task-2.5.1+dfsg/test/color.t.cpp:160:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (description, "on rgb%d%d%d -> ^[[48;5;%dm", r, g, b, code); data/task-2.5.1+dfsg/test/color.t.cpp:171: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 (color, "gray%d", i); data/task-2.5.1+dfsg/test/color.t.cpp:172: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 (codes, "\033[38;5;%dmfoo\033[0m", i + 232); data/task-2.5.1+dfsg/test/color.t.cpp:173: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 (description, "gray%d -> ^[[38;5;%dm", i + 232, i + 232); data/task-2.5.1+dfsg/test/color.t.cpp:180: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 (color, "on gray%d", i); data/task-2.5.1+dfsg/test/color.t.cpp:181: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 (codes, "\033[48;5;%dmfoo\033[0m", i + 232); data/task-2.5.1+dfsg/test/color.t.cpp:182: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 (description, "on gray%d -> ^[[48;5;%dm", i + 232, i + 232); data/task-2.5.1+dfsg/src/Config.cpp:422:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (File::read (file, contents) && contents.length ()) data/task-2.5.1+dfsg/src/Config.cpp:451:11: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. if (equal != std::string::npos) data/task-2.5.1+dfsg/src/Config.cpp:453:58: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. std::string key = Lexer::trim (line.substr (0, equal), " \t"); // no i18n data/task-2.5.1+dfsg/src/Config.cpp:454:81: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. std::string value = Lexer::trim (line.substr (equal+1, line.length () - equal), " \t"); // no i18n data/task-2.5.1+dfsg/src/FS.cpp:458:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void File::read (std::string& contents) data/task-2.5.1+dfsg/src/FS.cpp:487:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void File::read (std::vector <std::string>& contents) data/task-2.5.1+dfsg/src/FS.cpp:647:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool File::read (const std::string& name, std::string& contents) data/task-2.5.1+dfsg/src/FS.cpp:677:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool File::read (const std::string& name, std::vector <std::string>& contents) data/task-2.5.1+dfsg/src/FS.h:88:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read (std::string&); data/task-2.5.1+dfsg/src/FS.h:89:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read (std::vector <std::string>&); data/task-2.5.1+dfsg/src/FS.h:104:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). static bool read (const std::string&, std::string&); data/task-2.5.1+dfsg/src/FS.h:105:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). static bool read (const std::string&, std::vector <std::string>&); data/task-2.5.1+dfsg/src/TDB2.cpp:422:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). _file.read (_lines); data/task-2.5.1+dfsg/src/commands/CmdBurndown.cpp:471:61: [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). _grid.replace (LOC (1, _max_label - strlen (label)), strlen (label), label); data/task-2.5.1+dfsg/src/commands/CmdBurndown.cpp:471:78: [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). _grid.replace (LOC (1, _max_label - strlen (label)), strlen (label), label); data/task-2.5.1+dfsg/src/commands/CmdBurndown.cpp:473:61: [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). _grid.replace (LOC (1 + (_graph_height / 2), _max_label - strlen (label)), strlen (label), label); data/task-2.5.1+dfsg/src/commands/CmdBurndown.cpp:473:78: [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). _grid.replace (LOC (1 + (_graph_height / 2), _max_label - strlen (label)), strlen (label), label); data/task-2.5.1+dfsg/src/commands/CmdBurndown.cpp:532:5: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. strcpy (rate, "-"); data/task-2.5.1+dfsg/src/commands/CmdBurndown.cpp:534:58: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). _grid.replace (LOC (_height - 2, _max_label + 3), 22 + strlen (rate), std::string ("Net Fix Rate: ") + rate); data/task-2.5.1+dfsg/src/commands/CmdConfig.cpp:60:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). File::read (context.config._original_file, contents); data/task-2.5.1+dfsg/src/commands/CmdConfig.cpp:109:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). File::read (context.config._original_file, contents); data/task-2.5.1+dfsg/src/commands/CmdEdit.cpp:821:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). File::read (file.str (), after); data/task-2.5.1+dfsg/src/commands/CmdImport.cpp:90:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). incoming.read (json); data/task-2.5.1+dfsg/src/util.cpp:368:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read_retval = read (pout[0], &buf, sizeof (buf) - 1); data/task-2.5.1+dfsg/test/fs.t.cpp:270:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask (0022); data/task-2.5.1+dfsg/test/json_test.cpp:67:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). file.read (contents); data/task-2.5.1+dfsg/test/lexer.t.cpp:228:55: [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). std::string input = std::string ("name") + (strlen (mod) ? "." : "") + mod + sep + value; ANALYSIS SUMMARY: Hits = 124 Lines analyzed = 64552 in approximately 1.81 seconds (35595 lines/second) Physical Source Lines of Code (SLOC) = 43563 Hits@level = [0] 4 [1] 27 [2] 73 [3] 11 [4] 12 [5] 1 Hits@level+ = [0+] 128 [1+] 124 [2+] 97 [3+] 24 [4+] 13 [5+] 1 Hits/KSLOC@level+ = [0+] 2.93827 [1+] 2.84645 [2+] 2.22666 [3+] 0.550926 [4+] 0.298418 [5+] 0.0229553 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.