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/taskd-1.1.0+dfsg/test/util.t.cpp Examining data/taskd-1.1.0+dfsg/test/nibbler.t.cpp Examining data/taskd-1.1.0+dfsg/test/file.t.cpp Examining data/taskd-1.1.0+dfsg/test/json.t.cpp Examining data/taskd-1.1.0+dfsg/test/json_test.cpp Examining data/taskd-1.1.0+dfsg/test/text.t.cpp Examining data/taskd-1.1.0+dfsg/test/config.t.cpp Examining data/taskd-1.1.0+dfsg/test/test.h Examining data/taskd-1.1.0+dfsg/test/duration.t.cpp Examining data/taskd-1.1.0+dfsg/test/test.cpp Examining data/taskd-1.1.0+dfsg/test/color.t.cpp Examining data/taskd-1.1.0+dfsg/test/date.t.cpp Examining data/taskd-1.1.0+dfsg/test/msg.t.cpp Examining data/taskd-1.1.0+dfsg/test/rx.t.cpp Examining data/taskd-1.1.0+dfsg/test/directory.t.cpp Examining data/taskd-1.1.0+dfsg/test/path.t.cpp Examining data/taskd-1.1.0+dfsg/test/utf8.t.cpp Examining data/taskd-1.1.0+dfsg/src/TLSClient.cpp Examining data/taskd-1.1.0+dfsg/src/taskd.h Examining data/taskd-1.1.0+dfsg/src/Nibbler.h Examining data/taskd-1.1.0+dfsg/src/wcwidth6.cpp Examining data/taskd-1.1.0+dfsg/src/utf8.cpp Examining data/taskd-1.1.0+dfsg/src/Directory.cpp Examining data/taskd-1.1.0+dfsg/src/Directory.h Examining data/taskd-1.1.0+dfsg/src/api.cpp Examining data/taskd-1.1.0+dfsg/src/daemon.cpp Examining data/taskd-1.1.0+dfsg/src/text.cpp Examining data/taskd-1.1.0+dfsg/src/utf8.h Examining data/taskd-1.1.0+dfsg/src/status.cpp Examining data/taskd-1.1.0+dfsg/src/RX.h Examining data/taskd-1.1.0+dfsg/src/TLSClient.h Examining data/taskd-1.1.0+dfsg/src/client.cpp Examining data/taskd-1.1.0+dfsg/src/File.cpp Examining data/taskd-1.1.0+dfsg/src/TLSServer.cpp Examining data/taskd-1.1.0+dfsg/src/admin.cpp Examining data/taskd-1.1.0+dfsg/src/Database.cpp Examining data/taskd-1.1.0+dfsg/src/util.h Examining data/taskd-1.1.0+dfsg/src/Log.cpp Examining data/taskd-1.1.0+dfsg/src/Task.cpp Examining data/taskd-1.1.0+dfsg/src/Nibbler.cpp Examining data/taskd-1.1.0+dfsg/src/taskd.cpp Examining data/taskd-1.1.0+dfsg/src/Path.h Examining data/taskd-1.1.0+dfsg/src/Timer.cpp Examining data/taskd-1.1.0+dfsg/src/l10n/eng-USA.h Examining data/taskd-1.1.0+dfsg/src/Date.h Examining data/taskd-1.1.0+dfsg/src/ConfigFile.cpp Examining data/taskd-1.1.0+dfsg/src/RX.cpp Examining data/taskd-1.1.0+dfsg/src/text.h Examining data/taskd-1.1.0+dfsg/src/util.cpp Examining data/taskd-1.1.0+dfsg/src/Color.cpp Examining data/taskd-1.1.0+dfsg/src/Msg.cpp Examining data/taskd-1.1.0+dfsg/src/Duration.cpp Examining data/taskd-1.1.0+dfsg/src/Server.h Examining data/taskd-1.1.0+dfsg/src/Date.cpp Examining data/taskd-1.1.0+dfsg/src/File.h Examining data/taskd-1.1.0+dfsg/src/Msg.h Examining data/taskd-1.1.0+dfsg/src/Server.cpp Examining data/taskd-1.1.0+dfsg/src/Task.h Examining data/taskd-1.1.0+dfsg/src/Color.h Examining data/taskd-1.1.0+dfsg/src/Path.cpp Examining data/taskd-1.1.0+dfsg/src/config.cpp Examining data/taskd-1.1.0+dfsg/src/JSON.cpp Examining data/taskd-1.1.0+dfsg/src/Timer.h Examining data/taskd-1.1.0+dfsg/src/TLSServer.h Examining data/taskd-1.1.0+dfsg/src/Database.h Examining data/taskd-1.1.0+dfsg/src/ConfigFile.h Examining data/taskd-1.1.0+dfsg/src/i18n.h Examining data/taskd-1.1.0+dfsg/src/Log.h Examining data/taskd-1.1.0+dfsg/src/JSON.h Examining data/taskd-1.1.0+dfsg/src/Duration.h Examining data/taskd-1.1.0+dfsg/src/help.cpp Examining data/taskd-1.1.0+dfsg/src/diag.cpp Examining data/taskd-1.1.0+dfsg/src/init.cpp FINAL RESULTS: data/taskd-1.1.0+dfsg/src/File.cpp:368: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/taskd-1.1.0+dfsg/src/Duration.cpp:241:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (formatted, "%s%.1f yrs", (_negative ? "-" : ""), (days / 365)); data/taskd-1.1.0+dfsg/src/Duration.cpp:243:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (formatted, "%s%1d mth%s", data/taskd-1.1.0+dfsg/src/Duration.cpp:247:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (formatted, "%s%d wk%s", data/taskd-1.1.0+dfsg/src/Duration.cpp:251:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (formatted, "%s%d day%s", data/taskd-1.1.0+dfsg/src/Duration.cpp:255:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (formatted, "%s%d hr%s", data/taskd-1.1.0+dfsg/src/Duration.cpp:259:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (formatted, "%s%d min%s", data/taskd-1.1.0+dfsg/src/Duration.cpp:263:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (formatted, "%s%d sec%s", data/taskd-1.1.0+dfsg/src/Duration.cpp:278:34: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. if (_secs >= 86400 * 365) sprintf (formatted, "%s%.1fy", (_negative ? "-" : ""), (days / 365.0)); data/taskd-1.1.0+dfsg/src/Duration.cpp:279:34: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. else if (_secs >= 86400 * 84) sprintf (formatted, "%s%1dmo", (_negative ? "-" : ""), (int) (days / 30)); data/taskd-1.1.0+dfsg/src/Duration.cpp:280:34: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. else if (_secs >= 86400 * 13) sprintf (formatted, "%s%dwk", (_negative ? "-" : ""), (int) (float) (days / 7.0)); data/taskd-1.1.0+dfsg/src/Duration.cpp:281:34: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. else if (_secs >= 86400) sprintf (formatted, "%s%dd", (_negative ? "-" : ""), (int) days); data/taskd-1.1.0+dfsg/src/Duration.cpp:282:34: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. else if (_secs >= 3600) sprintf (formatted, "%s%dh", (_negative ? "-" : ""), (int) (_secs / 3600)); data/taskd-1.1.0+dfsg/src/Duration.cpp:283:34: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. else if (_secs >= 60) sprintf (formatted, "%s%dm", (_negative ? "-" : ""), (int) (_secs / 60)); data/taskd-1.1.0+dfsg/src/Duration.cpp:284:34: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. else if (_secs >= 1) sprintf (formatted, "%s%ds", (_negative ? "-" : ""), (int) _secs); data/taskd-1.1.0+dfsg/src/Duration.cpp:300:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. if (days > 0) sprintf (formatted, "%s%dd %d:%02d:%02d", (_negative ? "-" : ""), days, hours, minutes, seconds); data/taskd-1.1.0+dfsg/src/Duration.cpp:301:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. else sprintf (formatted, "%s%d:%02d:%02d", (_negative ? "-" : ""), hours, minutes, seconds); data/taskd-1.1.0+dfsg/src/Duration.cpp:311:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (formatted, "%s%llusec", (_negative ? "-" : ""), (unsigned long long)_secs); data/taskd-1.1.0+dfsg/src/Log.cpp:144:3: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf (buffer, 65536, message, args); data/taskd-1.1.0+dfsg/src/Path.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/taskd-1.1.0+dfsg/src/Path.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/taskd-1.1.0+dfsg/src/Path.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/taskd-1.1.0+dfsg/src/Path.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/taskd-1.1.0+dfsg/src/Path.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/taskd-1.1.0+dfsg/src/diag.cpp:185:20: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char* root_env = getenv ("TASKDDATA"); data/taskd-1.1.0+dfsg/src/taskd.cpp:123:26: [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* root_env = getenv ("TASKDDATA"); data/taskd-1.1.0+dfsg/src/util.cpp:258: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/taskd-1.1.0+dfsg/src/Color.cpp:153:15: [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). index = atoi (word.substr (4).c_str ()); data/taskd-1.1.0+dfsg/src/Color.cpp:174:15: [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). index = atoi (word.substr (3).c_str ()); data/taskd-1.1.0+dfsg/src/Color.cpp:179:15: [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 r = atoi (word.substr (3, 1).c_str ()); data/taskd-1.1.0+dfsg/src/Color.cpp:180:15: [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 g = atoi (word.substr (4, 1).c_str ()); data/taskd-1.1.0+dfsg/src/Color.cpp:181:15: [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 b = atoi (word.substr (5, 1).c_str ()); data/taskd-1.1.0+dfsg/src/Color.cpp:206:15: [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). index = atoi (word.substr (5).c_str ()); data/taskd-1.1.0+dfsg/src/Date.cpp:223: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[12]; data/taskd-1.1.0+dfsg/src/Date.cpp:230: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. case 'm': sprintf (buffer, "%d", this->month ()); break; data/taskd-1.1.0+dfsg/src/Date.cpp:231: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. case 'M': sprintf (buffer, "%02d", this->month ()); break; data/taskd-1.1.0+dfsg/src/Date.cpp:232: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. case 'd': sprintf (buffer, "%d", this->day ()); break; data/taskd-1.1.0+dfsg/src/Date.cpp:233: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. case 'D': sprintf (buffer, "%02d", this->day ()); break; data/taskd-1.1.0+dfsg/src/Date.cpp:234: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. case 'y': sprintf (buffer, "%02d", this->year () % 100); break; data/taskd-1.1.0+dfsg/src/Date.cpp:235: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. case 'Y': sprintf (buffer, "%d", this->year ()); break; data/taskd-1.1.0+dfsg/src/Date.cpp:236: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. case 'a': sprintf (buffer, "%.3s", Date::dayName (dayOfWeek ()).c_str ()); break; data/taskd-1.1.0+dfsg/src/Date.cpp:237: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. case 'A': sprintf (buffer, "%.10s", Date::dayName (dayOfWeek ()).c_str ()); break; data/taskd-1.1.0+dfsg/src/Date.cpp:238: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. case 'b': sprintf (buffer, "%.3s", Date::monthName (month ()).c_str ()); break; data/taskd-1.1.0+dfsg/src/Date.cpp:239: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. case 'B': sprintf (buffer, "%.10s", Date::monthName (month ()).c_str ()); break; data/taskd-1.1.0+dfsg/src/Date.cpp:240: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. case 'v': sprintf (buffer, "%d", Date::weekOfYear (Date::dayOfWeek (weekStart))); break; data/taskd-1.1.0+dfsg/src/Date.cpp:241: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. case 'V': sprintf (buffer, "%02d", Date::weekOfYear (Date::dayOfWeek (weekStart))); break; data/taskd-1.1.0+dfsg/src/Date.cpp:242: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. case 'h': sprintf (buffer, "%d", this->hour ()); break; data/taskd-1.1.0+dfsg/src/Date.cpp:243: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. case 'H': sprintf (buffer, "%02d", this->hour ()); break; data/taskd-1.1.0+dfsg/src/Date.cpp:244: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. case 'n': sprintf (buffer, "%d", this->minute ()); break; data/taskd-1.1.0+dfsg/src/Date.cpp:245: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. case 'N': sprintf (buffer, "%02d", this->minute ()); break; data/taskd-1.1.0+dfsg/src/Date.cpp:246: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. case 's': sprintf (buffer, "%d", this->second ()); break; data/taskd-1.1.0+dfsg/src/Date.cpp:247: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. case 'S': sprintf (buffer, "%02d", this->second ()); break; data/taskd-1.1.0+dfsg/src/Date.cpp:248: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. case 'j': sprintf (buffer, "%d", this->dayOfYear ()); break; data/taskd-1.1.0+dfsg/src/Date.cpp:249: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. case 'J': sprintf (buffer, "%03d", this->dayOfYear ()); break; data/taskd-1.1.0+dfsg/src/Date.cpp:250: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. default: sprintf (buffer, "%c", c); break; data/taskd-1.1.0+dfsg/src/Date.cpp:445: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/taskd-1.1.0+dfsg/src/Date.cpp:454: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/taskd-1.1.0+dfsg/src/Date.cpp:808:19: [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). _t = (time_t) atoi (input.c_str ()); data/taskd-1.1.0+dfsg/src/Date.cpp:1043:16: [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). number = atoi (in.substr (0, 2).c_str ()); data/taskd-1.1.0+dfsg/src/Date.cpp:1048:16: [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). number = atoi (in.substr (0, 2).c_str ()); data/taskd-1.1.0+dfsg/src/Directory.cpp:166: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/taskd-1.1.0+dfsg/src/Duration.cpp:237:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char formatted[24]; data/taskd-1.1.0+dfsg/src/Duration.cpp:275: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/taskd-1.1.0+dfsg/src/Duration.cpp:293: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/taskd-1.1.0+dfsg/src/Duration.cpp:310: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/taskd-1.1.0+dfsg/src/File.cpp:94: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/taskd-1.1.0+dfsg/src/File.cpp:111: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/taskd-1.1.0+dfsg/src/File.cpp:122: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/taskd-1.1.0+dfsg/src/File.cpp:140:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). return open () && lock (); data/taskd-1.1.0+dfsg/src/File.cpp:230: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/taskd-1.1.0+dfsg/src/File.cpp:241: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/taskd-1.1.0+dfsg/src/File.cpp:256: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/taskd-1.1.0+dfsg/src/File.cpp:270: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/taskd-1.1.0+dfsg/src/File.cpp:285: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/taskd-1.1.0+dfsg/src/File.h:50: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/taskd-1.1.0+dfsg/src/Log.cpp:111:15: [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 (_filename.c_str (), "a"); data/taskd-1.1.0+dfsg/src/Log.cpp:141: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[65536]; data/taskd-1.1.0+dfsg/src/Log.cpp:160: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, "%04d-%02d-%02d %02d:%02d:%02d", data/taskd-1.1.0+dfsg/src/Log.h:49:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char _now[20]; data/taskd-1.1.0+dfsg/src/Nibbler.cpp:801: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). result = atoi (_input.substr (i, f).c_str ()); data/taskd-1.1.0+dfsg/src/RX.cpp:98: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/taskd-1.1.0+dfsg/src/Server.cpp:371:18: [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* output = fopen (_pid_file.c_str (), "w"); data/taskd-1.1.0+dfsg/src/TLSClient.cpp:450: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] = {0}; data/taskd-1.1.0+dfsg/src/TLSClient.cpp:472: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/taskd-1.1.0+dfsg/src/TLSServer.cpp:236:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ipstr[INET6_ADDRSTRLEN]; data/taskd-1.1.0+dfsg/src/TLSServer.cpp:353: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 topbuf[512]; data/taskd-1.1.0+dfsg/src/TLSServer.cpp:572: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] = {0}; data/taskd-1.1.0+dfsg/src/TLSServer.cpp:594: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/taskd-1.1.0+dfsg/src/Task.cpp:177:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char entryTime[16]; data/taskd-1.1.0+dfsg/src/Task.cpp:178: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 (entryTime, "%u", (unsigned int) time (NULL)); data/taskd-1.1.0+dfsg/src/Task.cpp:187: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 endTime[16]; data/taskd-1.1.0+dfsg/src/Task.cpp:188: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 (endTime, "%u", (unsigned int) time (NULL)); data/taskd-1.1.0+dfsg/src/Task.cpp:197: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 startTime[16]; data/taskd-1.1.0+dfsg/src/Task.cpp:198: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 (startTime, "%u", (unsigned int) time (NULL)); data/taskd-1.1.0+dfsg/src/Task.cpp:207: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/taskd-1.1.0+dfsg/src/Task.cpp:208: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/taskd-1.1.0+dfsg/src/diag.cpp:90:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hostname[128] = {0}; data/taskd-1.1.0+dfsg/src/text.cpp:320: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 stringized[2] = {0}; data/taskd-1.1.0+dfsg/src/utf8.cpp:116: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] = {0}; data/taskd-1.1.0+dfsg/src/util.cpp:68: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/taskd-1.1.0+dfsg/src/util.cpp:70:33: [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. if (bytes >= 995000000) sprintf (formatted, "%.1f GiB", bytes / 1000000000.0); data/taskd-1.1.0+dfsg/src/util.cpp:71:33: [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. else if (bytes >= 995000) sprintf (formatted, "%.1f MiB", bytes / 1000000.0); data/taskd-1.1.0+dfsg/src/util.cpp:72:33: [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. else if (bytes >= 995) sprintf (formatted, "%.1f KiB", bytes / 1000.0); data/taskd-1.1.0+dfsg/src/util.cpp:73:33: [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. else sprintf (formatted, "%d B", (int)bytes); data/taskd-1.1.0+dfsg/src/util.cpp:82: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/taskd-1.1.0+dfsg/src/util.cpp:85:36: [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. if (seconds >= 86400 * 365) sprintf (formatted, "%.1f y", (days / 365.0)); data/taskd-1.1.0+dfsg/src/util.cpp:86:36: [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. else if (seconds >= 86400 * 84) sprintf (formatted, "%1d mo", (int) (days / 30)); data/taskd-1.1.0+dfsg/src/util.cpp:87:36: [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. else if (seconds >= 86400 * 13) sprintf (formatted, "%d wk", (int) (float) (days / 7.0)); data/taskd-1.1.0+dfsg/src/util.cpp:88:36: [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. else if (seconds >= 86400) sprintf (formatted, "%d d", (int) days); data/taskd-1.1.0+dfsg/src/util.cpp:89:36: [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. else if (seconds >= 3600) sprintf (formatted, "%d h", (int) (seconds / 3600)); data/taskd-1.1.0+dfsg/src/util.cpp:90:36: [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. else if (seconds >= 60) sprintf (formatted, "%d m", (int) (seconds / 60)); data/taskd-1.1.0+dfsg/src/util.cpp:91:36: [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. else if (seconds >= 1) sprintf (formatted, "%d s", (int) seconds); data/taskd-1.1.0+dfsg/src/util.cpp:171: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] = {0}; data/taskd-1.1.0+dfsg/src/util.cpp:236: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 tmp[2] = {c, '\0'}; data/taskd-1.1.0+dfsg/test/color.t.cpp:116: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/taskd-1.1.0+dfsg/test/color.t.cpp:117: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/taskd-1.1.0+dfsg/test/color.t.cpp:118: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/taskd-1.1.0+dfsg/test/color.t.cpp:121: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/taskd-1.1.0+dfsg/test/color.t.cpp:122: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/taskd-1.1.0+dfsg/test/color.t.cpp:123: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/taskd-1.1.0+dfsg/test/color.t.cpp:130: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/taskd-1.1.0+dfsg/test/color.t.cpp:131: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/taskd-1.1.0+dfsg/test/color.t.cpp:132: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/taskd-1.1.0+dfsg/test/color.t.cpp:143: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/taskd-1.1.0+dfsg/test/color.t.cpp:144: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/taskd-1.1.0+dfsg/test/color.t.cpp:145: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/taskd-1.1.0+dfsg/test/color.t.cpp:155: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/taskd-1.1.0+dfsg/test/color.t.cpp:156: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/taskd-1.1.0+dfsg/test/color.t.cpp:157: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/taskd-1.1.0+dfsg/test/color.t.cpp:168: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/taskd-1.1.0+dfsg/test/color.t.cpp:169: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/taskd-1.1.0+dfsg/test/color.t.cpp:170: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/taskd-1.1.0+dfsg/test/color.t.cpp:177: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/taskd-1.1.0+dfsg/test/color.t.cpp:178: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/taskd-1.1.0+dfsg/test/color.t.cpp:179: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/taskd-1.1.0+dfsg/src/ConfigFile.cpp:90: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/taskd-1.1.0+dfsg/src/ConfigFile.cpp:135: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/taskd-1.1.0+dfsg/src/ConfigFile.cpp:137:51: [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 = trim (line.substr (0, equal), " \t"); // no i18n data/taskd-1.1.0+dfsg/src/ConfigFile.cpp:138:74: [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 = trim (line.substr (equal+1, line.length () - equal), " \t"); // no i18n data/taskd-1.1.0+dfsg/src/Database.cpp:156:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). redirect.read (server); data/taskd-1.1.0+dfsg/src/Duration.cpp:267: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 (formatted, "-"); // no i18n data/taskd-1.1.0+dfsg/src/File.cpp:190: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/taskd-1.1.0+dfsg/src/File.cpp:209: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/taskd-1.1.0+dfsg/src/File.cpp:376:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). std::string File::read (const std::string& name) data/taskd-1.1.0+dfsg/src/File.cpp:395: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/taskd-1.1.0+dfsg/src/File.cpp:415: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/taskd-1.1.0+dfsg/src/File.h:57:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read (std::string&); data/taskd-1.1.0+dfsg/src/File.h:58: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/taskd-1.1.0+dfsg/src/File.h:75:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). static std::string read (const std::string&); data/taskd-1.1.0+dfsg/src/File.h:76: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/taskd-1.1.0+dfsg/src/File.h:77: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/taskd-1.1.0+dfsg/src/Log.cpp:138: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). if (::strlen (message) >= 65536) data/taskd-1.1.0+dfsg/src/Server.cpp:340:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask (0); data/taskd-1.1.0+dfsg/src/api.cpp:91:9: [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/taskd-1.1.0+dfsg/src/api.cpp:92:9: [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. equal > 2) data/taskd-1.1.0+dfsg/src/client.cpp:55:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). file.read (contents); data/taskd-1.1.0+dfsg/src/config.cpp:85:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). File::read (config._original_file, contents); data/taskd-1.1.0+dfsg/src/config.cpp:147:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). File::read (config._original_file, contents); data/taskd-1.1.0+dfsg/src/daemon.cpp:505:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). user_data.read (data); data/taskd-1.1.0+dfsg/src/diag.cpp:283:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). file.read (contents); data/taskd-1.1.0+dfsg/src/text.cpp:475:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const int len_left = strlen (left); data/taskd-1.1.0+dfsg/src/text.cpp:476:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const int len_right = strlen (right); data/taskd-1.1.0+dfsg/src/util.cpp:92:36: [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. else strcpy (formatted, "-"); data/taskd-1.1.0+dfsg/test/directory.t.cpp:124:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask (0022); data/taskd-1.1.0+dfsg/test/json_test.cpp:63:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). file.read (contents); ANALYSIS SUMMARY: Hits = 165 Lines analyzed = 20515 in approximately 0.55 seconds (37037 lines/second) Physical Source Lines of Code (SLOC) = 14019 Hits@level = [0] 11 [1] 30 [2] 108 [3] 4 [4] 22 [5] 1 Hits@level+ = [0+] 176 [1+] 165 [2+] 135 [3+] 27 [4+] 23 [5+] 1 Hits/KSLOC@level+ = [0+] 12.5544 [1+] 11.7697 [2+] 9.62979 [3+] 1.92596 [4+] 1.64063 [5+] 0.0713318 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.