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/gr-hpsdr-2.0/include/hpsdr/api.h Examining data/gr-hpsdr-2.0/include/hpsdr/hermesNB.h Examining data/gr-hpsdr-2.0/include/hpsdr/hermesWB.h Examining data/gr-hpsdr-2.0/lib/HermesProxy.cc Examining data/gr-hpsdr-2.0/lib/HermesProxy.h Examining data/gr-hpsdr-2.0/lib/HermesProxyW.cc Examining data/gr-hpsdr-2.0/lib/HermesProxyW.h Examining data/gr-hpsdr-2.0/lib/hermesNB_impl.cc Examining data/gr-hpsdr-2.0/lib/hermesNB_impl.h Examining data/gr-hpsdr-2.0/lib/hermesWB_impl.cc Examining data/gr-hpsdr-2.0/lib/hermesWB_impl.h Examining data/gr-hpsdr-2.0/lib/metis.cc Examining data/gr-hpsdr-2.0/lib/metis.h FINAL RESULTS: data/gr-hpsdr-2.0/lib/HermesProxy.cc:164: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(interface, Intfc); // Ethernet interface to use (defaults to eth0) data/gr-hpsdr-2.0/lib/HermesProxyW.cc:50: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(interface, Intfc); // Ethernet interface to use (defaults to eth0) data/gr-hpsdr-2.0/lib/HermesProxy.cc:860:11: [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 buffer[512]; // dummy up a USB HPSDR buffer; data/gr-hpsdr-2.0/lib/HermesProxy.h:135: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 interface[16]; data/gr-hpsdr-2.0/lib/HermesProxy.h:137: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 mactarget[18]; // Requested target's MAC address as string data/gr-hpsdr-2.0/lib/HermesProxyW.cc:387:11: [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 buffer[512]; // dummy up a USB HPSDR buffer; data/gr-hpsdr-2.0/lib/HermesProxyW.h:110: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 interface[16]; data/gr-hpsdr-2.0/lib/HermesProxyW.h:112: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 mactarget[18]; // Requested target's MAC address as string data/gr-hpsdr-2.0/lib/hermesWB_impl.cc:165: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(out, ReadBuf, 256*sizeof(float)); data/gr-hpsdr-2.0/lib/metis.cc:89:17: [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 hw_address[6]; data/gr-hpsdr-2.0/lib/metis.cc:97:17: [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 buffer[70]; data/gr-hpsdr-2.0/lib/metis.cc:125: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 buf[8192]; data/gr-hpsdr-2.0/lib/metis.cc:300: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((char *)&data_addr.sin_addr.s_addr,h->h_addr_list[0],h->h_length); data/gr-hpsdr-2.0/lib/metis.cc:323: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 buffer[2048]; data/gr-hpsdr-2.0/lib/metis.cc:378:29: [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(metis_cards[found].mac_address,"%02X:%02X:%02X:%02X:%02X:%02X", data/gr-hpsdr-2.0/lib/metis.cc:384:29: [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(metis_cards[found].ip_address,"%d.%d.%d.%d", data/gr-hpsdr-2.0/lib/metis.cc:409:17: [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 output_buffer[1032]; data/gr-hpsdr-2.0/lib/metis.h:17: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_address[16]; data/gr-hpsdr-2.0/lib/metis.h:18: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 mac_address[18]; data/gr-hpsdr-2.0/lib/HermesProxy.cc:267: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(mactarget) != 17) // Not a fully-qualified MAC address, default to first MAC found data/gr-hpsdr-2.0/lib/HermesProxyW.cc:120: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(mactarget) != 17) // Not a fully-qualified MAC address, default to first MAC found data/gr-hpsdr-2.0/lib/metis.cc:154:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifrr.ifr_name, ifname, sizeof(ifrr.ifr_name)); ANALYSIS SUMMARY: Hits = 22 Lines analyzed = 3609 in approximately 0.15 seconds (24131 lines/second) Physical Source Lines of Code (SLOC) = 2013 Hits@level = [0] 56 [1] 3 [2] 17 [3] 0 [4] 2 [5] 0 Hits@level+ = [0+] 78 [1+] 22 [2+] 19 [3+] 2 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 38.7481 [1+] 10.929 [2+] 9.43865 [3+] 0.993542 [4+] 0.993542 [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.