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/bootp-2.4.3/bootptest.h Examining data/bootp-2.4.3/getif.c Examining data/bootp-2.4.3/getif.h Examining data/bootp-2.4.3/hash.c Examining data/bootp-2.4.3/hash.h Examining data/bootp-2.4.3/hwaddr.h Examining data/bootp-2.4.3/patchlevel.h Examining data/bootp-2.4.3/readfile.h Examining data/bootp-2.4.3/report.h Examining data/bootp-2.4.3/strerror.c Examining data/bootp-2.4.3/syslog.h Examining data/bootp-2.4.3/trygetea.c Examining data/bootp-2.4.3/trygetif.c Examining data/bootp-2.4.3/trylook.c Examining data/bootp-2.4.3/getether.h Examining data/bootp-2.4.3/bootpef.c Examining data/bootp-2.4.3/report.c Examining data/bootp-2.4.3/tzone.c Examining data/bootp-2.4.3/dovend.c Examining data/bootp-2.4.3/bootp.h Examining data/bootp-2.4.3/bootpd.c Examining data/bootp-2.4.3/lookup.h Examining data/bootp-2.4.3/print-bootp.c Examining data/bootp-2.4.3/bootpd.h Examining data/bootp-2.4.3/bptypes.h Examining data/bootp-2.4.3/getether.c Examining data/bootp-2.4.3/tzone.h Examining data/bootp-2.4.3/readfile.c Examining data/bootp-2.4.3/lookup.c Examining data/bootp-2.4.3/hwaddr.c Examining data/bootp-2.4.3/bootptest.c Examining data/bootp-2.4.3/bootpgw.c Examining data/bootp-2.4.3/dumptab.c Examining data/bootp-2.4.3/dovend.h FINAL RESULTS: data/bootp-2.4.3/bootpd.c:718:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(bp->bp_sname, hostname); data/bootp-2.4.3/bootpd.c:841:3: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. system(tst); /* Hope this finishes soon... */ data/bootp-2.4.3/bootpd.c:912:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(realpath, hp->tftpdir->string); data/bootp-2.4.3/bootpd.c:961:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(clntpath, homedir); data/bootp-2.4.3/bootpd.c:970:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(clntpath, bootfile); data/bootp-2.4.3/bootpd.c:985:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(clntpath, hp->hostname->string); data/bootp-2.4.3/bootpd.c:1144:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy( myreq.ifr_name, ifr->ifr_name ); data/bootp-2.4.3/bootpd.c:1277:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(vendp->v_magic, (char *)vm_cmu); data/bootp-2.4.3/getether.c:45:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(phys.ifr_name, ifname); data/bootp-2.4.3/getether.c:195:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(devname, "/dev/%s", ifname); data/bootp-2.4.3/getether.c:345:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(phys.ifr_name, ifname); data/bootp-2.4.3/hwaddr.c:188:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "arp -d %s; arp -s %s %s temp", data/bootp-2.4.3/hwaddr.c:192:11: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. status = system(buf); data/bootp-2.4.3/readfile.c:350:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(timestr, ctime(&(st.st_mtime))); data/bootp-2.4.3/readfile.c:1243:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(s->string, retstring); data/bootp-2.4.3/report.c:116:2: [4] (format) vsnprintf: 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. vsnprintf(buf, sizeof(buf), fmt, ap); data/bootp-2.4.3/bootpd.c:693:7: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. char realpath[1024]; data/bootp-2.4.3/bootpd.c:910:19: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if(lpos>=sizeof(realpath)-1) data/bootp-2.4.3/bootpd.c:912:10: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. strcpy(realpath, hp->tftpdir->string); data/bootp-2.4.3/bootpd.c:913:15: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. clntpath = &realpath[lpos]; data/bootp-2.4.3/bootpd.c:915:3: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. realpath[0] = '\0'; data/bootp-2.4.3/bootpd.c:916:14: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. clntpath = realpath; data/bootp-2.4.3/bootpd.c:959:19: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if(lpos>=sizeof(realpath)) data/bootp-2.4.3/bootpd.c:968:19: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if(lpos>=sizeof(realpath)) data/bootp-2.4.3/bootpd.c:982:45: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if(n+1+strlen(hp->hostname->string)<sizeof(realpath)) data/bootp-2.4.3/bootpd.c:987:17: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (chk_access(realpath, &bootsize) < 0) { data/bootp-2.4.3/bootpd.c:989:18: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (chk_access(realpath, &bootsize) < 0) { data/bootp-2.4.3/bootp.h:54: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 bp_chaddr[BP_CHADDR_LEN]; /* client hardware address */ data/bootp-2.4.3/bootp.h:55: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 bp_sname[BP_SNAME_LEN]; /* server host name */ data/bootp-2.4.3/bootp.h:56: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 bp_file[BP_FILE_LEN]; /* boot file name */ data/bootp-2.4.3/bootp.h:57: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 bp_vend[BP_VEND_LEN]; /* vendor-specific area */ data/bootp-2.4.3/bootp.h:143: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 v_magic[4]; /* magic number */ data/bootp-2.4.3/bootpd.c:76:10: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. # define bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/bootpd.c:76:26: [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 bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/bootpd.c:424:2: [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(hep->h_addr, (char *)&my_ip_addr, sizeof(my_ip_addr)); data/bootp-2.4.3/bootpd.c:441:8: [2] (misc) open: 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). n = open("/dev/tty", O_RDWR); data/bootp-2.4.3/bootpd.c:693: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 realpath[1024]; data/bootp-2.4.3/bootpd.c:750:3: [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(bp->bp_chaddr, dummyhost.haddr, hlen); data/bootp-2.4.3/bootpd.c:835: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 tst[100]; data/bootp-2.4.3/bootpd.c:1048:3: [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(hp->vm_cookie, bp->bp_vend, 4); data/bootp-2.4.3/bootpd.c:1384:7: [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(p, (char*)&msgsz, 2); data/bootp-2.4.3/bootpd.c:1433:2: [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(vm_rfc1048, vp, 4); data/bootp-2.4.3/bootpd.c:1472:3: [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(hp->exten_file->string, vp, len); data/bootp-2.4.3/bootpd.h:79: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 string[1]; /* Dynamically extended */ data/bootp-2.4.3/bootpef.c:62:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/bootpef.c:62:25: [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 bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/bootpef.c:296:2: [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(vm_rfc1048, vp, 4); /* Copy in the magic cookie */ data/bootp-2.4.3/bootpef.c:318:12: [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). if ((fp = fopen(hp->exten_file->string, "w")) == NULL) { data/bootp-2.4.3/bootpgw.c:68:10: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. # define bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/bootpgw.c:68:26: [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 bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/bootpgw.c:243:2: [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(hep->h_addr, (char *)&my_ip_addr, sizeof(my_ip_addr)); data/bootp-2.4.3/bootpgw.c:372:3: [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(hep->h_addr, (char *)&server_ipa, sizeof(server_ipa)); data/bootp-2.4.3/bootpgw.c:386:8: [2] (misc) open: 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). n = open("/dev/tty", O_RDWR); data/bootp-2.4.3/bootptest.c:123: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 vm_cmu[4] = VM_CMU; data/bootp-2.4.3/bootptest.c:124: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 vm_rfc1048[4] = VM_RFC1048; data/bootp-2.4.3/bootptest.c:190:2: [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(vm_rfc1048, (char*)&vend_magic, 4); data/bootp-2.4.3/bootptest.c:274:4: [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(hep->h_addr, &server_addr, sizeof(server_addr)); data/bootp-2.4.3/bootptest.c:342:3: [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(eaddr, bp->bp_chaddr, bp->bp_hlen); data/bootp-2.4.3/bootptest.c:350:3: [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(hep->h_addr, &bp->bp_ciaddr, hep->h_length); data/bootp-2.4.3/bootptest.c:356:2: [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((char*)&vend_magic, bp->bp_vend, 4); data/bootp-2.4.3/bootptest.c:366:12: [2] (misc) open: 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). int fd = open(vendor_file, 0); data/bootp-2.4.3/bootptest.c:513: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 b[24]; data/bootp-2.4.3/bootptest.c:517: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(b, "%d.%d.%d.%d", p[0], p[1], p[2], p[3]); data/bootp-2.4.3/bootptest.h:11:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/bootptest.h:11:25: [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 bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/dovend.c:19:10: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. # define bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/dovend.c:19:26: [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 bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/dovend.c:108:3: [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(hp->root_path->string, vp, len); data/bootp-2.4.3/dovend.c:121:3: [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(hp->dump_file->string, vp, len); data/bootp-2.4.3/dovend.c:143:3: [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(hp->domain_name->string, vp, len); data/bootp-2.4.3/dovend.c:165:3: [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(hp->nis_domain->string, vp, len); data/bootp-2.4.3/dovend.c:237:3: [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(hp->hostname->string, vp, len); data/bootp-2.4.3/dovend.c:364: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(srcptr, *buff, numbytes); data/bootp-2.4.3/dumptab.c:19:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/dumptab.c:19:25: [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 bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/dumptab.c:108:7: [2] (misc) open: 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). fd = open(filename, O_WRONLY | O_CREAT | O_EXCL, 0600); data/bootp-2.4.3/getether.c:53:3: [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(&phys.current_pa[0], eap, EALEN); data/bootp-2.4.3/getether.c:83:8: [2] (misc) open: 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). nit = open("/dev/nit", 0); data/bootp-2.4.3/getether.c:98:3: [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(&ifrnit.ifr_addr.sa_data[0], eap, EALEN); data/bootp-2.4.3/getether.c:147:4: [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(LLADDR((struct sockaddr_dl *) &ifrp->ifr_addr), eap, EALEN); data/bootp-2.4.3/getether.c:187: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 devname[32]; data/bootp-2.4.3/getether.c:188: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 tmpbuf[sizeof(union DL_primitives) + 16]; data/bootp-2.4.3/getether.c:196:7: [2] (misc) open: 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). fd = open(devname, 2); data/bootp-2.4.3/getether.c:206:8: [2] (misc) open: 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). fd = open(devname, 2); data/bootp-2.4.3/getether.c:306: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(eap, enaddr, EALEN); data/bootp-2.4.3/getether.c:353: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(eap, &phys.ifr_hwaddr.sa_data, EALEN); data/bootp-2.4.3/hash.c:41:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/hash.c:41:25: [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 bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/hwaddr.c:42:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/hwaddr.c:42:25: [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 bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/hwaddr.c:106:2: [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(haddr, arpreq.at_enaddr, halen); data/bootp-2.4.3/hwaddr.c:137:2: [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(haddr, p, halen); data/bootp-2.4.3/hwaddr.c:153:11: [2] (misc) open: 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). if ((fd=open("/dev/arp", O_RDWR)) < 0) { data/bootp-2.4.3/hwaddr.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[256]; data/bootp-2.4.3/hwaddr.c:208: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 haddrbuf[3 * MAXHADDRLEN + 1]; data/bootp-2.4.3/hwaddr.c:216: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(bufptr, "%02X:", (unsigned) (*haddr++ & 0xFF)); data/bootp-2.4.3/lookup.c:29:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/lookup.c:29:25: [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 bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/lookup.c:85:2: [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(hp->h_addr, result, sizeof(*result)); data/bootp-2.4.3/print-bootp.c:62:18: [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 unsigned char vm_cmu[4] = VM_CMU; data/bootp-2.4.3/print-bootp.c:63:18: [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 unsigned char vm_rfc1048[4] = VM_RFC1048; data/bootp-2.4.3/print-bootp.c:334: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((char *) bp, (char *) &us, 2); data/bootp-2.4.3/print-bootp.c:345: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((char *) bp, (char *) &ul, 4); data/bootp-2.4.3/print-bootp.c:356: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((char *) bp, (char *) &ia, 4); data/bootp-2.4.3/readfile.c:49:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/readfile.c:49:22: [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 bcopy(a,b,c) memcpy(b,a,c) data/bootp-2.4.3/readfile.c:154: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. PRIVATE char current_tagname[8]; data/bootp-2.4.3/readfile.c:337: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 buffer[MAXENTRYLEN]; data/bootp-2.4.3/readfile.c:349: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 timestr[28]; data/bootp-2.4.3/readfile.c:373:12: [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). if ((fp = fopen(bootptab, "r")) == NULL) { data/bootp-2.4.3/readfile.c:800: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 tmpstr[MAXSTRINGLEN]; data/bootp-2.4.3/readfile.c:825: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(current_tagname, "T%d", (int)value); data/bootp-2.4.3/readfile.c:911:4: [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(tmphaddr, hp->haddr, haddrlength(hp->htype)); data/bootp-2.4.3/readfile.c:1010:6: [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(vm_rfc1048, hp->vm_cookie, 4); data/bootp-2.4.3/readfile.c:1012:6: [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(vm_cmu, hp->vm_cookie, 4); data/bootp-2.4.3/readfile.c:1018:6: [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(&value, hp->vm_cookie, 4); data/bootp-2.4.3/readfile.c:1233: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 retstring[MAXSTRINGLEN]; data/bootp-2.4.3/readfile.c:1303:3: [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((*dest)->data, bdata->data, oldlength); data/bootp-2.4.3/readfile.c:1305:2: [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(tmpbuf, bdata->data + oldlength, newlength + 2); data/bootp-2.4.3/readfile.c:1456: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 tstring[MAXSTRINGLEN]; data/bootp-2.4.3/readfile.c:1488:4: [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(hp2->vm_cookie, hp->vm_cookie, 4); data/bootp-2.4.3/readfile.c:1691: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 tmpstr[MAXSTRINGLEN]; data/bootp-2.4.3/readfile.c:1793: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 tmpstr[MAXSTRINGLEN]; data/bootp-2.4.3/report.c:106: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[256]; data/bootp-2.4.3/strerror.c:10:8: [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 errmsg[80]; data/bootp-2.4.3/strerror.c:19: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(errmsg, "Error %d", en); data/bootp-2.4.3/bootpd.c:706:6: [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 (strlen(bp->bp_sname)) { data/bootp-2.4.3/bootpd.c:909:8: [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). lpos=strlen(hp->tftpdir->string); data/bootp-2.4.3/bootpd.c:957:4: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(clntpath, "/"); data/bootp-2.4.3/bootpd.c:958:9: [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). lpos+=strlen(homedir); data/bootp-2.4.3/bootpd.c:966:4: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(clntpath, "/"); data/bootp-2.4.3/bootpd.c:967:9: [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). lpos+=strlen(bootfile); data/bootp-2.4.3/bootpd.c:977:6: [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). n = strlen(clntpath); data/bootp-2.4.3/bootpd.c:982:9: [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(n+1+strlen(hp->hostname->string)<sizeof(realpath)) data/bootp-2.4.3/bootpd.c:984:3: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(clntpath, "."); data/bootp-2.4.3/bootpd.c:1021:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(bp->bp_file, clntpath, BP_FILE_LEN); data/bootp-2.4.3/bootpd.c:1468:9: [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(hp->exten_file->string); data/bootp-2.4.3/bootpef.c:247:11: [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). tlen = strlen(argv[0]); data/bootp-2.4.3/bootptest.c:322:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(bp->bp_file, bp_file, BP_FILE_LEN); data/bootp-2.4.3/bootptest.c:373:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, bp->bp_vend, n); data/bootp-2.4.3/dovend.c:104:9: [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(hp->root_path->string); data/bootp-2.4.3/dovend.c:117:9: [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(hp->dump_file->string); data/bootp-2.4.3/dovend.c:139:9: [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(hp->domain_name->string); data/bootp-2.4.3/dovend.c:161:9: [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(hp->nis_domain->string); data/bootp-2.4.3/dovend.c:215:9: [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(hp->hostname->string); data/bootp-2.4.3/getether.c:81:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(&ifrnit.ifr_name[0], ifname, IFNAMSIZ); data/bootp-2.4.3/readfile.c:470:11: [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). strlen(hp->hostname->string)); data/bootp-2.4.3/readfile.c:526:6: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = fgetc(fp); data/bootp-2.4.3/readfile.c:535:8: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = fgetc(fp); data/bootp-2.4.3/readfile.c:554:6: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = fgetc(fp); data/bootp-2.4.3/readfile.c:560:7: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = fgetc(fp); /* Backslash, read a new character */ data/bootp-2.4.3/readfile.c:578:8: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = fgetc(fp); data/bootp-2.4.3/readfile.c:591:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((c = fgetc(fp)) < 0) { /* Backslash */ data/bootp-2.4.3/readfile.c:609:8: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = fgetc(fp); data/bootp-2.4.3/readfile.c:616:8: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = fgetc(fp); ANALYSIS SUMMARY: Hits = 155 Lines analyzed = 9254 in approximately 0.29 seconds (32205 lines/second) Physical Source Lines of Code (SLOC) = 5926 Hits@level = [0] 199 [1] 29 [2] 99 [3] 11 [4] 16 [5] 0 Hits@level+ = [0+] 354 [1+] 155 [2+] 126 [3+] 27 [4+] 16 [5+] 0 Hits/KSLOC@level+ = [0+] 59.7368 [1+] 26.1559 [2+] 21.2622 [3+] 4.55619 [4+] 2.69997 [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.