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/libmnl-1.0.4/examples/netfilter/nf-queue.c Examining data/libmnl-1.0.4/examples/netfilter/nfct-create-batch.c Examining data/libmnl-1.0.4/examples/netfilter/nf-log.c Examining data/libmnl-1.0.4/examples/netfilter/nfct-daemon.c Examining data/libmnl-1.0.4/examples/netfilter/nfct-event.c Examining data/libmnl-1.0.4/examples/netfilter/nfct-dump.c Examining data/libmnl-1.0.4/examples/genl/genl-group-events.c Examining data/libmnl-1.0.4/examples/genl/genl-family-get.c Examining data/libmnl-1.0.4/examples/rtnl/rtnl-link-event.c Examining data/libmnl-1.0.4/examples/rtnl/rtnl-route-add.c Examining data/libmnl-1.0.4/examples/rtnl/rtnl-link-dump3.c Examining data/libmnl-1.0.4/examples/rtnl/rtnl-addr-dump.c Examining data/libmnl-1.0.4/examples/rtnl/rtnl-link-dump2.c Examining data/libmnl-1.0.4/examples/rtnl/rtnl-route-dump.c Examining data/libmnl-1.0.4/examples/rtnl/rtnl-link-dump.c Examining data/libmnl-1.0.4/examples/rtnl/rtnl-route-event.c Examining data/libmnl-1.0.4/examples/rtnl/rtnl-link-set.c Examining data/libmnl-1.0.4/examples/kobject/kobject-event.c Examining data/libmnl-1.0.4/src/internal.h Examining data/libmnl-1.0.4/src/attr.c Examining data/libmnl-1.0.4/src/nlmsg.c Examining data/libmnl-1.0.4/src/callback.c Examining data/libmnl-1.0.4/src/socket.c Examining data/libmnl-1.0.4/include/libmnl/libmnl.h Examining data/libmnl-1.0.4/include/linux/netfilter/nfnetlink_conntrack.h Examining data/libmnl-1.0.4/include/linux/netlink.h Examining data/libmnl-1.0.4/include/linux/socket.h FINAL RESULTS: data/libmnl-1.0.4/examples/genl/genl-family-get.c:183: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 buf[MNL_SOCKET_BUFFER_SIZE]; data/libmnl-1.0.4/examples/genl/genl-group-events.c:22: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 buf[MNL_SOCKET_BUFFER_SIZE]; data/libmnl-1.0.4/examples/genl/genl-group-events.c:29: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). group = atoi(argv[1]); data/libmnl-1.0.4/examples/kobject/kobject-event.c:13: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 buf[MNL_SOCKET_BUFFER_SIZE]; data/libmnl-1.0.4/examples/netfilter/nf-log.c:146: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 buf[MNL_SOCKET_BUFFER_SIZE]; data/libmnl-1.0.4/examples/netfilter/nf-log.c:155:9: [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). qnum = atoi(argv[1]); data/libmnl-1.0.4/examples/netfilter/nf-queue.c:161: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 buf[MNL_SOCKET_BUFFER_SIZE]; data/libmnl-1.0.4/examples/netfilter/nf-queue.c:170:14: [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). queue_num = atoi(argv[1]); data/libmnl-1.0.4/examples/netfilter/nfct-create-batch.c:86: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 rcv_buf[MNL_SOCKET_BUFFER_SIZE]; data/libmnl-1.0.4/examples/netfilter/nfct-create-batch.c:136: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 snd_buf[MNL_SOCKET_BUFFER_SIZE*2]; data/libmnl-1.0.4/examples/netfilter/nfct-daemon.c:211: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 buf[MNL_SOCKET_BUFFER_SIZE]; data/libmnl-1.0.4/examples/netfilter/nfct-daemon.c:243: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 buf[MNL_SOCKET_BUFFER_SIZE]; data/libmnl-1.0.4/examples/netfilter/nfct-daemon.c:254:9: [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). secs = atoi(argv[1]); data/libmnl-1.0.4/examples/netfilter/nfct-daemon.c:332: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 out[INET6_ADDRSTRLEN]; data/libmnl-1.0.4/examples/netfilter/nfct-dump.c:94: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 out[INET6_ADDRSTRLEN]; data/libmnl-1.0.4/examples/netfilter/nfct-dump.c:101: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 out[INET6_ADDRSTRLEN]; data/libmnl-1.0.4/examples/netfilter/nfct-dump.c:267: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 buf[MNL_SOCKET_BUFFER_SIZE]; data/libmnl-1.0.4/examples/netfilter/nfct-event.c:206: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 buf[MNL_SOCKET_BUFFER_SIZE]; data/libmnl-1.0.4/examples/rtnl/rtnl-addr-dump.c:46: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 out[INET6_ADDRSTRLEN]; data/libmnl-1.0.4/examples/rtnl/rtnl-addr-dump.c:80: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 buf[MNL_SOCKET_BUFFER_SIZE]; data/libmnl-1.0.4/examples/rtnl/rtnl-link-dump.c:85: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 buf[MNL_SOCKET_BUFFER_SIZE]; data/libmnl-1.0.4/examples/rtnl/rtnl-link-dump2.c:58: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 buf[MNL_SOCKET_BUFFER_SIZE]; data/libmnl-1.0.4/examples/rtnl/rtnl-link-dump3.c:58: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 buf[MNL_SOCKET_BUFFER_SIZE]; data/libmnl-1.0.4/examples/rtnl/rtnl-link-event.c:66: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 buf[MNL_SOCKET_BUFFER_SIZE]; data/libmnl-1.0.4/examples/rtnl/rtnl-link-set.c:16: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 buf[MNL_SOCKET_BUFFER_SIZE]; data/libmnl-1.0.4/examples/rtnl/rtnl-route-add.c:18: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 buf[MNL_SOCKET_BUFFER_SIZE]; data/libmnl-1.0.4/examples/rtnl/rtnl-route-dump.c:79: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. static char buf[INET6_ADDRSTRLEN]; data/libmnl-1.0.4/examples/rtnl/rtnl-route-dump.c:302: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 buf[MNL_SOCKET_BUFFER_SIZE]; data/libmnl-1.0.4/examples/rtnl/rtnl-route-event.c:79: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. static char buf[INET6_ADDRSTRLEN]; data/libmnl-1.0.4/examples/rtnl/rtnl-route-event.c:311: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 buf[MNL_SOCKET_BUFFER_SIZE]; data/libmnl-1.0.4/include/linux/socket.h:16: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 __data[_K_SS_MAXSIZE - sizeof(unsigned short)]; data/libmnl-1.0.4/src/attr.c:418:2: [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(mnl_attr_get_payload(attr), data, len); data/libmnl-1.0.4/src/nlmsg.c:504: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(b->buf, b->cur, nlh->nlmsg_len); data/libmnl-1.0.4/examples/rtnl/rtnl-link-set.c:27:33: [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 (strncasecmp(argv[2], "up", strlen("up")) == 0) { data/libmnl-1.0.4/examples/rtnl/rtnl-link-set.c:30:42: [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). } else if (strncasecmp(argv[2], "down", strlen("down")) == 0) { data/libmnl-1.0.4/src/attr.c:494: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). mnl_attr_put(nlh, type, strlen(data), data); data/libmnl-1.0.4/src/attr.c:512: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). mnl_attr_put(nlh, type, strlen(data)+1, data); data/libmnl-1.0.4/src/attr.c:665:47: [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). return mnl_attr_put_check(nlh, buflen, type, strlen(data), data); data/libmnl-1.0.4/src/attr.c:688:47: [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). return mnl_attr_put_check(nlh, buflen, type, strlen(data)+1, data); ANALYSIS SUMMARY: Hits = 39 Lines analyzed = 5867 in approximately 0.19 seconds (31128 lines/second) Physical Source Lines of Code (SLOC) = 3958 Hits@level = [0] 182 [1] 6 [2] 33 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 221 [1+] 39 [2+] 33 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 55.8363 [1+] 9.85346 [2+] 8.33754 [3+] 0 [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.