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/bing-1.3.5/include/netinet/ip_icmp.h Examining data/bing-1.3.5/include/netinet/ip.h Examining data/bing-1.3.5/include/netinet/ip_var.h Examining data/bing-1.3.5/bing.c Examining data/bing-1.3.5/bing_defs.h Examining data/bing-1.3.5/bing_misc.c Examining data/bing-1.3.5/bing_misc.h Examining data/bing-1.3.5/bing_probes.c Examining data/bing-1.3.5/bing_probes.h Examining data/bing-1.3.5/bing_stats.c Examining data/bing-1.3.5/bing_stats.h Examining data/bing-1.3.5/icmp_dummy.c Examining data/bing-1.3.5/lin_reg.c Examining data/bing-1.3.5/lin_reg.h Examining data/bing-1.3.5/mod_icmp.h Examining data/bing-1.3.5/unix/icmp_ux.c Examining data/bing-1.3.5/win32/getopt.c Examining data/bing-1.3.5/win32/getopt.h Examining data/bing-1.3.5/win32/icmp2.c Examining data/bing-1.3.5/win32/icmp_win32.c Examining data/bing-1.3.5/win32/types.h Examining data/bing-1.3.5/win32/win32.h FINAL RESULTS: data/bing-1.3.5/bing_defs.h:28:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf sprintf data/bing-1.3.5/bing_defs.h:28:18: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. #define snprintf sprintf data/bing-1.3.5/bing_defs.h:32:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf _snprintf data/bing-1.3.5/bing_defs.h:32:18: [4] (format) _snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf _snprintf data/bing-1.3.5/bing_defs.h:46: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 a; \ data/bing-1.3.5/bing_misc.c:208:17: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(snfargs(host_string,sizeof(host_string),"%s/%s"), data/bing-1.3.5/bing_misc.c:211:17: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(snfargs(host_string,sizeof(host_string),"<unknown>/%s"), data/bing-1.3.5/bing.c:266:19: [3] (buffer) getopt: 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 ((opt = getopt(argc, argv, "knp:s:S:t:u:U:z")) != EOF) { data/bing-1.3.5/bing_probes.c:33:9: [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. #define random rand data/bing-1.3.5/bing_probes.c:34:9: [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. #define srandom srand data/bing-1.3.5/bing_probes.c:34:25: [3] (random) srand: 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. #define srandom srand data/bing-1.3.5/bing_probes.c:275:48: [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. packet_data[i]=(unsigned char)(random() & 0xff); data/bing-1.3.5/win32/getopt.c:191:7: [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. char *getenv (); data/bing-1.3.5/win32/getopt.c:359:16: [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. else if (getenv ("POSIXLY_CORRECT") != NULL) data/bing-1.3.5/win32/getopt.c:658:1: [3] (buffer) getopt: 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. getopt (argc, argv, optstring) data/bing-1.3.5/win32/getopt.c:688:11: [3] (buffer) getopt: 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 (argc, argv, "abc:d:0123456789"); data/bing-1.3.5/win32/getopt.h:102:12: [3] (buffer) getopt: 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. extern int getopt (int argc, char *const *argv, const char *shortopts); data/bing-1.3.5/win32/getopt.h:104:12: [3] (buffer) getopt: 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. extern int getopt (); data/bing-1.3.5/win32/getopt.h:106:12: [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. extern int getopt_long (int argc, char *const *argv, const char *shortopts, data/bing-1.3.5/win32/getopt.h:118:12: [3] (buffer) getopt: 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. extern int getopt (); data/bing-1.3.5/win32/getopt.h:119:12: [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. extern int getopt_long (); data/bing-1.3.5/bing.c:395: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 subpattern[3]; data/bing-1.3.5/bing_misc.c:181:13: [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(&SOCKADDR_IN(host_addr)->sin_addr, he->h_addr, sizeof(SOCKADDR_IN(host_addr)->sin_addr)); data/bing-1.3.5/bing_misc.c:187:9: [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(&SOCKADDR_IN(host_addr)->sin_addr,&addr,sizeof(SOCKADDR_IN(host_addr)->sin_addr)); data/bing-1.3.5/bing_misc.c:194: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. static char host_string[15+1+1+64+1+1]; data/bing-1.3.5/bing_misc.h:31:33: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define addrcpy(dst,src) memcpy(dst,src,sizeof(struct sockaddr)) data/bing-1.3.5/bing_probes.c:259:17: [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(packet_data+i,state->pattern, data/bing-1.3.5/bing_probes.c:370:9: [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(state->pattern,(char*)optval,state->pattern_size); data/bing-1.3.5/bing_probes.c:472:17: [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(&((struct sockaddr_in*)(&probe->dst_addr))->sin_addr,&ip->ip_dst,4); data/bing-1.3.5/include/netinet/ip_icmp.h:85: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 id_data[1]; data/bing-1.3.5/include/netinet/ip_var.h:105: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 ipopt_list[MAX_IPOPTLEN]; /* options proper */ data/bing-1.3.5/win32/getopt.c:185:31: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define my_bcopy(src, dst, n) memcpy ((dst), (src), (n)) data/bing-1.3.5/win32/icmp2.c:170: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(&(((struct sockaddr_in*)from_addr)->sin_addr),&handle2state(handle)->current->Address,4); data/bing-1.3.5/win32/icmp2.c:187: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(&(ip_msg->ip_src),&handle2state(handle)->current->Address,4); data/bing-1.3.5/win32/icmp2.c:190:4: [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(buffer+sizeof(struct ip), data/bing-1.3.5/win32/icmp2.c:256: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(buffer+((ip_msg->ip_hl) << 2)+ICMP_MINLEN, data/bing-1.3.5/win32/icmp_win32.c:119:17: [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(state->ip_options.OptionsData,(char*)optval,state->ip_options.OptionsSize); data/bing-1.3.5/win32/icmp_win32.c:241:5: [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(&(((struct sockaddr_in*)from_addr)->sin_addr),&state->current->Address,4); data/bing-1.3.5/win32/icmp_win32.c:260:5: [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(&(ip_msg->ip_src),&state->current->Address,4); data/bing-1.3.5/win32/icmp_win32.c:263:9: [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(buffer+sizeof(struct ip), data/bing-1.3.5/win32/icmp_win32.c:335:5: [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(buffer+ip_header_len+ICMP_MINLEN, data/bing-1.3.5/bing.c:399:13: [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). len=strlen(opt_p); data/bing-1.3.5/bing_misc.c:201:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(host_string,ip_str,sizeof(host_string)); data/bing-1.3.5/win32/getopt.c:467: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). if (s - nextchar == strlen (p->name)) data/bing-1.3.5/win32/getopt.c:491:16: [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). nextchar += strlen (nextchar); data/bing-1.3.5/win32/getopt.c:521:17: [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). nextchar += strlen (nextchar); data/bing-1.3.5/win32/getopt.c:534:17: [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). nextchar += strlen (nextchar); data/bing-1.3.5/win32/getopt.c:538:16: [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). nextchar += strlen (nextchar); ANALYSIS SUMMARY: Hits = 48 Lines analyzed = 6309 in approximately 0.20 seconds (32145 lines/second) Physical Source Lines of Code (SLOC) = 3777 Hits@level = [0] 175 [1] 7 [2] 20 [3] 14 [4] 7 [5] 0 Hits@level+ = [0+] 223 [1+] 48 [2+] 41 [3+] 21 [4+] 7 [5+] 0 Hits/KSLOC@level+ = [0+] 59.0416 [1+] 12.7085 [2+] 10.8552 [3+] 5.55997 [4+] 1.85332 [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.