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/libcorkipset-1.1.1+20150311/examples/ipv4-set-size.c
Examining data/libcorkipset-1.1.1+20150311/include/ipset/bdd/nodes.h
Examining data/libcorkipset-1.1.1+20150311/include/ipset/bits.h
Examining data/libcorkipset-1.1.1+20150311/include/ipset/errors.h
Examining data/libcorkipset-1.1.1+20150311/include/ipset/ipset.h
Examining data/libcorkipset-1.1.1+20150311/include/ipset/logging.h
Examining data/libcorkipset-1.1.1+20150311/src/ipsetbuild/ipsetbuild.c
Examining data/libcorkipset-1.1.1+20150311/src/ipsetcat/ipsetcat.c
Examining data/libcorkipset-1.1.1+20150311/src/ipsetdot/ipsetdot.c
Examining data/libcorkipset-1.1.1+20150311/src/libipset/bdd/assignments.c
Examining data/libcorkipset-1.1.1+20150311/src/libipset/bdd/basics.c
Examining data/libcorkipset-1.1.1+20150311/src/libipset/bdd/bdd-iterator.c
Examining data/libcorkipset-1.1.1+20150311/src/libipset/bdd/expanded.c
Examining data/libcorkipset-1.1.1+20150311/src/libipset/bdd/reachable.c
Examining data/libcorkipset-1.1.1+20150311/src/libipset/bdd/read.c
Examining data/libcorkipset-1.1.1+20150311/src/libipset/bdd/write.c
Examining data/libcorkipset-1.1.1+20150311/src/libipset/general.c
Examining data/libcorkipset-1.1.1+20150311/src/libipset/map/allocation.c
Examining data/libcorkipset-1.1.1+20150311/src/libipset/map/inspection.c
Examining data/libcorkipset-1.1.1+20150311/src/libipset/map/ipv4_map.c
Examining data/libcorkipset-1.1.1+20150311/src/libipset/map/ipv6_map.c
Examining data/libcorkipset-1.1.1+20150311/src/libipset/map/storage.c
Examining data/libcorkipset-1.1.1+20150311/src/libipset/set/allocation.c
Examining data/libcorkipset-1.1.1+20150311/src/libipset/set/inspection.c
Examining data/libcorkipset-1.1.1+20150311/src/libipset/set/ipv4_set.c
Examining data/libcorkipset-1.1.1+20150311/src/libipset/set/ipv6_set.c
Examining data/libcorkipset-1.1.1+20150311/src/libipset/set/iterator.c
Examining data/libcorkipset-1.1.1+20150311/src/libipset/set/storage.c
Examining data/libcorkipset-1.1.1+20150311/tests/test-assignment.c
Examining data/libcorkipset-1.1.1+20150311/tests/test-bdd.c
Examining data/libcorkipset-1.1.1+20150311/tests/test-ipmap.c
Examining data/libcorkipset-1.1.1+20150311/tests/test-ipset.c
Examining data/libcorkipset-1.1.1+20150311/tests/test-iterator.c

FINAL RESULTS:

data/libcorkipset-1.1.1+20150311/include/ipset/logging.h:23:9:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        fprintf(stderr, __VA_ARGS__); \
data/libcorkipset-1.1.1+20150311/src/ipsetbuild/ipsetbuild.c:132:17:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
                fprintf(stdout, FULL_USAGE);
data/libcorkipset-1.1.1+20150311/src/ipsetbuild/ipsetbuild.c:152:17:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
                fprintf(stderr, USAGE);
data/libcorkipset-1.1.1+20150311/src/ipsetbuild/ipsetbuild.c:164:9:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        fprintf(stderr, USAGE);
data/libcorkipset-1.1.1+20150311/src/ipsetbuild/ipsetbuild.c:172:9:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        fprintf(stderr, USAGE);
data/libcorkipset-1.1.1+20150311/src/ipsetcat/ipsetcat.c:96:17:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
                fprintf(stdout, FULL_USAGE);
data/libcorkipset-1.1.1+20150311/src/ipsetcat/ipsetcat.c:112:17:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
                fprintf(stderr, USAGE);
data/libcorkipset-1.1.1+20150311/src/ipsetcat/ipsetcat.c:122:9:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        fprintf(stderr, USAGE);
data/libcorkipset-1.1.1+20150311/src/ipsetdot/ipsetdot.c:78:17:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
                fprintf(stdout, FULL_USAGE);
data/libcorkipset-1.1.1+20150311/src/ipsetdot/ipsetdot.c:90:17:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
                fprintf(stderr, USAGE);
