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/apt-dater-1.0.4/include/adproto.h Examining data/apt-dater-1.0.4/src/adsh.c Examining data/apt-dater-1.0.4/src/apt-dater.c Examining data/apt-dater-1.0.4/src/apt-dater.h Examining data/apt-dater-1.0.4/src/autoref.c Examining data/apt-dater-1.0.4/src/autoref.h Examining data/apt-dater-1.0.4/src/clusters.c Examining data/apt-dater-1.0.4/src/clusters.h Examining data/apt-dater-1.0.4/src/colors.c Examining data/apt-dater-1.0.4/src/colors.h Examining data/apt-dater-1.0.4/src/env.c Examining data/apt-dater-1.0.4/src/env.h Examining data/apt-dater-1.0.4/src/exec.c Examining data/apt-dater-1.0.4/src/exec.h Examining data/apt-dater-1.0.4/src/extern.h Examining data/apt-dater-1.0.4/src/glue.c Examining data/apt-dater-1.0.4/src/glue.h Examining data/apt-dater-1.0.4/src/history.c Examining data/apt-dater-1.0.4/src/history.h Examining data/apt-dater-1.0.4/src/keyfiles.c Examining data/apt-dater-1.0.4/src/keyfiles.h Examining data/apt-dater-1.0.4/src/lock.c Examining data/apt-dater-1.0.4/src/lock.h Examining data/apt-dater-1.0.4/src/main.c Examining data/apt-dater-1.0.4/src/parsecmd.c Examining data/apt-dater-1.0.4/src/parsecmd.h Examining data/apt-dater-1.0.4/src/report.c Examining data/apt-dater-1.0.4/src/report.h Examining data/apt-dater-1.0.4/src/runcust.c Examining data/apt-dater-1.0.4/src/runcust.h Examining data/apt-dater-1.0.4/src/screen.c Examining data/apt-dater-1.0.4/src/screen.h Examining data/apt-dater-1.0.4/src/sighandler.c Examining data/apt-dater-1.0.4/src/sighandler.h Examining data/apt-dater-1.0.4/src/stats.c Examining data/apt-dater-1.0.4/src/stats.h Examining data/apt-dater-1.0.4/src/tag.c Examining data/apt-dater-1.0.4/src/tag.h Examining data/apt-dater-1.0.4/src/tmux.c Examining data/apt-dater-1.0.4/src/tmux.h Examining data/apt-dater-1.0.4/src/ttymux.h Examining data/apt-dater-1.0.4/src/ui.c Examining data/apt-dater-1.0.4/src/ui.h FINAL RESULTS: data/apt-dater-1.0.4/src/main.c:158:5: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(agent_argv[0], agent_argv); data/apt-dater-1.0.4/src/stats.c:274:7: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf((gchar *) line, ADP_PATTERN_KERNELINFO, &status, buf) && !n->kernelrel) { data/apt-dater-1.0.4/src/stats.c:291:6: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if(sscanf(line, ADP_PATTERN_ADPROTO, &adpver)) { data/apt-dater-1.0.4/src/stats.c:384:7: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf((gchar *) line, ADP_PATTERN_VIRT, buf)) { data/apt-dater-1.0.4/src/stats.c:394:7: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf((gchar *) line, ADP_PATTERN_ADPERR, buf)) { data/apt-dater-1.0.4/src/stats.c:400:7: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf((gchar *) line, ADP_PATTERN_UNAME, buf)) { data/apt-dater-1.0.4/src/stats.c:413:7: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf((gchar *) line, ADP_PATTERN_FORBID, &n->forbid)) data/apt-dater-1.0.4/src/stats.c:425:7: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf((gchar *) line, ADP_PATTERN_CLUSTER, cluster)) { data/apt-dater-1.0.4/src/stats.c:436:7: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf((gchar *) line, ADP_PATTERN_NRKSTATUS, &nrksta)) { data/apt-dater-1.0.4/src/ui.c:1125:2: [4] (format) snprintf: 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. snprintf(statusln, BUF_MAX_LEN, data/apt-dater-1.0.4/src/ui.c:1459:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(statusln, _("Error: %s"), ((HostNode *) n->p)->adperr); data/apt-dater-1.0.4/src/adsh.c:105:17: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((opts = getopt(argc, argv, "1246ab:c:e:fgi:kl:m:no:p:qstvxACD:E:F:I:KL:MNO:PQ:R:S:TVw:W:XYy")) != EOF) { data/apt-dater-1.0.4/src/main.c:97:17: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((opts = getopt(argc, argv, "c:vrn")) != EOF) { data/apt-dater-1.0.4/src/main.c:149:6: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if(getenv("SSH_AGENT_PID") == NULL) { data/apt-dater-1.0.4/src/screen.c:48:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (g_strcmp0(getenv("SCREENDIR"), NULL) != 0) { data/apt-dater-1.0.4/src/screen.c:49:35: [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. g_strlcpy(sdir, sizeof(sdir), getenv("SCREENDIR")); data/apt-dater-1.0.4/src/screen.c:196:53: [3] (buffer) g_get_tmp_dir: This function is synonymous with 'getenv("TMP")';it returns untrustable input if the environment can beset by an attacker. It 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. gchar *dump_fn = g_strdup_printf("%s/dump-XXXXXX", g_get_tmp_dir()); data/apt-dater-1.0.4/src/ui.c:1871: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. const gchar *m = getenv("MAINTAINER"); data/apt-dater-1.0.4/src/adsh.c:108:29: [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). adsh_target.ssh_port = atoi(optarg); data/apt-dater-1.0.4/src/keyfiles.c:56:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *fp = fopen(pathtofile, "wx"); data/apt-dater-1.0.4/src/keyfiles.c:218:6: [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). if(atoi(val)) { data/apt-dater-1.0.4/src/lock.c:58:19: [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((n->fdlock = open(lockfile, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP))< 0) { data/apt-dater-1.0.4/src/screen.c:90:18: [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). gint pid = atoi(f); data/apt-dater-1.0.4/src/stats.c:86:14: [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). n->fpstat = fopen(n->statstmpf, "wx"); data/apt-dater-1.0.4/src/stats.c:198:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[STATS_MAX_LINE_LEN]; data/apt-dater-1.0.4/src/stats.c:199:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256] = "\0"; data/apt-dater-1.0.4/src/stats.c:424: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 cluster[ADP_STRLEN_CLUSTER]; data/apt-dater-1.0.4/src/ui.c:294:6: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy(&modstr[cpos], &modstr[cpos+1], slen-cpos); data/apt-dater-1.0.4/src/ui.c:380:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(str, modstr, n+1); data/apt-dater-1.0.4/src/ui.c:651:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[0x1ff]; data/apt-dater-1.0.4/src/ui.c:686:4: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(buf, _("refresh")); data/apt-dater-1.0.4/src/ui.c:691:5: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(buf, ", "); data/apt-dater-1.0.4/src/ui.c:693:4: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(buf, _("upgrade")); data/apt-dater-1.0.4/src/ui.c:698:5: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(buf, ", "); data/apt-dater-1.0.4/src/ui.c:700:4: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(buf, _("install")); data/apt-dater-1.0.4/src/ui.c:727:4: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, _("(pending ABI compatible upgrade)")); data/apt-dater-1.0.4/src/ui.c:730:4: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, _("(pending upgrade)")); data/apt-dater-1.0.4/src/ui.c:950:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char strinfo[42]; data/apt-dater-1.0.4/src/ui.c:1057:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&tn, &to, sizeof(to)); data/apt-dater-1.0.4/src/ui.c:1073:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[0x1ff]; data/apt-dater-1.0.4/src/ui.c:1097:3: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "n/a"); data/apt-dater-1.0.4/src/ui.c:1112:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char statusln[BUF_MAX_LEN]; data/apt-dater-1.0.4/src/ui.c:1246:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char statusln[BUF_MAX_LEN]; data/apt-dater-1.0.4/src/ui.c:1281:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char statusln[BUF_MAX_LEN]; data/apt-dater-1.0.4/src/ui.c:1312:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char statusln[BUF_MAX_LEN]; data/apt-dater-1.0.4/src/ui.c:1417:4: [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(statusln, _("No update required")); data/apt-dater-1.0.4/src/ui.c:1436:4: [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(statusln, _("Refresh required")); data/apt-dater-1.0.4/src/ui.c:1439:4: [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(statusln, _("In refresh")); data/apt-dater-1.0.4/src/ui.c:1444: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(statusln, _("%d sessions running"), g_list_length(((HostNode *) n->p)->screens)); data/apt-dater-1.0.4/src/ui.c:1447: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(statusln, _("%d session running"), g_list_length(((HostNode *) n->p)->screens)); data/apt-dater-1.0.4/src/ui.c:1456: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(statusln, _("Status is unknown")); data/apt-dater-1.0.4/src/ui.c:1465:4: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(statusln, _(" - host locked by another process")); data/apt-dater-1.0.4/src/ui.c:1474:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char statusln[BUF_MAX_LEN]; data/apt-dater-1.0.4/src/ui.c:1511:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char h[BUF_MAX_LEN]; data/apt-dater-1.0.4/src/ui.c:1540:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char h[BUF_MAX_LEN]; data/apt-dater-1.0.4/src/ui.c:1542:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char statusln[BUF_MAX_LEN]; data/apt-dater-1.0.4/src/ui.c:2837:17: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). filtered = atoi(Tcl_GetStringResult(tcl_interp)) > 0; data/apt-dater-1.0.4/src/apt-dater.h:99:9: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mode_t umask; data/apt-dater-1.0.4/src/colors.c:77: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). pos = strlen(PREFIX_COLOR_BRIGHT); data/apt-dater-1.0.4/src/env.c:101:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(n->identity_file && strlen(n->identity_file) > 0) data/apt-dater-1.0.4/src/exec.c:128:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n->parse_result = cfg->history_errpattern && strlen(cfg->history_errpattern);; data/apt-dater-1.0.4/src/exec.c:184:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n->parse_result = cfg->history_errpattern && strlen(cfg->history_errpattern); data/apt-dater-1.0.4/src/keyfiles.c:336:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(lcfg->umask); data/apt-dater-1.0.4/src/keyfiles.c:336:17: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(lcfg->umask); data/apt-dater-1.0.4/src/parsecmd.c:41:35: [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). GString *h = g_string_sized_new(strlen(src)); data/apt-dater-1.0.4/src/report.c:84:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(h->maintainer && strlen(h->maintainer)) { data/apt-dater-1.0.4/src/stats.c:317: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(argv[2]) > 3) data/apt-dater-1.0.4/src/stats.c:372:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(strlen(argv[0]) > 0) { data/apt-dater-1.0.4/src/tag.c:87:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). maxsize = s > strlen(pattern) ? strlen(pattern) : s; data/apt-dater-1.0.4/src/tag.c:87:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). maxsize = s > strlen(pattern) ? strlen(pattern) : s; data/apt-dater-1.0.4/src/tag.c:89:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for(i=0; i<strlen(str)&&strlen(&str[i]) >= maxsize;i++) data/apt-dater-1.0.4/src/tag.c:89:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for(i=0; i<strlen(str)&&strlen(&str[i]) >= maxsize;i++) data/apt-dater-1.0.4/src/tag.c:107:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(!in || !n || strlen(in) < 1) return FALSE; data/apt-dater-1.0.4/src/tag.c:109:42: [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(g_str_has_prefix(in, "~") == TRUE && strlen(in) >= 2) { data/apt-dater-1.0.4/src/tag.c:156:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for(i = 0; i < (strlen(pattern) > s ? s : strlen(pattern)); i++) { data/apt-dater-1.0.4/src/tag.c:156:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for(i = 0; i < (strlen(pattern) > s ? s : strlen(pattern)); i++) { data/apt-dater-1.0.4/src/tmux.c:132:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). while(lines[++i] && strlen(lines[i])) { data/apt-dater-1.0.4/src/ui.c:316:13: [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). slen = strlen(modstr); data/apt-dater-1.0.4/src/ui.c:325:13: [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). slen = strlen(modstr); data/apt-dater-1.0.4/src/ui.c:571: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). p -= strlen(shortCuts[i].key); data/apt-dater-1.0.4/src/ui.c:577: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). p -= strlen(_(shortCuts[i].descr)); data/apt-dater-1.0.4/src/ui.c:684:3: [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(buf, " "); data/apt-dater-1.0.4/src/ui.c:690:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(strlen(buf) > 1) { data/apt-dater-1.0.4/src/ui.c:697:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(strlen(buf) > 1) { data/apt-dater-1.0.4/src/ui.c:737:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(strlen(buf) > 0) data/apt-dater-1.0.4/src/ui.c:738:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). mvwaddnstr(wp, l-1, 21 + strlen(h->kernelrel), buf, COLS - 21 - strlen(h->kernelrel)); data/apt-dater-1.0.4/src/ui.c:738:68: [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). mvwaddnstr(wp, l-1, 21 + strlen(h->kernelrel), buf, COLS - 21 - strlen(h->kernelrel)); data/apt-dater-1.0.4/src/ui.c:967:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). mtime_pos = COLS < strlen(strinfo) ? COLS-1 : COLS-strlen(strinfo)-1; data/apt-dater-1.0.4/src/ui.c:967:54: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). mtime_pos = COLS < strlen(strinfo) ? COLS-1 : COLS-strlen(strinfo)-1; data/apt-dater-1.0.4/src/ui.c:1002:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). move(LINES - 1, strlen(query)); data/apt-dater-1.0.4/src/ui.c:1006:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for(i = strlen(in)-1; i>=0; i--) data/apt-dater-1.0.4/src/ui.c:1030:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). move(LINES - 1, strlen(query)); data/apt-dater-1.0.4/src/ui.c:1063:12: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). gchar r = getchar(); data/apt-dater-1.0.4/src/ui.c:1102:26: [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). mvwaddnstr(wp, l , 52+strlen(he->action), he->data, data/apt-dater-1.0.4/src/ui.c:1103:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). MAXCOLS(52+strlen(he->action), COLS- 52- strlen(he->action))); data/apt-dater-1.0.4/src/ui.c:1103:48: [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). MAXCOLS(52+strlen(he->action), COLS- 52- strlen(he->action))); data/apt-dater-1.0.4/src/ui.c:1547:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strftime(&h[strlen(h)], sizeof(h)-strlen(h), _("%D %H:%M "), tm_mtime); data/apt-dater-1.0.4/src/ui.c:1547:36: [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). strftime(&h[strlen(h)], sizeof(h)-strlen(h), _("%D %H:%M "), tm_mtime); data/apt-dater-1.0.4/src/ui.c:1549:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(&h[strlen(h)], sizeof(h)-strlen(h), "(%s)", data/apt-dater-1.0.4/src/ui.c:1549:36: [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). snprintf(&h[strlen(h)], sizeof(h)-strlen(h), "(%s)", data/apt-dater-1.0.4/src/ui.c:1620:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strftime(&h[strlen(h)], sizeof(h)-strlen(h), _("%D %H:%M "), tm_mtime); data/apt-dater-1.0.4/src/ui.c:1620:37: [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). strftime(&h[strlen(h)], sizeof(h)-strlen(h), _("%D %H:%M "), tm_mtime); data/apt-dater-1.0.4/src/ui.c:1622:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(&h[strlen(h)], sizeof(h)-strlen(h), "(%s)", data/apt-dater-1.0.4/src/ui.c:1622:37: [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). snprintf(&h[strlen(h)], sizeof(h)-strlen(h), "(%s)", data/apt-dater-1.0.4/src/ui.c:1844:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(filterexp, cfg->filterexp, BUF_MAX_LEN); data/apt-dater-1.0.4/src/ui.c:1873:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(maintainer, m, sizeof(maintainer)); data/apt-dater-1.0.4/src/ui.c:1877:30: [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 (pw && pw->pw_gecos && strlen(pw->pw_gecos)) data/apt-dater-1.0.4/src/ui.c:1878:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(maintainer, pw->pw_gecos, sizeof(maintainer)); data/apt-dater-1.0.4/src/ui.c:1880:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(maintainer, pw->pw_name, sizeof(maintainer)); data/apt-dater-1.0.4/src/ui.c:1899:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for(i = strlen(maintainer)-1; i>=0; i--) data/apt-dater-1.0.4/src/ui.c:2512:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const int offset = strlen(query)-1; data/apt-dater-1.0.4/src/ui.c:2528: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(s)>0) { data/apt-dater-1.0.4/src/ui.c:2530: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(s)>0) expandAllNodes(hosts); data/apt-dater-1.0.4/src/ui.c:2553:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if(strlen(s)<sizeof(s)) { data/apt-dater-1.0.4/src/ui.c:2561:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(strlen(s)) data/apt-dater-1.0.4/src/ui.c:2598: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). remln(COLS-offset-strlen(&selstr[pos])-1); data/apt-dater-1.0.4/src/ui.c:2723:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(!strlen(filterexp)) return; data/apt-dater-1.0.4/src/ui.c:2925:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for(i = strlen(filterexp)-1; i>=0; i--) data/apt-dater-1.0.4/src/ui.c:2962:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). move(LINES - 1, strlen(query)); data/apt-dater-1.0.4/src/ui.c:3320:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(in)==0) break; data/apt-dater-1.0.4/src/ui.c:3349: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(in)==0) data/apt-dater-1.0.4/src/ui.c:3365:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(in)==0) data/apt-dater-1.0.4/src/ui.c:3418:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(in)==0) retqry = FALSE; data/apt-dater-1.0.4/src/ui.c:3445: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(in2)==0) break; data/apt-dater-1.0.4/src/ui.c:3452: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(n->hostname) >= strlen(in2)) { data/apt-dater-1.0.4/src/ui.c:3452:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(strlen(n->hostname) >= strlen(in2)) { data/apt-dater-1.0.4/src/ui.c:3453:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(compHostWithPattern (n, in2, strlen(in2)) == TRUE) { ANALYSIS SUMMARY: Hits = 127 Lines analyzed = 9442 in approximately 0.69 seconds (13736 lines/second) Physical Source Lines of Code (SLOC) = 6668 Hits@level = [0] 42 [1] 70 [2] 39 [3] 7 [4] 11 [5] 0 Hits@level+ = [0+] 169 [1+] 127 [2+] 57 [3+] 18 [4+] 11 [5+] 0 Hits/KSLOC@level+ = [0+] 25.3449 [1+] 19.0462 [2+] 8.54829 [3+] 2.69946 [4+] 1.64967 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.