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/cal-4.0/src/cal.c FINAL RESULTS: data/cal-4.0/src/cal.c:818:17: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(str, months[i]); data/cal-4.0/src/cal.c:1077:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(dest, p); data/cal-4.0/src/cal.c:1242:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(command,"%s3%d;4%dm",command,dos2ansi[attr&0x0F], data/cal-4.0/src/cal.c:1332:17: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(lln[k], lln[k-1]); data/cal-4.0/src/cal.c:1553:16: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(strcat(strcpy(lln[j], " "), months[(m%12)+1]), "--"); data/cal-4.0/src/cal.c:1672:21: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(strcat(strcpy(newdescrip, field), "'s "), descrip); data/cal-4.0/src/cal.c:1672:35: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcat(strcat(strcpy(newdescrip, field), "'s "), descrip); data/cal-4.0/src/cal.c:1674:21: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(descrip, newdescrip); data/cal-4.0/src/cal.c:1685:36: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). addfilename(strtok(strcpy(malloc(strlen(tempstr)+1),tempstr),"\n")); data/cal-4.0/src/cal.c:1720:17: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(&ll[4], descrip); data/cal-4.0/src/cal.c:1733:16: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(strcat(strcpy(lln[j], " "), months[m%12]), "--"); data/cal-4.0/src/cal.c:1759:13: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(str, homedir); data/cal-4.0/src/cal.c:1767:17: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(str, file); data/cal-4.0/src/cal.c:1785:13: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(str, PREFIX); data/cal-4.0/src/cal.c:1793:17: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(str,file); data/cal-4.0/src/cal.c:600:14: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. calopt = getenv("CALOPT"); data/cal-4.0/src/cal.c:673: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. s = getenv("HOME"); data/cal-4.0/src/cal.c:262:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 *mon_attr, *wk_attr, *day_attr, *spclday_attr, *line_attr[MAXAPPTS]; data/cal-4.0/src/cal.c:388: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). maxappts = atoi(optarg); break; data/cal-4.0/src/cal.c:411: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). continu = atoi(optarg); /* display successive months */ data/cal-4.0/src/cal.c:575: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 str[MAXLINE]; data/cal-4.0/src/cal.c:710:26: [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 ((fg[i] = atoi(str)) == (bg[i] = atoi(&str[3]))) break; data/cal-4.0/src/cal.c:710:49: [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 ((fg[i] = atoi(str)) == (bg[i] = atoi(&str[3]))) break; data/cal-4.0/src/cal.c:913:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(line_attr[0], mon_attr, YEARWID); data/cal-4.0/src/cal.c:914:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(line_attr[1], wk_attr, YEARWID); data/cal-4.0/src/cal.c:915:37: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. for (l = 2; l < 8; l++) memcpy(line_attr[l], day_attr, YEARWID); data/cal-4.0/src/cal.c:920:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(line[0]+p+((MonthWid-2)/2)-(strlen(months[m])/2), data/cal-4.0/src/cal.c:922:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(line[1]+p, dayline, MonthWid-2); data/cal-4.0/src/cal.c:929:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(line_attr[l], mon_attr, MonthWid-1); data/cal-4.0/src/cal.c:931:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(line_attr[l], wk_attr, MonthWid-1); data/cal-4.0/src/cal.c:933:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(line_attr[l], day_attr, MonthWid-1); data/cal-4.0/src/cal.c:936:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&line_attr[l][MonthWid-1], spclday_attr, DAY_DESC+1); data/cal-4.0/src/cal.c:940:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(line[0]+((MonthWid-2)/2)-((strlen(months[m])+1+stryearlen(y))/2), data/cal-4.0/src/cal.c:945:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(line[1]+p, dayline, MonthWid-2); data/cal-4.0/src/cal.c:1061: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 str[11], *p; data/cal-4.0/src/cal.c:1226: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 command[256]; data/cal-4.0/src/cal.c:1239:9: [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(command,"\033[0;"); data/cal-4.0/src/cal.c:1240:24: [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. if (attr&0x80) strcat(command,"5;"); data/cal-4.0/src/cal.c:1241:24: [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. if (attr&0x08) strcat(command,"1;"); data/cal-4.0/src/cal.c:1328:25: [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 (dy < (day = atoi(&lln[j][1]))) { data/cal-4.0/src/cal.c:1354: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 str[MAXLINE]; data/cal-4.0/src/cal.c:1365:5: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(lln[0], " 100"); /* last (hiappt) entry */ data/cal-4.0/src/cal.c:1372:23: [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 ((yr = atoi(str)) == 0) continue; /* get year */ data/cal-4.0/src/cal.c:1373:23: [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 ((mo = atoi(&str[5])) == 0) continue; /* get month */ data/cal-4.0/src/cal.c:1374: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). dy = atoi(&str[8]); /* get day */ data/cal-4.0/src/cal.c:1375: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). wn = atoi(&str[11]); /*nth wkdy or period*/ data/cal-4.0/src/cal.c:1499:30: [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). by = atoi(&str[++j]); /* year of aniversary */ data/cal-4.0/src/cal.c:1549:13: [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(&lln[j][1]) == 100) break; /* find last item */ data/cal-4.0/src/cal.c:1553:9: [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(strcat(strcpy(lln[j], " "), months[(m%12)+1]), "--"); data/cal-4.0/src/cal.c:1605:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char tempstr[MAXLINE]; /* big enough for a long reminder line */ data/cal-4.0/src/cal.c:1615:5: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(lln[0], " 100"); /* last entry */ data/cal-4.0/src/cal.c:1638:26: [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). dy = atoi(tempstr); data/cal-4.0/src/cal.c:1644:30: [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). dy = atoi(field+1); data/cal-4.0/src/cal.c:1649:34: [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). yr = atoi(field+1); data/cal-4.0/src/cal.c:1672:28: [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(strcat(strcpy(newdescrip, field), "'s "), descrip); data/cal-4.0/src/cal.c:1729:13: [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(&lln[j][1]) == 100) break; /* find last item */ data/cal-4.0/src/cal.c:1733:9: [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(strcat(strcpy(lln[j], " "), months[m%12]), "--"); data/cal-4.0/src/cal.c:1747: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 str[CAL_MAXPATH]; data/cal-4.0/src/cal.c:1750: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 path[CAL_MAXPATH]; data/cal-4.0/src/cal.c:1754: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). if ((fp = fopen(file, mode)) == NULL) { data/cal-4.0/src/cal.c:1768:22: [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). fp = fopen(str, mode); data/cal-4.0/src/cal.c:1778:22: [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). fp = fopen(path, mode); data/cal-4.0/src/cal.c:1790:13: [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(str, "/etc/cal/"); data/cal-4.0/src/cal.c:1794:22: [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). fp = fopen(str, mode); data/cal-4.0/src/cal.c:452: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(dayline," "); data/cal-4.0/src/cal.c:459:9: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(dayline,nl_langinfo(ABDAY_1+day),julian ? 3 : 2); data/cal-4.0/src/cal.c:461:9: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(dayline,_time_info->abbrev_wkday[day],julian ? 3 : 2); data/cal-4.0/src/cal.c:463:9: [1] (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 character. strcat(dayline, " "); data/cal-4.0/src/cal.c:666:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(homedir,argv[0],CAL_MAXPATH-1); data/cal-4.0/src/cal.c:668: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). i = strlen(homedir); data/cal-4.0/src/cal.c:674:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(homedir,s,CAL_MAXPATH-1); data/cal-4.0/src/cal.c:816: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). if (strlen(argv[1]) >= 3 && ! isdigit(argv[1][0]) ) { data/cal-4.0/src/cal.c:920:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memcpy(line[0]+p+((MonthWid-2)/2)-(strlen(months[m])/2), data/cal-4.0/src/cal.c:921:27: [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). months[m], strlen(months[m])); data/cal-4.0/src/cal.c:940:43: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memcpy(line[0]+((MonthWid-2)/2)-((strlen(months[m])+1+stryearlen(y))/2), data/cal-4.0/src/cal.c:941:27: [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). months[m], strlen(months[m])); data/cal-4.0/src/cal.c:942: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). stryearcpy(line[0]+((MonthWid-2)/2)-((strlen(months[m])+1 data/cal-4.0/src/cal.c:943: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). +stryearlen(y))/2)+strlen(months[m])+1, y); data/cal-4.0/src/cal.c:944:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). line[0][strlen(line[0])] = ' '; /* Remote NULL terminator */ data/cal-4.0/src/cal.c:1474:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). j = strlen(str) - 1; /* get rid of trailing white space */ data/cal-4.0/src/cal.c:1553:23: [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. strcat(strcat(strcpy(lln[j], " "), months[(m%12)+1]), "--"); data/cal-4.0/src/cal.c:1685:50: [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). addfilename(strtok(strcpy(malloc(strlen(tempstr)+1),tempstr),"\n")); data/cal-4.0/src/cal.c:1716: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). j = strlen(descrip) - 1; /* get rid of trailing white space */ data/cal-4.0/src/cal.c:1733:23: [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. strcat(strcat(strcpy(lln[j], " "), months[m%12]), "--"); data/cal-4.0/src/cal.c:1758: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). if (*homedir && strlen(homedir) < CAL_MAXPATH) { data/cal-4.0/src/cal.c:1760: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 ((strlen(homedir) + strlen(file) + 1) < CAL_MAXPATH) { data/cal-4.0/src/cal.c:1760: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). if ((strlen(homedir) + strlen(file) + 1) < CAL_MAXPATH) { data/cal-4.0/src/cal.c:1762:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (homedir[strlen(homedir)-1] != '/') strcat(str,"/"); data/cal-4.0/src/cal.c:1762:56: [1] (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 character. if (homedir[strlen(homedir)-1] != '/') strcat(str,"/"); data/cal-4.0/src/cal.c:1763:37: [1] (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 character. if (file[0] != '.') strcat(str, "."); data/cal-4.0/src/cal.c:1765:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (homedir[strlen(homedir)-1] != '/') strcat(str,"\\"); data/cal-4.0/src/cal.c:1765:56: [1] (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 character. if (homedir[strlen(homedir)-1] != '/') strcat(str,"\\"); data/cal-4.0/src/cal.c:1792:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(str) + strlen(file) <= CAL_MAXPATH) { data/cal-4.0/src/cal.c:1792:31: [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(str) + strlen(file) <= CAL_MAXPATH) { ANALYSIS SUMMARY: Hits = 94 Lines analyzed = 1864 in approximately 0.10 seconds (18004 lines/second) Physical Source Lines of Code (SLOC) = 1304 Hits@level = [0] 0 [1] 30 [2] 47 [3] 2 [4] 15 [5] 0 Hits@level+ = [0+] 94 [1+] 94 [2+] 64 [3+] 17 [4+] 15 [5+] 0 Hits/KSLOC@level+ = [0+] 72.0859 [1+] 72.0859 [2+] 49.0798 [3+] 13.0368 [4+] 11.5031 [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.