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/sredird-2.2.1/sredird.cpp

FINAL RESULTS:

data/sredird-2.2.1/sredird.cpp:488:17:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
                sprintf(LogStr,"Can't read pid from lock file %s.",LockFile);
data/sredird-2.2.1/sredird.cpp:503:17:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
                sprintf(LogStr,"Read our pid from lock %s.",LockFile);
data/sredird-2.2.1/sredird.cpp:516:19:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
                  sprintf(LogStr,"Removed stale lock %s (pid %d).",
data/sredird-2.2.1/sredird.cpp:522:19:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
                  sprintf(LogStr,"Couldn't remove stale lock %s (pid %d).",
data/sredird-2.2.1/sredird.cpp:530:17:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
                sprintf(LogStr,"Lock %s is owned by pid %d.",LockFile,Pid);
data/sredird-2.2.1/sredird.cpp:540:13:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
            sprintf(LogStr,"Can't create lock file %s.",LockFile);
data/sredird-2.2.1/sredird.cpp:556:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(LogStr,"Can't write HDB header to lock file %s.",LockFile);
data/sredird-2.2.1/sredird.cpp:581:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(LogStr,"Unlocked lock file %s.",LockFile);
data/sredird-2.2.1/sredird.cpp:1381:15:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
              sprintf(SigStr,"SRedird %s %s",VersionId,DeviceName);
data/sredird-2.2.1/sredird.cpp:1383:15:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
              sprintf(LogStr,"Sent signature: %s",SigStr);
data/sredird-2.2.1/sredird.cpp:1933:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(LogStr,"Unable to lock %s. Exiting.",LockFileName);
data/sredird-2.2.1/sredird.cpp:1940:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(LogStr,"Device %s locked.",DeviceName);
data/sredird-2.2.1/sredird.cpp:1950:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(LogStr,"Unable to open device %s. Exiting.",DeviceName);
data/sredird-2.2.1/sredird.cpp:206:16:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      unsigned char Buffer[BufferSize];
data/sredird-2.2.1/sredird.cpp:246: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.
static unsigned char IACCommand[TmpStrLen];
data/sredird-2.2.1/sredird.cpp:470: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 HDBBuffer[HDBHeaderLen + 1];
data/sredird-2.2.1/sredird.cpp:471: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 LogStr[TmpStrLen];
data/sredird-2.2.1/sredird.cpp:474:23:  [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).
    while ((FileDes = open(LockFile,O_CREAT | O_WRONLY | O_EXCL,LockFileMode)) == OpenError)
data/sredird-2.2.1/sredird.cpp:477:46:  [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 ((errno == EEXIST) && ((FileDes = open(LockFile,O_RDONLY,0)) != OpenError))
data/sredird-2.2.1/sredird.cpp:497: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).
            Pid = atoi(HDBBuffer);
data/sredird-2.2.1/sredird.cpp:549: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(HDBBuffer,"%10d\n",(int) LockPid);
data/sredird-2.2.1/sredird.cpp:574: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 LogStr[TmpStrLen];
data/sredird-2.2.1/sredird.cpp:1365: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 LogStr[TmpStrLen];
data/sredird-2.2.1/sredird.cpp:1366: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 SigStr[TmpStrLen];
data/sredird-2.2.1/sredird.cpp:1407:15:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
              sprintf(LogStr,"Port baud rate change to %lu requested.",BaudRate);
data/sredird-2.2.1/sredird.cpp:1415:11:  [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(LogStr,"Port baud rate: %lu",BaudRate);
data/sredird-2.2.1/sredird.cpp:1427:15:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
              sprintf(LogStr,"Port data size change to %u requested.",
data/sredird-2.2.1/sredird.cpp:1436:11:  [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(LogStr,"Port data size: %u",(unsigned int) DataSize);
data/sredird-2.2.1/sredird.cpp:1448:15:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
              sprintf(LogStr,"Port parity change to %u requested",
data/sredird-2.2.1/sredird.cpp:1457:11:  [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(LogStr,"Port parity: %u",(unsigned int) Parity);
data/sredird-2.2.1/sredird.cpp:1469:15:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
              sprintf(LogStr,"Port stop size change to %u requested.",
data/sredird-2.2.1/sredird.cpp:1478:11:  [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(LogStr,"Port stop size: %u",(unsigned int) StopSize);
data/sredird-2.2.1/sredird.cpp:1495: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(LogStr,"Port flow control: %u",(unsigned int) FlowControl);
data/sredird-2.2.1/sredird.cpp:1515: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(LogStr,"Port flow control change to %u requested.",(unsigned int) Command[4]);
data/sredird-2.2.1/sredird.cpp:1530: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(LogStr,"Port flow control: %u",(unsigned int) FlowControl);
data/sredird-2.2.1/sredird.cpp:1538:11:  [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(LogStr,"Line state set to %u",(unsigned int) Command[4]);
data/sredird-2.2.1/sredird.cpp:1548:11:  [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(LogStr,"Modem state mask set to %u",(unsigned int) Command[4]);
data/sredird-2.2.1/sredird.cpp:1556:11:  [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(LogStr,"Port flush %u requested.",(unsigned int) Command[4]);
data/sredird-2.2.1/sredird.cpp:1591:11:  [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(LogStr,"Unhandled request %u",(unsigned int) Command[3]);
data/sredird-2.2.1/sredird.cpp:1600: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 LogStr[TmpStrLen];
data/sredird-2.2.1/sredird.cpp:1618: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(LogStr,"Unknown suboption received: %u", (unsigned int) Command[2]);
data/sredird-2.2.1/sredird.cpp:1665: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(LogStr,"Rejecting option WILL: %u",(unsigned int) Command[2]);
data/sredird-2.2.1/sredird.cpp:1714: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(LogStr,"Rejecting option DO: %u",(unsigned int) Command[2]);
data/sredird-2.2.1/sredird.cpp:1726:11:  [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(LogStr,"Received rejection for option: %u",(unsigned int) Command[2]);
data/sredird-2.2.1/sredird.cpp:1745:15:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
              sprintf(LogStr,"Received rejection for option: %u",(unsigned int) Command[2]);
data/sredird-2.2.1/sredird.cpp:1806: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 LogStr[TmpStrLen];
data/sredird-2.2.1/sredird.cpp:1881: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).
    MaxLogLevel = atoi(argv[argi++]);
data/sredird-2.2.1/sredird.cpp:1891:28:  [2] (integer) atol:
  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).
        BTimeout.tv_usec = atol(argv[4]) * 1000;
data/sredird-2.2.1/sredird.cpp:1911: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(LogStr,"Log level: %i",MaxLogLevel);
data/sredird-2.2.1/sredird.cpp:1915: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(LogStr,"Polling interval (ms): %u",(unsigned int) (BTimeout.tv_usec / 1000));
data/sredird-2.2.1/sredird.cpp:1945:21:  [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 ((DeviceFd = open(DeviceName,O_RDWR | O_NOCTTY | O_NDELAY,0)) == OpenError)
data/sredird-2.2.1/sredird.cpp:1948: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(LogStr,"Device in use. Come back later.\r\n");
data/sredird-2.2.1/sredird.cpp:2140: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(LogStr,"Sent modem state: %u",
data/sredird-2.2.1/sredird.cpp:2152: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(LogStr,"Sent line state: %u",
data/sredird-2.2.1/sredird.cpp:480:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            N = read(FileDes,HDBBuffer,HDBHeaderLen);
data/sredird-2.2.1/sredird.cpp:1308: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).
    L = strlen(Str);
data/sredird-2.2.1/sredird.cpp:1389:15:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
              strncpy(SigStr,(char *) &Command[4],CSize - 6);
data/sredird-2.2.1/sredird.cpp:2088:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                    x = read(DeviceFd,&C,1);
data/sredird-2.2.1/sredird.cpp:2107:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                    x = read(STDIN_FILENO,&C,1);

ANALYSIS SUMMARY:

Hits = 59
Lines analyzed = 2191 in approximately 0.06 seconds (33801 lines/second)
Physical Source Lines of Code (SLOC) = 1474
Hits@level = [0]   2 [1]   5 [2]  41 [3]   0 [4]  13 [5]   0
Hits@level+ = [0+]  61 [1+]  59 [2+]  54 [3+]  13 [4+]  13 [5+]   0
Hits/KSLOC@level+ = [0+] 41.384 [1+] 40.0271 [2+] 36.635 [3+] 8.81954 [4+] 8.81954 [5+]   0
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.