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/logtop-0.4.3/src/curses.c
Examining data/logtop-0.4.3/src/logtop.h
Examining data/logtop-0.4.3/src/avl.c
Examining data/logtop-0.4.3/src/history.c
Examining data/logtop-0.4.3/src/stdout.c
Examining data/logtop-0.4.3/src/logtop.c
Examining data/logtop-0.4.3/src/avl.h
Examining data/logtop-0.4.3/src/history.h
Examining data/logtop-0.4.3/src/libavl/avl.c
Examining data/logtop-0.4.3/src/libavl/avl.h

FINAL RESULTS:

data/logtop-0.4.3/src/logtop.c:148:13:  [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.
        c = getopt_long(ac, av, "qhvl:s:i:",
data/logtop-0.4.3/src/libavl/avl.c:97: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.
  unsigned char da[AVL_MAX_HEIGHT]; /* Cached comparison results. */
data/logtop-0.4.3/src/libavl/avl.c:232: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.
  unsigned char da[AVL_MAX_HEIGHT];    /* |avl_link[]| indexes. */
data/logtop-0.4.3/src/libavl/avl.c:569:11:  [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 (trav->avl_stack, (const void *) src->avl_stack,
data/logtop-0.4.3/src/logtop.c:155:39:  [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).
                gl_env.line_by_line = atoi(optarg);
data/logtop-0.4.3/src/logtop.c:161:39:  [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).
                gl_env.history_size = atoi(optarg);
data/logtop-0.4.3/src/logtop.c:164:35:  [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).
                gl_env.interval = atoi(optarg);
data/logtop-0.4.3/src/avl.c:83:56:  [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).
    HASH_ADD_KEYPTR(hh, gl_env.strings, entry->string, strlen(entry->string),

ANALYSIS SUMMARY:

Hits = 8
Lines analyzed = 1876 in approximately 0.07 seconds (25067 lines/second)
Physical Source Lines of Code (SLOC) = 1333
Hits@level = [0]  10 [1]   1 [2]   6 [3]   1 [4]   0 [5]   0
Hits@level+ = [0+]  18 [1+]   8 [2+]   7 [3+]   1 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 13.5034 [1+] 6.0015 [2+] 5.25131 [3+] 0.750188 [4+]   0 [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.