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/birthday-1.6.2/bdtrans.c
Examining data/birthday-1.6.2/bdwin.c
Examining data/birthday-1.6.2/getopt.c
Examining data/birthday-1.6.2/getopt.h
Examining data/birthday-1.6.2/xmalloc.h
Examining data/birthday-1.6.2/xmalloc.c
Examining data/birthday-1.6.2/alloca.c
Examining data/birthday-1.6.2/bdcal.c
Examining data/birthday-1.6.2/bdengine.c
Examining data/birthday-1.6.2/birthday.c
Examining data/birthday-1.6.2/birthday.h

FINAL RESULTS:

data/birthday-1.6.2/bdengine.c:135:5:  [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(where, what);					    \
data/birthday-1.6.2/bdengine.c:329:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(buf,getpwuid(getuid())->pw_dir);
data/birthday-1.6.2/bdengine.c:330:3:  [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(buf, "/" DEFAULT_FILE);
data/birthday-1.6.2/bdengine.c:585:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	  sprintf(buf2, "%s is %d years old", buf, tmp_age);
data/birthday-1.6.2/bdengine.c:587:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	  sprintf(buf2, "%s is %d year old", buf, tmp_age);
data/birthday-1.6.2/bdengine.c:590:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buf2, "%s has a birthday", buf);
data/birthday-1.6.2/bdengine.c:595:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buf2, "%s %d years ago", buf, ydelta(evl[i].date, *today));
data/birthday-1.6.2/bdengine.c:597:2:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	strcpy(buf2, buf);
data/birthday-1.6.2/bdengine.c:607:7:  [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(buf2, buf);
data/birthday-1.6.2/bdengine.c:616:7:  [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(buf2, buf);
data/birthday-1.6.2/xmalloc.c:36:3:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  vfprintf(stderr, fmt, ap);
data/birthday-1.6.2/xmalloc.h:23:60:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
void fatal(char *fmt, ...) __attribute__ ((noreturn,format(printf,1,2)));
data/birthday-1.6.2/bdwin.c:13:12:  [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.
extern int getopt (int argc, char *const *argv, const char *shortopts);
data/birthday-1.6.2/bdwin.c:67:18:  [3] (misc) LoadLibrary:
  Ensure that the full path to the library is specified, or current directory
  may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to
  find library path, if you aren't already.
   hInstDPCLib = LoadLibrary("dpclib.dll");
data/birthday-1.6.2/bdwin.c:72:15:  [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 ((i = getopt (argc, argv, "f:W:M:m:")) != -1)
data/birthday-1.6.2/birthday.c:64:15:  [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 ((i = getopt (argc, argv, "wcLf:W:M:m:l:p:d:i:T:")) != -1)
data/birthday-1.6.2/getopt.c:161:7:  [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 *getenv ();
data/birthday-1.6.2/getopt.c:320:16:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
      else if (getenv ("POSIXLY_CORRECT") != NULL)
data/birthday-1.6.2/getopt.c:601:1:  [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.
getopt (argc, argv, optstring)
data/birthday-1.6.2/getopt.c:629:11:  [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.
      c = getopt (argc, argv, "abc:d:0123456789");
data/birthday-1.6.2/getopt.h:101:12:  [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.
extern int getopt (int argc, char *const *argv, const char *shortopts);
data/birthday-1.6.2/getopt.h:103:12:  [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.
extern int getopt ();
data/birthday-1.6.2/getopt.h:105:12:  [3] (buffer) getopt_long:
  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.
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
data/birthday-1.6.2/getopt.h:117:12:  [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.
extern int getopt ();
data/birthday-1.6.2/getopt.h:118:12:  [3] (buffer) getopt_long:
  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.
extern int getopt_long ();
data/birthday-1.6.2/alloca.c:104: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	align[ALIGN_SIZE];	/* to force sizeof(header) */
data/birthday-1.6.2/bdengine.c:105: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.
const char *NUMBERS[10] = {"zero","one","two","three","four","five","six","seven","eight","nine"};
data/birthday-1.6.2/bdengine.c: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 tmp[128];
data/birthday-1.6.2/bdengine.c:327: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[256];
data/birthday-1.6.2/bdengine.c:420:3:  [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(&d, date, sizeof(struct date));
data/birthday-1.6.2/bdengine.c:456: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[1024], buf2[1024];
data/birthday-1.6.2/bdengine.c:470: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).
    if((file=fopen(fname, "rt"))==NULL) {
data/birthday-1.6.2/bdtrans.c:15:18:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
typedef struct { char name[30]; struct date date; unsigned warn : 1;
data/birthday-1.6.2/bdtrans.c:33: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).
   if ((file = fopen(fname, "r+b")) == NULL) {
data/birthday-1.6.2/bdwin.c:45:4:  [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 *argv[128]; /* 128 cmdline args max --- should be enough! */
data/birthday-1.6.2/bdwin.c:79:11:  [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).
	iDWarn = atoi(optarg);
data/birthday-1.6.2/bdwin.c:82: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).
	iMaxWarn = atoi(optarg);
data/birthday-1.6.2/bdwin.c:85: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).
	iMinWarn = atoi(optarg);
data/birthday-1.6.2/birthday.c:77:11:  [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).
	iDWarn = atoi(optarg);
data/birthday-1.6.2/birthday.c:80: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).
	iMaxWarn = atoi(optarg);
data/birthday-1.6.2/birthday.c:83: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).
	iMinWarn = atoi(optarg);
data/birthday-1.6.2/birthday.c:86:10:  [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).
	iCLines=atoi(optarg);
data/birthday-1.6.2/birthday.c:92:10:  [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).
	iCWeeks=atoi(optarg);
data/birthday-1.6.2/birthday.c:95:10:  [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).
	iCTotal=atoi(optarg);
data/birthday-1.6.2/birthday.c:98:10:  [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).
	iCWidth=atoi(optarg);
data/birthday-1.6.2/getopt.c:155:33:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define my_bcopy(src, dst, n)   memcpy ((dst), (src), (n))
data/birthday-1.6.2/bdcal.c:94: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).
	    chars+=strlen(evl[j].text)+4;
data/birthday-1.6.2/bdcal.c:97: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).
		chars=strlen(evl[j].text);
data/birthday-1.6.2/bdengine.c:126: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).
#define strbegcmp(a,b) strncmp(a,b,strlen(a))
data/birthday-1.6.2/bdengine.c:131: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(what) > (size - strlen(where) - 1)) {		    \
data/birthday-1.6.2/bdengine.c:131: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(what) > (size - strlen(where) - 1)) {		    \
data/birthday-1.6.2/bdengine.c:132: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).
      where = xrealloc(where, size + 128 + strlen(what));	    \
data/birthday-1.6.2/bdengine.c:133: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).
      size += 128 + strlen(what);				    \
data/birthday-1.6.2/bdengine.c:179: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 (*(buf + strlen(buf) - 1) == 's')
data/birthday-1.6.2/bdengine.c:485: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).
      buf[strlen(buf)-1] = 0;
data/birthday-1.6.2/bdengine.c:487: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).
	ptr=(buf+1)+strlen((buf+1));
data/birthday-1.6.2/bdengine.c:494: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).
	if (directlist[j].len == 0) directlist[j].len = strlen(directlist[j].text);
data/birthday-1.6.2/bdengine.c:543:71:  [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 (k = 0; FTABLE[k].txt != NULL && strncmp(FTABLE[k].txt, ptr + j, strlen(FTABLE[k].txt)); k++);
data/birthday-1.6.2/bdtrans.c:58:27:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      *(p + cnt) = (char) fgetc(file);
data/birthday-1.6.2/bdtrans.c:76:56:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   for (i=0; i < sizeof(INT); i++) ((char *) &lr)[i] = fgetc(file);
data/birthday-1.6.2/getopt.c:428: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).
	    if (s - nextchar == strlen (p->name))
data/birthday-1.6.2/getopt.c:452: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).
	  nextchar += strlen (nextchar);
data/birthday-1.6.2/getopt.c:482: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).
		  nextchar += strlen (nextchar);
data/birthday-1.6.2/getopt.c:495: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).
		  nextchar += strlen (nextchar);
data/birthday-1.6.2/getopt.c:499: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).
	  nextchar += strlen (nextchar);

ANALYSIS SUMMARY:

Hits = 65
Lines analyzed = 2303 in approximately 0.08 seconds (28773 lines/second)
Physical Source Lines of Code (SLOC) = 1425
Hits@level = [0]  35 [1]  19 [2]  21 [3]  13 [4]  12 [5]   0
Hits@level+ = [0+] 100 [1+]  65 [2+]  46 [3+]  25 [4+]  12 [5+]   0
Hits/KSLOC@level+ = [0+] 70.1754 [1+] 45.614 [2+] 32.2807 [3+] 17.5439 [4+] 8.42105 [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.