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/bbmail-0.9.3/src/spoollist.cpp
Examining data/bbmail-0.9.3/src/mailboxmenu.cpp
Examining data/bbmail-0.9.3/src/baseresource.h
Examining data/bbmail-0.9.3/src/main.h
Examining data/bbmail-0.9.3/src/bbmail.h
Examining data/bbmail-0.9.3/src/spoollist.h
Examining data/bbmail-0.9.3/src/resource.h
Examining data/bbmail-0.9.3/src/mailboxmenu.h
Examining data/bbmail-0.9.3/src/blackboxstyle.h
Examining data/bbmail-0.9.3/src/bbmail.cpp
Examining data/bbmail-0.9.3/src/main.cpp
Examining data/bbmail-0.9.3/src/baseresource.cpp
Examining data/bbmail-0.9.3/src/resource.cpp

FINAL RESULTS:

data/bbmail-0.9.3/src/bbmail.cpp:207:30:  [4] (shell) popen:
  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.
            if ((fp = (FILE*)popen(
data/bbmail-0.9.3/src/bbmail.cpp:245:28:  [4] (shell) popen:
  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.
            if ((fp=(FILE*)popen(
data/bbmail-0.9.3/src/bbmail.cpp:649:13:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
            system(resource->spoolfile[checkmail->getNewMailbox()].newmailProc.c_str());
data/bbmail-0.9.3/src/bbmail.cpp:1007:13:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
            sprintf(t, SEPERATOR);
data/bbmail-0.9.3/src/bbmail.cpp:1230:21:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
                    system(m_pBbtool->getResource()->spoolfile[m_pBbtool->checkMail()->getNewMailbox()].runCommand.c_str());
data/bbmail-0.9.3/src/bbmail.cpp:1234:25:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
                        system(m_pBbtool->getResource()->report.runCommand.c_str());
data/bbmail-0.9.3/src/bbmail.cpp:1239:21:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
                    system(m_pBbtool->getResource()->report.runCommand.c_str());
data/bbmail-0.9.3/src/mailboxmenu.cpp:127:17:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
                system(bbtool->getResource()->spoolfile[id].runCommand.c_str());
data/bbmail-0.9.3/src/mailboxmenu.cpp:130:17:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
                system(bbtool->getResource()->report.runCommand.c_str());
data/bbmail-0.9.3/src/resource.cpp:238: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.
			if (!getenv("MAIL")) {
data/bbmail-0.9.3/src/resource.cpp:261:42:  [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.
			  	std::string filename = std::string(getenv("MAIL"));
data/bbmail-0.9.3/src/baseresource.cpp:241: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 color_name[8];
data/bbmail-0.9.3/src/bbmail.cpp:334: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 mailbuf[128];
data/bbmail-0.9.3/src/bbmail.cpp:343: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).
    if (!(spool_id = fopen(m_pBbtool->getResource()->spoolfile[spoolno].filename.c_str(),
data/bbmail-0.9.3/src/bbmail.cpp:473: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 ch[6]={0,0,0,0,0,0};
data/bbmail-0.9.3/src/bbmail.cpp:486: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).
            num[x]=atoi(ch);
data/bbmail-0.9.3/src/bbmail.cpp:915: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(t, "%0*d/%0*d", m_pBbtool->getResource()->report.number_of_digits, 0, m_pBbtool->getResource()->report.number_of_digits, 0);
data/bbmail-0.9.3/src/bbmail.cpp:919: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(t, "%0*d", m_pBbtool->getResource()->report.number_of_digits, 0);
data/bbmail-0.9.3/src/bbmail.cpp:922: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(t, "%0*d", m_pBbtool->getResource()->report.number_of_digits, 0);
data/bbmail-0.9.3/src/bbmail.cpp:929: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(t, "%0*d", m_pBbtool->getResource()->report.number_of_digits, 0);
data/bbmail-0.9.3/src/bbmail.cpp:936: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(t, "%0*d", m_pBbtool->getResource()->report.number_of_digits, 0);
data/bbmail-0.9.3/src/bbmail.cpp:967: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 t[6];
data/bbmail-0.9.3/src/bbmail.cpp:980:13:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
            sprintf(t, "%0*d",m_pBbtool->getResource()->report.number_of_digits, m_pBbtool->checkMail()->getNewmail());
data/bbmail-0.9.3/src/bbmail.cpp:1034:13:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
            sprintf(t, "%0*d", m_pBbtool->getResource()->report.number_of_digits, m_pBbtool->checkMail()->getLastTotalmail());
data/bbmail-0.9.3/src/bbmail.cpp:1439:17:  [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 position[13];
data/bbmail-0.9.3/src/bbmail.cpp:1440:17:  [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(position,"+%i+%i", fx, fy);
data/bbmail-0.9.3/src/mailboxmenu.cpp:108: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 dummy[256];
data/bbmail-0.9.3/src/mailboxmenu.cpp:110: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(dummy," (%d/%d)", newmail, totalmail);
data/bbmail-0.9.3/src/resource.cpp:208: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 strname[48];
data/bbmail-0.9.3/src/resource.cpp:209: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 strclass[48];
data/bbmail-0.9.3/src/resource.cpp:329: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(strname,"bbmail.mailbox.%d.mode",i+start_mailbox);
data/bbmail-0.9.3/src/resource.cpp:330: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(strclass,"Bbmail.Mailbox.%d.Mode",i+start_mailbox);
data/bbmail-0.9.3/src/baseresource.cpp:40:54:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		const std::string blackbox_stylefile = bt_resource.read("session.styleFile", "Session.StyleFile", "");
data/bbmail-0.9.3/src/baseresource.cpp:90:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
 	return(bt_resource.read(rname, rclass, default_val));
data/bbmail-0.9.3/src/baseresource.cpp:97:32:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	std::string tmp = bt_resource.read(rname, rclass, "");
data/bbmail-0.9.3/src/baseresource.cpp:99:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		return(bt_resource.read(alt_rname, alt_rclass, default_val));
data/bbmail-0.9.3/src/baseresource.cpp:106:32:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	std::string tmp = bt_resource.read(rname, rclass, "");
data/bbmail-0.9.3/src/baseresource.cpp:115:32:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	std::string tmp = bt_resource.read(rname, rclass, "");
data/bbmail-0.9.3/src/baseresource.cpp:126:32:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	std::string tmp = bt_resource.read(rname, rclass, "");
data/bbmail-0.9.3/src/baseresource.cpp:128:33:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		std::string tmp = bt_resource.read(alt_rname, alt_rclass, "");
data/bbmail-0.9.3/src/baseresource.cpp:143:32:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	std::string tmp = bt_resource.read(rname, rclass, "");
data/bbmail-0.9.3/src/baseresource.cpp:155:35:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	std::string rcolor = bt_resource.read(rname, rclass, default_color);
data/bbmail-0.9.3/src/baseresource.cpp:166:35:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	std::string rcolor = bt_resource.read(rname, rclass, "");
data/bbmail-0.9.3/src/baseresource.cpp:168:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		rcolor = bt_resource.read(alt_rname, alt_rclass, default_color);
data/bbmail-0.9.3/src/baseresource.cpp:204:38:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  std::string rtexture = bt_resource.read(rname, rclass, 
data/bbmail-0.9.3/src/baseresource.cpp:205:55:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                                          bt_resource.read(rname + ".appearance",
data/bbmail-0.9.3/src/baseresource.cpp:225:38:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	std::string font_name = bt_resource.read(rname, rclass, "");
data/bbmail-0.9.3/src/baseresource.cpp:227:27:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		font_name = bt_resource.read(alt_rname, alt_rclass, "");
data/bbmail-0.9.3/src/bbmail.cpp:989:13:  [1] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source is a constant character.
            sprintf(t, ">");
data/bbmail-0.9.3/src/bbmail.cpp:1017:13:  [1] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source is a constant character.
            sprintf(t, ">");

ANALYSIS SUMMARY:

Hits = 50
Lines analyzed = 3138 in approximately 0.10 seconds (30870 lines/second)
Physical Source Lines of Code (SLOC) = 2392
Hits@level = [0]  43 [1]  18 [2]  21 [3]   2 [4]   9 [5]   0
Hits@level+ = [0+]  93 [1+]  50 [2+]  32 [3+]  11 [4+]   9 [5+]   0
Hits/KSLOC@level+ = [0+] 38.8796 [1+] 20.903 [2+] 13.3779 [3+] 4.59866 [4+] 3.76254 [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.