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/dhcping-1.2/dhcp_options.h Examining data/dhcping-1.2/dhcping.c FINAL RESULTS: data/dhcping-1.2/dhcping.c:84:18: [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 ((ch = getopt(argc,argv,"c:g:h:iqrs:t:vV"))>0) { data/dhcping-1.2/dhcping.c:49: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(pktbuf+offset,msgbuf,size); data/dhcping-1.2/dhcping.c:69:10: [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 serveridentifier[4]; data/dhcping-1.2/dhcping.c:93:20: [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). case 't': maxwait=atoi(optarg);break; data/dhcping-1.2/dhcping.c:189:5: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy(hostent->h_addr,&dhcp_to.sin_addr.s_addr,hostent->h_length); data/dhcping-1.2/dhcping.c:239:14: [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 msgbuf[BUF_SIZ]; data/dhcping-1.2/dhcping.c:240:14: [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 pktbuf[BUF_SIZ]; data/dhcping-1.2/dhcping.c:256: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(msgbuf,"\1\1%c%c",hwcount,0); data/dhcping-1.2/dhcping.c:264: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(msgbuf,&l,4); data/dhcping-1.2/dhcping.c:276: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(msgbuf,"%c%c%c%c",ip[0],ip[1],ip[2],ip[3]); data/dhcping-1.2/dhcping.c:288: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(msgbuf,"%c%c%c%c",gw[0],gw[1],gw[2],gw[3]); data/dhcping-1.2/dhcping.c:292: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(msgbuf,"%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", data/dhcping-1.2/dhcping.c:308:2: [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(msgbuf,"%c%c%c%c",99,130,83,99); data/dhcping-1.2/dhcping.c:312:2: [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(msgbuf,"%c%c%c",53,1,type); data/dhcping-1.2/dhcping.c:319:3: [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(msgbuf,"%c%c%c%c%c%c",50,4,ip50[0],ip50[1],ip50[2],ip50[3]); data/dhcping-1.2/dhcping.c:325:3: [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(msgbuf,"%c%c%c%c%c%c",54,4, data/dhcping-1.2/dhcping.c:339:6: [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(msgbuf,"%c%c%c",55,1,1); data/dhcping-1.2/dhcping.c:344:2: [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(msgbuf,"%c",255); data/dhcping-1.2/dhcping.c:357:14: [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 msgbuf[BUF_SIZ]; data/dhcping-1.2/dhcping.c:462:6: [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(serveridentifier,buffer+j+2,4); data/dhcping-1.2/dhcping.c:109:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). fd_set read; data/dhcping-1.2/dhcping.c:140:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). FD_ZERO(&read); data/dhcping-1.2/dhcping.c:141:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). FD_SET(dhcp_socket,&read); data/dhcping-1.2/dhcping.c:144:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(select(dhcp_socket+1,&read,NULL,NULL,&timeout)<0) { data/dhcping-1.2/dhcping.c:148:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (FD_ISSET(dhcp_socket,&read)) { ANALYSIS SUMMARY: Hits = 25 Lines analyzed = 762 in approximately 0.06 seconds (12764 lines/second) Physical Source Lines of Code (SLOC) = 608 Hits@level = [0] 37 [1] 5 [2] 19 [3] 1 [4] 0 [5] 0 Hits@level+ = [0+] 62 [1+] 25 [2+] 20 [3+] 1 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 101.974 [1+] 41.1184 [2+] 32.8947 [3+] 1.64474 [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.