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/i2c-tools-4.2/eeprog/24cXX.c Examining data/i2c-tools-4.2/eeprog/24cXX.h Examining data/i2c-tools-4.2/eeprog/eeprog.c Examining data/i2c-tools-4.2/eepromer/eeprom.c Examining data/i2c-tools-4.2/eepromer/eepromer.c Examining data/i2c-tools-4.2/include/i2c/smbus.h Examining data/i2c-tools-4.2/lib/smbus.c Examining data/i2c-tools-4.2/py-smbus/smbusmodule.c Examining data/i2c-tools-4.2/tools/i2cbusses.c Examining data/i2c-tools-4.2/tools/i2cbusses.h Examining data/i2c-tools-4.2/tools/i2cdetect.c Examining data/i2c-tools-4.2/tools/i2cdump.c Examining data/i2c-tools-4.2/tools/i2cget.c Examining data/i2c-tools-4.2/tools/i2cset.c Examining data/i2c-tools-4.2/tools/i2ctransfer.c Examining data/i2c-tools-4.2/tools/util.c Examining data/i2c-tools-4.2/tools/util.h Examining data/i2c-tools-4.2/version.h FINAL RESULTS: data/i2c-tools-4.2/eeprog/eeprog.c:87:47: [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. #define print_info(args...) do { if(!g_quiet) fprintf(stderr, args); } while(0); data/i2c-tools-4.2/eepromer/eepromer.c:120:4: [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(stderr,VER); data/i2c-tools-4.2/eepromer/eepromer.c:153:5: [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(device,argv[i+1]); data/i2c-tools-4.2/tools/i2cbusses.c:181:27: [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). adapters[count].name = strcpy(all, name); data/i2c-tools-4.2/tools/i2cbusses.c:182:28: [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). adapters[count].funcs = strcpy(all + len_name, type); data/i2c-tools-4.2/tools/i2cbusses.c:183:27: [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). adapters[count].algo = strcpy(all + len_name + len_type, data/i2c-tools-4.2/tools/i2cdump.c:66:4: [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(stderr, MISSING_FUNC_FMT, "SMBus receive byte"); data/i2c-tools-4.2/tools/i2cdump.c:70:4: [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(stderr, MISSING_FUNC_FMT, "SMBus send byte"); data/i2c-tools-4.2/tools/i2cdump.c:77:4: [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(stderr, MISSING_FUNC_FMT, "SMBus read byte"); data/i2c-tools-4.2/tools/i2cdump.c:84:4: [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(stderr, MISSING_FUNC_FMT, "SMBus read word"); data/i2c-tools-4.2/tools/i2cdump.c:91:4: [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(stderr, MISSING_FUNC_FMT, "SMBus block read"); data/i2c-tools-4.2/tools/i2cdump.c:98:4: [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(stderr, MISSING_FUNC_FMT, "I2C block read"); data/i2c-tools-4.2/tools/i2cget.c:69:4: [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(stderr, MISSING_FUNC_FMT, "SMBus receive byte"); data/i2c-tools-4.2/tools/i2cget.c:74:4: [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(stderr, MISSING_FUNC_FMT, "SMBus send byte"); data/i2c-tools-4.2/tools/i2cget.c:81:4: [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(stderr, MISSING_FUNC_FMT, "SMBus read byte"); data/i2c-tools-4.2/tools/i2cget.c:88:4: [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(stderr, MISSING_FUNC_FMT, "SMBus read word"); data/i2c-tools-4.2/tools/i2cset.c:68:4: [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(stderr, MISSING_FUNC_FMT, "SMBus send byte"); data/i2c-tools-4.2/tools/i2cset.c:75:4: [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(stderr, MISSING_FUNC_FMT, "SMBus write byte"); data/i2c-tools-4.2/tools/i2cset.c:82:4: [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(stderr, MISSING_FUNC_FMT, "SMBus write word"); data/i2c-tools-4.2/tools/i2cset.c:89:4: [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(stderr, MISSING_FUNC_FMT, "SMBus block write"); data/i2c-tools-4.2/tools/i2cset.c:95:4: [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(stderr, MISSING_FUNC_FMT, "I2C block write"); data/i2c-tools-4.2/tools/i2ctransfer.c:73:3: [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(stderr, MISSING_FUNC_FMT, "I2C transfers"); data/i2c-tools-4.2/eeprog/eeprog.c:177:15: [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((ret = getopt(argc, argv, "1:8fr:qhw:xd")) != -1) data/i2c-tools-4.2/eeprog/eeprog.c:220:12: [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. device = getenv(ENV_DEV); data/i2c-tools-4.2/eeprog/eeprog.c:221: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. i2c_addr_s = getenv(ENV_I2C_ADDR); data/i2c-tools-4.2/eeprog/eeprog.c:227:17: [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. i2c_addr_s = getenv(ENV_I2C_ADDR); data/i2c-tools-4.2/eeprog/eeprog.c:229:13: [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. device = getenv(ENV_DEV); data/i2c-tools-4.2/eepromer/eeprom.c:143:14: [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((i=getopt(argc,argv,"d:a:p:wyf:h"))>=0){ data/i2c-tools-4.2/eeprog/24cXX.c:85: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(dev_fqn, O_RDWR); data/i2c-tools-4.2/eepromer/eeprom.c:43: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[MAX_BYTES + 1]; data/i2c-tools-4.2/eepromer/eeprom.c:197: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). f=open(fn,O_WRONLY|O_CREAT,0666); data/i2c-tools-4.2/eepromer/eeprom.c:199: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). f=open(fn,O_RDONLY); data/i2c-tools-4.2/eepromer/eeprom.c:209: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((d=open(dn,O_RDWR))<0){ data/i2c-tools-4.2/eepromer/eeprom.c:222: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 warnbuf[4]; data/i2c-tools-4.2/eepromer/eeprom.c:251: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 buf[BYTES_PER_PAGE]; data/i2c-tools-4.2/eepromer/eepromer.c:57:4: [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[56]; data/i2c-tools-4.2/eepromer/eepromer.c:66: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 s[100]; data/i2c-tools-4.2/eepromer/eepromer.c:71:13: [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((fptr = fopen("/proc/bus/i2c", "r"))) { data/i2c-tools-4.2/eepromer/eepromer.c:87: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 device[45]; data/i2c-tools-4.2/eepromer/eepromer.c:221: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. unsigned char buff[2]; data/i2c-tools-4.2/eepromer/eepromer.c:281: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 buff[2]; //={0x0,0x0}; data/i2c-tools-4.2/eepromer/eepromer.c:364:14: [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 ((file = open(device,O_RDWR)) < 0) { data/i2c-tools-4.2/eepromer/eepromer.c:399: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 buf[MAX_BLK_SIZE]; data/i2c-tools-4.2/eepromer/eepromer.c:465: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 buf[MAX_BLK_SIZE]; data/i2c-tools-4.2/eepromer/eepromer.c:509: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 buf[MAX_BLK_SIZE]; data/i2c-tools-4.2/eepromer/eepromer.c:588: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. unsigned char buff[2]; data/i2c-tools-4.2/eepromer/eepromer.c:648: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 buff[2]; //={0x0,0x0}; data/i2c-tools-4.2/eepromer/eepromer.c:698: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 time_buf[15],*p_buf; data/i2c-tools-4.2/py-smbus/smbusmodule.c:115: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 path[MAXPATH]; data/i2c-tools-4.2/py-smbus/smbusmodule.c:128:18: [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 ((self->fd = open(path, O_RDWR, 0)) == -1) { data/i2c-tools-4.2/tools/i2cbusses.c:70: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 filename[20]; data/i2c-tools-4.2/tools/i2cbusses.c:134: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 s[120]; data/i2c-tools-4.2/tools/i2cbusses.c:138: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 fstype[NAME_MAX], sysfs[NAME_MAX], n[NAME_MAX]; data/i2c-tools-4.2/tools/i2cbusses.c:148:11: [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 ((f = fopen("/proc/bus/i2c", "r"))) { data/i2c-tools-4.2/tools/i2cbusses.c:193:11: [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 ((f = fopen("/proc/mounts", "r")) == NULL) { data/i2c-tools-4.2/tools/i2cbusses.c:211:2: [2] (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 string. strcat(sysfs, "/class/i2c-dev"); data/i2c-tools-4.2/tools/i2cbusses.c:228:7: [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). f = fopen(n, "r"); data/i2c-tools-4.2/tools/i2cbusses.c:237:8: [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). f = fopen(n, "r"); data/i2c-tools-4.2/tools/i2cbusses.c:267:14: [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((f = fopen(n, "r"))) data/i2c-tools-4.2/tools/i2cbusses.c:416:9: [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). file = open(filename, O_RDWR); data/i2c-tools-4.2/tools/i2cbusses.c:424:10: [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). file = open(filename, O_RDWR); data/i2c-tools-4.2/tools/i2cdetect.c:204: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 filename[20]; data/i2c-tools-4.2/tools/i2cdetect.c:361: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 s[2]; data/i2c-tools-4.2/tools/i2cdump.c:118: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 filename[20]; data/i2c-tools-4.2/tools/i2cdump.c:336:13: [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 cblock[288]; data/i2c-tools-4.2/tools/i2cget.c:158: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 filename[20]; data/i2c-tools-4.2/tools/i2cset.c:163: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 filename[20]; data/i2c-tools-4.2/tools/i2cset.c:167: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 block[I2C_SMBUS_BLOCK_MAX]; data/i2c-tools-4.2/tools/i2ctransfer.c:138: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 filename[20]; data/i2c-tools-4.2/tools/util.c:27: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 s[2]; data/i2c-tools-4.2/eeprog/24cXX.c:43:2: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(WRITE_DELAY_US); data/i2c-tools-4.2/eeprog/24cXX.c:54:2: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(WRITE_DELAY_US); data/i2c-tools-4.2/eeprog/24cXX.c:66:2: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(WRITE_DELAY_US); data/i2c-tools-4.2/eeprog/eeprog.c:115:2: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). getchar(); data/i2c-tools-4.2/eeprog/eeprog.c:156:13: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while((c = getchar()) != EOF) data/i2c-tools-4.2/eeprog/eeprog.c:182:31: [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). usage_if(*optarg != '6' || strlen(optarg) != 1); data/i2c-tools-4.2/eepromer/eeprom.c:256:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). j=read(f,buf,sizeof(buf)); data/i2c-tools-4.2/eepromer/eepromer.c:159: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(device)) { data/i2c-tools-4.2/eepromer/eepromer.c:721:2: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). getchar(); data/i2c-tools-4.2/tools/i2cbusses.c:98: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). for (i = strlen(s) - 1; i >= 0 && (s[i] == ' ' || s[i] == '\n'); i--) data/i2c-tools-4.2/tools/i2cset.c:229:7: [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(argv[argc-1]) > 2 data/i2c-tools-4.2/tools/i2cset.c:230: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(argv[argc-1]) == 2 && argv[argc-1][1] != 'p')) { data/i2c-tools-4.2/tools/i2ctransfer.c:89:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int print_buf = (read && (flags & PRINT_READ_BUF)) || data/i2c-tools-4.2/tools/i2ctransfer.c:90:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (!read && (flags & PRINT_WRITE_BUF)); data/i2c-tools-4.2/tools/i2ctransfer.c:100:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i, msgs[i].addr, read ? "read" : "write"); data/i2c-tools-4.2/tools/util.c:48:11: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = fgetc(stdin); ANALYSIS SUMMARY: Hits = 86 Lines analyzed = 5077 in approximately 0.20 seconds (25564 lines/second) Physical Source Lines of Code (SLOC) = 3770 Hits@level = [0] 300 [1] 16 [2] 42 [3] 6 [4] 22 [5] 0 Hits@level+ = [0+] 386 [1+] 86 [2+] 70 [3+] 28 [4+] 22 [5+] 0 Hits/KSLOC@level+ = [0+] 102.387 [1+] 22.8117 [2+] 18.5676 [3+] 7.42706 [4+] 5.83554 [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.