data/libcorkipset-1.1.1+20150311/src/ipsetdot/ipsetdot.c:100:9:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        fprintf(stderr, USAGE);
data/libcorkipset-1.1.1+20150311/examples/ipv4-set-size.c:26:32:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
        uint8_t  random_byte = random() & 0xff;
data/libcorkipset-1.1.1+20150311/examples/ipv4-set-size.c:81:5:  [3] (random) srandom:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    srandom(time(NULL));
data/libcorkipset-1.1.1+20150311/src/ipsetbuild/ipsetbuild.c:129:18:  [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.
    while ((ch = getopt_long(argc, argv, "hlo:vq", longopts, NULL)) != -1) {
data/libcorkipset-1.1.1+20150311/src/ipsetcat/ipsetcat.c:93:18:  [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.
    while ((ch = getopt_long(argc, argv, "hno:", longopts, NULL)) != -1) {
data/libcorkipset-1.1.1+20150311/src/ipsetdot/ipsetdot.c:75:18:  [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.
    while ((ch = getopt_long(argc, argv, "ho:", longopts, NULL)) != -1) {
data/libcorkipset-1.1.1+20150311/examples/ipv4-set-size.c:74:17:  [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).
    num_tests = atol(argv[1]);
data/libcorkipset-1.1.1+20150311/examples/ipv4-set-size.c:75:20:  [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).
    num_elements = atol(argv[2]);
data/libcorkipset-1.1.1+20150311/src/ipsetbuild/ipsetbuild.c:217: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).
            stream = fopen(filename, "rb");
data/libcorkipset-1.1.1+20150311/src/ipsetbuild/ipsetbuild.c:237:9:  [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  line[MAX_LINELENGTH];
data/libcorkipset-1.1.1+20150311/src/ipsetbuild/ipsetbuild.c:423:21:  [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  ip_buf[CORK_IP_STRING_LENGTH];
data/libcorkipset-1.1.1+20150311/src/ipsetbuild/ipsetbuild.c:441:21:  [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  ip_buf[CORK_IP_STRING_LENGTH];
data/libcorkipset-1.1.1+20150311/src/ipsetbuild/ipsetbuild.c:490:19:  [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).
        ostream = fopen(output_filename, "wb");
data/libcorkipset-1.1.1+20150311/src/ipsetcat/ipsetcat.c:145:18:  [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).
        stream = fopen(input_filename, "rb");
data/libcorkipset-1.1.1+20150311/src/ipsetcat/ipsetcat.c:180:19:  [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).
        ostream = fopen(output_filename, "wb");
data/libcorkipset-1.1.1+20150311/src/ipsetcat/ipsetcat.c:189: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  ip_buf[CORK_IP_STRING_LENGTH];
data/libcorkipset-1.1.1+20150311/src/ipsetdot/ipsetdot.c:123:18:  [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).
        stream = fopen(input_filename, "rb");
data/libcorkipset-1.1.1+20150311/src/ipsetdot/ipsetdot.c:160:19:  [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).
        ostream = fopen(output_filename, "wb");
data/libcorkipset-1.1.1+20150311/src/libipset/set/iterator.c:80: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  buf[CORK_IP_STRING_LENGTH];
data/libcorkipset-1.1.1+20150311/tests/test-bdd.c:59:15:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
    int  fd = mkstemp(temp_file->filename);
data/libcorkipset-1.1.1+20150311/tests/test-ipmap.c:58:15:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
    int  fd = mkstemp(temp_file->filename);
data/libcorkipset-1.1.1+20150311/tests/test-ipset.c:58:15:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
    int  fd = mkstemp(temp_file->filename);
data/libcorkipset-1.1.1+20150311/src/ipsetbuild/ipsetbuild.c:265: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).
            size_t  len = strlen(address);
data/libcorkipset-1.1.1+20150311/src/libipset/bdd/write.c:239:19:  [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_t  len = strlen(str);
data/libcorkipset-1.1.1+20150311/tests/test-bdd.c:648:30:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ipset_node_decref(cache, read);
data/libcorkipset-1.1.1+20150311/tests/test-bdd.c:719:30:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ipset_node_decref(cache, read);

ANALYSIS SUMMARY:

Hits = 36
Lines analyzed = 8105 in approximately 0.23 seconds (35712 lines/second)
Physical Source Lines of Code (SLOC) = 5247
Hits@level = [0]  62 [1]   4 [2]  16 [3]   5 [4]  11 [5]   0
Hits@level+ = [0+]  98 [1+]  36 [2+]  32 [3+]  16 [4+]  11 [5+]   0
Hits/KSLOC@level+ = [0+] 18.6773 [1+] 6.86106 [2+] 6.09872 [3+] 3.04936 [4+] 2.09644 [5+]   0
Dot directories skipped = 2 (--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.