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/pigpio-1.68/EXAMPLES/C/COUNTER_1/freq_count_1.c Examining data/pigpio-1.68/EXAMPLES/C/COUNTER_2/freq_count_2.c Examining data/pigpio-1.68/EXAMPLES/C/HALL_EFFECT_SENSOR/hall.c Examining data/pigpio-1.68/EXAMPLES/C/I2C_SNIFFER/pig2i2c.c Examining data/pigpio-1.68/EXAMPLES/C/IR_RECEIVER/ir_hasher.c Examining data/pigpio-1.68/EXAMPLES/C/IR_RECEIVER/ir_hasher.h Examining data/pigpio-1.68/EXAMPLES/C/IR_RECEIVER/test_ir_hasher.c Examining data/pigpio-1.68/EXAMPLES/C/PCF8591_YL-40/PCF8591.c Examining data/pigpio-1.68/EXAMPLES/C/POT_CAP_RECHARGE/pot_cap_charge.c Examining data/pigpio-1.68/EXAMPLES/C/ROTARY_ENCODER/rotary_encoder.c Examining data/pigpio-1.68/EXAMPLES/C/ROTARY_ENCODER/rotary_encoder.h Examining data/pigpio-1.68/EXAMPLES/C/ROTARY_ENCODER/test_rotary_encoder.c Examining data/pigpio-1.68/EXAMPLES/C/WIEGAND_CODE/test_wiegand.c Examining data/pigpio-1.68/EXAMPLES/C/WIEGAND_CODE/wiegand.c Examining data/pigpio-1.68/EXAMPLES/C/WIEGAND_CODE/wiegand.h Examining data/pigpio-1.68/EXAMPLES/CPP/IR_RECEIVER/ir_hasher.cpp Examining data/pigpio-1.68/EXAMPLES/CPP/IR_RECEIVER/ir_hasher.hpp Examining data/pigpio-1.68/EXAMPLES/CPP/IR_RECEIVER/test_ir_hasher.cpp Examining data/pigpio-1.68/EXAMPLES/CPP/ROTARY_ENCODER/rotary_encoder.cpp Examining data/pigpio-1.68/EXAMPLES/CPP/ROTARY_ENCODER/rotary_encoder.hpp Examining data/pigpio-1.68/EXAMPLES/CPP/ROTARY_ENCODER/test_rotary_encoder.cpp Examining data/pigpio-1.68/EXAMPLES/CPP/WIEGAND_CODE/test_wiegand.cpp Examining data/pigpio-1.68/EXAMPLES/CPP/WIEGAND_CODE/wiegand.cpp Examining data/pigpio-1.68/EXAMPLES/CPP/WIEGAND_CODE/wiegand.hpp Examining data/pigpio-1.68/pig2vcd.c Examining data/pigpio-1.68/pigpio.h Examining data/pigpio-1.68/pigpiod.c Examining data/pigpio-1.68/pigpiod_if.c Examining data/pigpio-1.68/pigpiod_if.h Examining data/pigpio-1.68/pigpiod_if2.c Examining data/pigpio-1.68/pigpiod_if2.h Examining data/pigpio-1.68/pigs.h Examining data/pigpio-1.68/x_pigpio.c Examining data/pigpio-1.68/x_pigpiod_if.c Examining data/pigpio-1.68/x_pigpiod_if2.c Examining data/pigpio-1.68/command.c Examining data/pigpio-1.68/command.h Examining data/pigpio-1.68/pigs.c Examining data/pigpio-1.68/pigpio.c FINAL RESULTS: data/pigpio-1.68/pigpio.c:1691:8: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (chmod(name, perm) < 0) data/pigpio-1.68/pigpiod.c:379:8: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (chmod(PI_ERRFIFO, 0664) < 0) data/pigpio-1.68/EXAMPLES/C/COUNTER_1/freq_count_1.c:90:4: [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/pigpio-1.68/EXAMPLES/C/COUNTER_2/freq_count_2.c:95:4: [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/pigpio-1.68/pigpio.c:3995: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. if (system("/sbin/modprobe i2c_dev") == -1) { /* ignore errors */} data/pigpio-1.68/pigpio.c:3996: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. if (system("/sbin/modprobe i2c_bcm2835") == -1) { /* ignore errors */} data/pigpio-1.68/pigpio.c:6536:13: [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/pigpio-1.68/pigpio.c:12864:13: [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/pigpio-1.68/pigpio.c:12907:22: [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(match, buffer); data/pigpio-1.68/pigpio.c:12913:19: [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(match, buffer); data/pigpio-1.68/pigpio.c:13188:13: [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(buf+bufpos, pglob.gl_pathv[i]); data/pigpio-1.68/pigpiod.c:81:4: [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/pigpio-1.68/pigs.c:72:4: [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/pigpio-1.68/pigs.c:320:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. {sprintf(command_buf+pp, "%s ", argv[i]); pp=l;} data/pigpio-1.68/EXAMPLES/C/COUNTER_1/freq_count_1.c:106: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 ((opt = getopt(argc, argv, "p:r:s:")) != -1) data/pigpio-1.68/EXAMPLES/C/COUNTER_2/freq_count_2.c:111: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 ((opt = getopt(argc, argv, "p:r:s:")) != -1) data/pigpio-1.68/pigpio.c:8229: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. portStr = getenv(PI_ENVPORT); data/pigpio-1.68/pigpiod.c:138:14: [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. portStr = getenv(PI_ENVPORT); data/pigpio-1.68/pigpiod.c:166: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 ((opt = getopt(argc, argv, "a:b:c:d:e:fgkln:mp:s:t:x:vV")) != -1) data/pigpio-1.68/pigpiod_if.c:172: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. addrStr = getenv(PI_ENVADDR); data/pigpio-1.68/pigpiod_if.c:183: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. portStr = getenv(PI_ENVPORT); data/pigpio-1.68/pigpiod_if2.c:245: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. addrStr = getenv(PI_ENVADDR); data/pigpio-1.68/pigpiod_if2.c:256: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. portStr = getenv(PI_ENVPORT); data/pigpio-1.68/pigs.c:88: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 ((opt = getopt(argc, argv, "ax")) != -1) data/pigpio-1.68/pigs.c:116:14: [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. portStr = getenv(PI_ENVPORT); data/pigpio-1.68/pigs.c:120:14: [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. addrStr = getenv(PI_ENVADDR); data/pigpio-1.68/EXAMPLES/C/COUNTER_1/freq_count_1.c:86: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 buf[128]; data/pigpio-1.68/EXAMPLES/C/COUNTER_1/freq_count_1.c:113:17: [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). i = atoi(optarg); data/pigpio-1.68/EXAMPLES/C/COUNTER_1/freq_count_1.c:121:17: [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). i = atoi(optarg); data/pigpio-1.68/EXAMPLES/C/COUNTER_1/freq_count_1.c:128:17: [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). i = atoi(optarg); data/pigpio-1.68/EXAMPLES/C/COUNTER_1/freq_count_1.c:172:11: [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). g = atoi(argv[i]); data/pigpio-1.68/EXAMPLES/C/COUNTER_2/freq_count_2.c:91: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 buf[128]; data/pigpio-1.68/EXAMPLES/C/COUNTER_2/freq_count_2.c:118:17: [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). i = atoi(optarg); data/pigpio-1.68/EXAMPLES/C/COUNTER_2/freq_count_2.c:126:17: [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). i = atoi(optarg); data/pigpio-1.68/EXAMPLES/C/COUNTER_2/freq_count_2.c:133:17: [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). i = atoi(optarg); data/pigpio-1.68/EXAMPLES/C/COUNTER_2/freq_count_2.c:191:11: [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). g = atoi(argv[i]); data/pigpio-1.68/EXAMPLES/C/HALL_EFFECT_SENSOR/hall.c:35:23: [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). if (argc>1) secs = atoi(argv[1]); /* program run seconds */ data/pigpio-1.68/EXAMPLES/C/I2C_SNIFFER/pig2i2c.c:62: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. static char buf[32]; data/pigpio-1.68/EXAMPLES/C/I2C_SNIFFER/pig2i2c.c:168:14: [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). gSCL = atoi(argv[1]); data/pigpio-1.68/EXAMPLES/C/I2C_SNIFFER/pig2i2c.c:169:14: [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). gSDA = atoi(argv[2]); data/pigpio-1.68/EXAMPLES/C/PCF8591_YL-40/PCF8591.c:62: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 command[2]; data/pigpio-1.68/EXAMPLES/C/PCF8591_YL-40/PCF8591.c:63: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 value[4]; data/pigpio-1.68/EXAMPLES/C/PCF8591_YL-40/PCF8591.c:64: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 str[8]; data/pigpio-1.68/EXAMPLES/C/PCF8591_YL-40/PCF8591.c:105:10: [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(str, "%3d", value[i]); data/pigpio-1.68/command.c:623: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 intCmdStr[32]; data/pigpio-1.68/command.c:725:10: [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(ext, buf+ctl->eaten, p[3]); data/pigpio-1.68/command.c:740: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(ext, buf+ctl->eaten, n); data/pigpio-1.68/command.c:854: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(ext, buf+ctl->eaten, n); data/pigpio-1.68/command.c:877: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(ext, buf+ctl->eaten, n); data/pigpio-1.68/command.c:882: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(ext+n+1, buf+ctl->eaten+1, n2); data/pigpio-1.68/command.c:904: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(ext, &tp1, 4); data/pigpio-1.68/command.c:919: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(ext, buf+ctl->eaten, n); data/pigpio-1.68/command.c:946: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(ext, &tp1, 4); data/pigpio-1.68/command.c:972: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(ext+ 0, &tp1, 4); data/pigpio-1.68/command.c:973: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(ext+ 4, &tp2, 4); data/pigpio-1.68/command.c:974: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(ext+ 8, &tp3, 4); data/pigpio-1.68/command.c:975: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(ext+12, &tp4, 4); data/pigpio-1.68/command.c:976: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(ext+16, &tp5, 4); data/pigpio-1.68/command.c:1187: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(ext, &tp1, 4); data/pigpio-1.68/command.c:1188: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(ext+4, &tp2, 4); data/pigpio-1.68/command.c:1189: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(ext+8, &tp3, 4); data/pigpio-1.68/command.c:1267: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 v[CMD_MAX_EXTENSION]; data/pigpio-1.68/command.c:1309: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(s->str_area + s->str_area_pos, v, p[3]); data/pigpio-1.68/pig2vcd.c:53: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. static char buf[32]; data/pigpio-1.68/pigpio.c:1522: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. static char buf[32]; data/pigpio-1.68/pigpio.c:1584: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. static char str[128]; data/pigpio-1.68/pigpio.c:1591:27: [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. for (i=0; i<c; i++) sprintf(str+(3*i), "%02X ", buf[i]); data/pigpio-1.68/pigpio.c:1881:10: [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(&p[4], buf, 4); data/pigpio-1.68/pigpio.c:1891: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(buf, buf+(bufSize/2), res); data/pigpio-1.68/pigpio.c:1899:20: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (p[3]) memcpy(&xfer.txBuf, buf, p[3]); data/pigpio-1.68/pigpio.c:1903: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(buf, &res, 4); data/pigpio-1.68/pigpio.c:1905: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. if (res > 4) memcpy(buf+4, &xfer.rxBuf, res-4); data/pigpio-1.68/pigpio.c:1911:10: [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(&tmp1, buf+ 0, 4); // MISO data/pigpio-1.68/pigpio.c:1912:10: [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(&tmp2, buf+ 4, 4); // MOSI data/pigpio-1.68/pigpio.c:1913:10: [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(&tmp3, buf+ 8, 4); // SCLK data/pigpio-1.68/pigpio.c:1914:10: [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(&tmp4, buf+12, 4); // baud data/pigpio-1.68/pigpio.c:1915:10: [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(&tmp5, buf+16, 4); // flags data/pigpio-1.68/pigpio.c:2020:10: [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(&p[4], buf, 4); data/pigpio-1.68/pigpio.c:2032:10: [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(&p[4], buf, 4); data/pigpio-1.68/pigpio.c:2059: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(&p[4], buf, 4); data/pigpio-1.68/pigpio.c:2077:10: [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(&p[4], buf, 4); data/pigpio-1.68/pigpio.c:2082:10: [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(&p[4], buf, 4); data/pigpio-1.68/pigpio.c:2098:10: [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(&p[4], buf, 4); data/pigpio-1.68/pigpio.c:2111:10: [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(&p[4], buf, 4); data/pigpio-1.68/pigpio.c:2132:10: [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(&p[4], buf, 4); data/pigpio-1.68/pigpio.c:2142: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(buf, buf+(bufSize/2), res); data/pigpio-1.68/pigpio.c:2292:10: [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(&p[4], buf, 4); data/pigpio-1.68/pigpio.c:2302:10: [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(&p[4], buf, 4); data/pigpio-1.68/pigpio.c:2326: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(&p[4], buf, 4); data/pigpio-1.68/pigpio.c:2388: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(&tmp1, buf, 4); /* databits */ data/pigpio-1.68/pigpio.c:2389: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(&tmp2, buf+4, 4); /* stophalfbits */ data/pigpio-1.68/pigpio.c:2390: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(&tmp3, buf+8, 4); /* offset */ data/pigpio-1.68/pigpio.c:2699: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). fd = open(MB_DEV1, 0); data/pigpio-1.68/pigpio.c:2704: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). fd = open(MB_DEV2, 0); data/pigpio-1.68/pigpio.c:3163:10: [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(w->s.buf + w->s.writePos, &w->s.data, w->s.bytes); data/pigpio-1.68/pigpio.c:3956: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 dev[32]; data/pigpio-1.68/pigpio.c:3989:4: [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(dev, "/dev/i2c-%d", i2cBus); data/pigpio-1.68/pigpio.c:3991: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 ((fd = open(dev, O_RDWR)) < 0) data/pigpio-1.68/pigpio.c:4000:17: [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, O_RDWR)) < 0) data/pigpio-1.68/pigpio.c:4054: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). fd = open(PI_I2C_COMBINED, O_WRONLY); data/pigpio-1.68/pigpio.c:4311: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 bit_ir[4] = {1, 0, 0, 1}; /* read on rising edge */ data/pigpio-1.68/pigpio.c:4312: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 bit_or[4] = {0, 1, 1, 0}; /* write on rising edge */ data/pigpio-1.68/pigpio.c:4313: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 bit_ic[4] = {0, 0, 1, 1}; /* invert clock */ data/pigpio-1.68/pigpio.c:4872: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 ((fd = open(tty, O_RDWR | O_NOCTTY | O_NDELAY | O_NONBLOCK)) == -1) data/pigpio-1.68/pigpio.c:5746: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 fifo[32]; data/pigpio-1.68/pigpio.c:5880:13: [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(fifo, "/dev/pigpio%d", n); data/pigpio-1.68/pigpio.c:6526: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 buf[1024]; data/pigpio-1.68/pigpio.c:6552: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 buf[CMD_MAX_EXTENSION]; data/pigpio-1.68/pigpio.c:6598:19: [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*)&p3o, (char *)instr.p[4], sizeof(int)); data/pigpio-1.68/pigpio.c:6599:48: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (instr.opt[3] == CMD_VAR) memcpy(buf, (char *)&(s->script.var[p3o]), sizeof(int)); data/pigpio-1.68/pigpio.c:6600:48: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. else memcpy(buf, (char *)&(s->script.par[p3o]), sizeof(int)); data/pigpio-1.68/pigpio.c:6604:19: [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(buf, (char *)instr.p[4], instr.p[3]); data/pigpio-1.68/pigpio.c:6815: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 buf[CMD_MAX_EXTENSION]; data/pigpio-1.68/pigpio.c:6820: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 v[CMD_MAX_EXTENSION]; data/pigpio-1.68/pigpio.c:6824:19: [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 ((inpFifo = fopen(PI_INPFIFO, "r+")) == NULL) data/pigpio-1.68/pigpio.c:6829:19: [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 ((outFifo = fopen(PI_OUTFIFO, "w+")) == NULL) data/pigpio-1.68/pigpio.c:6936: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 buf[CMD_MAX_EXTENSION]; data/pigpio-1.68/pigpio.c:7001:16: [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(buf, &p[3], 4); data/pigpio-1.68/pigpio.c:7157: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 str[20]; data/pigpio-1.68/pigpio.c:7159: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). fd = open(PI_LOCKFILE, O_RDONLY); data/pigpio-1.68/pigpio.c:7170:16: [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). pid = atoi(str); data/pigpio-1.68/pigpio.c:7187: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 pidStr[20]; data/pigpio-1.68/pigpio.c:7193: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). fd = open(PI_LOCKFILE, O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0644); data/pigpio-1.68/pigpio.c:7201:10: [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(pidStr, "%d\n", (int)getpid()); data/pigpio-1.68/pigpio.c:7245:17: [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 ((fdMem = open("/dev/mem", O_RDWR | O_SYNC) ) < 0) data/pigpio-1.68/pigpio.c:7558:16: [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). fdPmap = open("/proc/self/pagemap", O_RDONLY); data/pigpio-1.68/pigpio.c:8230:27: [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). if (portStr) port = atoi(portStr); else port = gpioCfg.socketPort; data/pigpio-1.68/pigpio.c:11220:16: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (buf) memcpy(buf, w->s.buf+w->s.readPos, bytes); data/pigpio-1.68/pigpio.c:11431: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 buf[64]; data/pigpio-1.68/pigpio.c:11437:4: [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(buf, "/sys/class/gpio/gpio%d/value", isr->gpio); data/pigpio-1.68/pigpio.c:11439: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 ((fd = open(buf, O_RDONLY)) < 0) data/pigpio-1.68/pigpio.c:11490: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 buf[64]; data/pigpio-1.68/pigpio.c:11504:15: [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("/sys/class/gpio/export", O_WRONLY); data/pigpio-1.68/pigpio.c:11508:10: [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(buf, "%d\n", gpio); data/pigpio-1.68/pigpio.c:11512:10: [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(buf, "/sys/class/gpio/gpio%d/direction", gpio); data/pigpio-1.68/pigpio.c:11513:15: [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(buf, O_WRONLY); data/pigpio-1.68/pigpio.c:11529:10: [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(buf, "/sys/class/gpio/gpio%d/edge", gpio); data/pigpio-1.68/pigpio.c:11530:15: [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(buf, O_WRONLY); data/pigpio-1.68/pigpio.c:11570:15: [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("/sys/class/gpio/unexport", O_WRONLY); data/pigpio-1.68/pigpio.c:11572:10: [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(buf, "%d\n", gpio); data/pigpio-1.68/pigpio.c:11662: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 name[32]; data/pigpio-1.68/pigpio.c:11686:4: [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(name, "/dev/pigpio%d", slot); data/pigpio-1.68/pigpio.c:11690: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). fd = open(name, O_RDWR|O_NONBLOCK); data/pigpio-1.68/pigpio.c:12329: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(gpioScript[script_id].script.par, param, data/pigpio-1.68/pigpio.c:12372:10: [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(gpioScript[script_id].script.par, param, data/pigpio-1.68/pigpio.c:12400:10: [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(param, gpioScript[script_id].script.par, data/pigpio-1.68/pigpio.c:12850: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 buf[4096]; data/pigpio-1.68/pigpio.c:12874: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 match[PI_MAX_PATH]; data/pigpio-1.68/pigpio.c:12875: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 buffer[PI_MAX_PATH]; data/pigpio-1.68/pigpio.c:12876: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 line[PI_MAX_PATH]; data/pigpio-1.68/pigpio.c:12885: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("/opt/pigpio/access", "r"); data/pigpio-1.68/pigpio.c:12998:15: [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(file, O_RDONLY|oflag, omode); data/pigpio-1.68/pigpio.c:13002:15: [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(file, O_WRONLY|oflag, omode); data/pigpio-1.68/pigpio.c:13006:15: [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(file, O_RDWR|oflag, omode); data/pigpio-1.68/pigpio.c:13351: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 buf[512]; data/pigpio-1.68/pigpio.c:13360: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). filp = fopen ("/proc/cpuinfo", "r"); data/pigpio-1.68/pigpio.c:13395:25: [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). int bcmno = atoi(buf+14); data/pigpio-1.68/pigpio.c:13416:17: [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). filp = fopen ("/proc/device-tree/model", "r"); data/pigpio-1.68/pigpio.c:13435:17: [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). filp = fopen ("/proc/device-tree/system/linux,revision", "r"); data/pigpio-1.68/pigpio.h:505: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 rxBuf[BSC_FIFO_SIZE]; /* Read only */ data/pigpio-1.68/pigpio.h:507: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 txBuf[BSC_FIFO_SIZE]; /* Write */ data/pigpio-1.68/pigpiod.c:77: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 buf[128]; data/pigpio-1.68/pigpiod_if.c:721: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(buf, &databits, 4); data/pigpio-1.68/pigpiod_if.c:722: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(buf+4, &stophalfbits, 4); data/pigpio-1.68/pigpiod_if.c:723: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(buf+8, &offset, 4); data/pigpio-1.68/pigpiod_if.c:921:18: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (param) memcpy(param, p+1, sizeof(p)-4); data/pigpio-1.68/pigpiod_if2.c:947: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(buf, &databits, 4); data/pigpio-1.68/pigpiod_if2.c:948: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(buf+4, &stophalfbits, 4); data/pigpio-1.68/pigpiod_if2.c:949: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(buf+8, &offset, 4); data/pigpio-1.68/pigpiod_if2.c:1150:18: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (param) memcpy(param, p+1, sizeof(p)-4); data/pigpio-1.68/pigpiod_if2.c:1566: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(buf + 0, &MISO, 4); data/pigpio-1.68/pigpiod_if2.c:1567: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(buf + 4, &MOSI, 4); data/pigpio-1.68/pigpiod_if2.c:1568: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(buf + 8, &SCLK, 4); data/pigpio-1.68/pigpiod_if2.c:1569: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(buf + 12, &baud, 4); data/pigpio-1.68/pigpiod_if2.c:1570: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(buf + 16, &spiFlags, 4); data/pigpio-1.68/pigs.c:52:1: [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 command_buf[CMD_MAX_EXTENSION]; data/pigpio-1.68/pigs.c:53:1: [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 response_buf[CMD_MAX_EXTENSION]; data/pigpio-1.68/pigs.c:66: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 buf[128]; data/pigpio-1.68/pigs.c:306: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 v[CMD_MAX_EXTENSION]; data/pigpio-1.68/x_pigpio.c:277: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 p[32]; data/pigpio-1.68/x_pigpio.c:287:4: [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(p, "/dev/pigpio%d", h); data/pigpio-1.68/x_pigpio.c:288: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(p, O_RDONLY); data/pigpio-1.68/x_pigpio.c:376: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 text[2048]; data/pigpio-1.68/x_pigpio.c:674: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 text[2048]; data/pigpio-1.68/x_pigpio.c:738: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 buf[128]; data/pigpio-1.68/x_pigpio.c:830: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 txBuf[8], rxBuf[8]; data/pigpio-1.68/x_pigpio.c:839:4: [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(txBuf, "\x01\x80"); data/pigpio-1.68/x_pigpio.c:860: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 test[64]={0,}; data/pigpio-1.68/x_pigpio.c:877:9: [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. else strcat(test, "0123456789"); data/pigpio-1.68/x_pigpiod_if.c:247: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 p[32]; data/pigpio-1.68/x_pigpiod_if.c:257:4: [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(p, "/dev/pigpio%d", h); data/pigpio-1.68/x_pigpiod_if.c:258: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(p, O_RDONLY); data/pigpio-1.68/x_pigpiod_if.c:345: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 text[2048]; data/pigpio-1.68/x_pigpiod_if.c:639: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 text[2048]; data/pigpio-1.68/x_pigpiod_if.c:705: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 buf[128]; data/pigpio-1.68/x_pigpiod_if.c:797: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 buf[128]; data/pigpio-1.68/x_pigpiod_if.c:809:7: [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(buf, "\x01\x80"); data/pigpio-1.68/x_pigpiod_if.c:828: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 test[64]={0,}; data/pigpio-1.68/x_pigpiod_if.c:845:9: [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. else strcat(test, "0123456789"); data/pigpio-1.68/x_pigpiod_if2.c:251: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 p[32]; data/pigpio-1.68/x_pigpiod_if2.c:261:4: [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(p, "/dev/pigpio%d", h); data/pigpio-1.68/x_pigpiod_if2.c:262: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(p, O_RDONLY); data/pigpio-1.68/x_pigpiod_if2.c:349: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 text[2048]; data/pigpio-1.68/x_pigpiod_if2.c:651: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 text[2048]; data/pigpio-1.68/x_pigpiod_if2.c:717: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 buf[128]; data/pigpio-1.68/x_pigpiod_if2.c:809: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 buf[128]; data/pigpio-1.68/x_pigpiod_if2.c:821:7: [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(buf, "\x01\x80"); data/pigpio-1.68/x_pigpiod_if2.c:840: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 test[64]={0,}; data/pigpio-1.68/x_pigpiod_if2.c:857:9: [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. else strcat(test, "0123456789"); data/pigpio-1.68/EXAMPLES/C/I2C_SNIFFER/pig2i2c.c:187:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((r=read(STDIN_FILENO, &report, RS)) == RS) data/pigpio-1.68/EXAMPLES/C/PCF8591_YL-40/PCF8591.c:100:10: [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(20000); data/pigpio-1.68/command.c:646:4: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. sscanf(buf+ctl->eaten, " %31s %n", intCmdStr, &pp); data/pigpio-1.68/command.c:724: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). p[3] = strlen(buf+ctl->eaten); data/pigpio-1.68/command.c:881:18: [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). n2 = strlen(buf+ctl->eaten+1); data/pigpio-1.68/command.c:1275:10: [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(script); data/pigpio-1.68/pig2vcd.c:80:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r=read(STDIN_FILENO, &report, RS); data/pigpio-1.68/pig2vcd.c:98:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((r=read(STDIN_FILENO, &report, RS)) == RS) data/pigpio-1.68/pigpio.c:1500:10: [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(name); data/pigpio-1.68/pigpio.c:1550:10: [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(name); data/pigpio-1.68/pigpio.c:3942:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytes = read(i2cInfo[handle].fd, buf, count); data/pigpio-1.68/pigpio.c:4960:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read(serInfo[handle].fd, &x, 1); data/pigpio-1.68/pigpio.c:5028:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read(serInfo[handle].fd, buf, count); data/pigpio-1.68/pigpio.c:6846: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(buf); data/pigpio-1.68/pigpio.c:7166:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). count = read(fd, str, sizeof(str)-1); data/pigpio-1.68/pigpio.c:7203:32: [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 (write(fd, pidStr, strlen(pidStr)) == -1) data/pigpio-1.68/pigpio.c:7367:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). t = read(pmapFd, &pa, sizeof(pa)); data/pigpio-1.68/pigpio.c:7745:4: [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(10); data/pigpio-1.68/pigpio.c:7749:4: [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(10); data/pigpio-1.68/pigpio.c:11450:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, buf, sizeof buf) == -1) { /* ignore errors */ } data/pigpio-1.68/pigpio.c:11463:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, buf, sizeof buf) == -1) { /* ignore errors */ } data/pigpio-1.68/pigpio.c:11509: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). err = write(fd, buf, strlen(buf)); data/pigpio-1.68/pigpio.c:11533:42: [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). err = write(fd, edge_str[edge], strlen(edge_str[edge])); data/pigpio-1.68/pigpio.c:11535:21: [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 (err != strlen(edge_str[edge])) return PI_BAD_ISR_INIT; data/pigpio-1.68/pigpio.c:11573: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). err = write(fd, buf, strlen(buf)); data/pigpio-1.68/pigpio.c:11575:21: [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 (err != strlen(buf)) return PI_BAD_ISR_INIT; data/pigpio-1.68/pigpio.c:12896:10: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. sscanf(line, " %511s %c%c", buffer, &perm, &term); data/pigpio-1.68/pigpio.c:13107:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read(fileInfo[handle].fd, buf, count); data/pigpio-1.68/pigpio.c:13185: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). len = strlen(pglob.gl_pathv[i]); data/pigpio-1.68/pigpiod.c:329:7: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(0); data/pigpio-1.68/pigpiod_if.c:174:27: [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 ((!addrStr) || (!strlen(addrStr))) data/pigpio-1.68/pigpiod_if.c:185:27: [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 ((!portStr) || (!strlen(portStr))) data/pigpio-1.68/pigpiod_if.c:281:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytes = read(gPigNotify, (char*)&gReport+got, sizeof(gReport)-got); data/pigpio-1.68/pigpiod_if.c:495:23: [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 ((!addrStr) || (strlen(addrStr) == 0)) data/pigpio-1.68/pigpiod_if.c:859:10: [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(script); data/pigpio-1.68/pigpiod_if.c:1404:10: [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(dev); data/pigpio-1.68/pigpiod_if2.c:247:27: [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 ((!addrStr) || (!strlen(addrStr))) data/pigpio-1.68/pigpiod_if2.c:258:27: [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 ((!portStr) || (!strlen(portStr))) data/pigpio-1.68/pigpiod_if2.c:378:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytes = read(gPigNotify[pi], (char*)&report+got, sizeof(report)-got); data/pigpio-1.68/pigpiod_if2.c:716:23: [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 ((!addrStr) || (strlen(addrStr) == 0)) data/pigpio-1.68/pigpiod_if2.c:1091:10: [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(script); data/pigpio-1.68/pigpiod_if2.c:1705:10: [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(dev); data/pigpio-1.68/pigpiod_if2.c:1831: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). ln = strlen(scriptName); data/pigpio-1.68/pigpiod_if2.c:1832: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). ls = strlen(scriptString); data/pigpio-1.68/pigpiod_if2.c:1856:10: [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(file); data/pigpio-1.68/pigpiod_if2.c:1937:10: [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(fpat); data/pigpio-1.68/pigs.c:318: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). l += (strlen(argv[i]) + 1); data/pigpio-1.68/pigs.c:327:10: [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(command_buf); data/pigpio-1.68/x_pigpio.c:311:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). b = read(f, &r, 12); data/pigpio-1.68/x_pigpio.c:411:53: [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). e = gpioWaveAddSerial(GPIO, BAUD, 8, 2, 5000000, strlen(TEXT), TEXT); data/pigpio-1.68/x_pigpio.c:695: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). e = serWrite(h, TEXT, strlen(TEXT)); data/pigpio-1.68/x_pigpio.c:708:20: [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). CHECK(10, 5, b, strlen(TEXT)+4, 0, "serial data available"); data/pigpio-1.68/x_pigpio.c:710:25: [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). b = serRead(h, text, strlen(TEXT)); data/pigpio-1.68/x_pigpio.c:711:20: [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). CHECK(10, 6, b, strlen(TEXT), 0, "serial read"); data/pigpio-1.68/x_pigpio.c:764:10: [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(exp); data/pigpio-1.68/x_pigpio.c:790:10: [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(exp); data/pigpio-1.68/x_pigpio.c:811:10: [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(exp); data/pigpio-1.68/x_pigpio.c:866:19: [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=0; i<strlen(argv[1]); i++) data/pigpio-1.68/x_pigpiod_if.c:281:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). b = read(f, &r, 12); data/pigpio-1.68/x_pigpiod_if.c:376:51: [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). e = wave_add_serial(GPIO, BAUD, 8, 2, 5000000, strlen(TEXT), TEXT); data/pigpio-1.68/x_pigpiod_if.c:662:30: [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). e = serial_write(h, TEXT, strlen(TEXT)); data/pigpio-1.68/x_pigpiod_if.c:675:20: [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). CHECK(10, 5, b, strlen(TEXT)+4, 0, "serial data available"); data/pigpio-1.68/x_pigpiod_if.c:677:29: [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). b = serial_read(h, text, strlen(TEXT)); data/pigpio-1.68/x_pigpiod_if.c:678:20: [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). CHECK(10, 6, b, strlen(TEXT), 0, "serial read"); data/pigpio-1.68/x_pigpiod_if.c:731:10: [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(exp); data/pigpio-1.68/x_pigpiod_if.c:757:10: [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(exp); data/pigpio-1.68/x_pigpiod_if.c:778:10: [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(exp); data/pigpio-1.68/x_pigpiod_if.c:834:19: [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=0; i<strlen(argv[1]); i++) data/pigpio-1.68/x_pigpiod_if2.c:285:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). b = read(f, &r, 12); data/pigpio-1.68/x_pigpiod_if2.c:380:55: [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). e = wave_add_serial(pi, GPIO, BAUD, 8, 2, 5000000, strlen(TEXT), TEXT); data/pigpio-1.68/x_pigpiod_if2.c:674:34: [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). e = serial_write(pi, h, TEXT, strlen(TEXT)); data/pigpio-1.68/x_pigpiod_if2.c:687:20: [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). CHECK(10, 5, b, strlen(TEXT)+4, 0, "serial data available"); data/pigpio-1.68/x_pigpiod_if2.c:689:33: [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). b = serial_read(pi, h, text, strlen(TEXT)); data/pigpio-1.68/x_pigpiod_if2.c:690:20: [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). CHECK(10, 6, b, strlen(TEXT), 0, "serial read"); data/pigpio-1.68/x_pigpiod_if2.c:743:10: [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(exp); data/pigpio-1.68/x_pigpiod_if2.c:769:10: [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(exp); data/pigpio-1.68/x_pigpiod_if2.c:790:10: [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(exp); data/pigpio-1.68/x_pigpiod_if2.c:846:19: [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=0; i<strlen(argv[1]); i++) ANALYSIS SUMMARY: Hits = 287 Lines analyzed = 38373 in approximately 0.83 seconds (46440 lines/second) Physical Source Lines of Code (SLOC) = 17733 Hits@level = [0] 203 [1] 78 [2] 183 [3] 12 [4] 12 [5] 2 Hits@level+ = [0+] 490 [1+] 287 [2+] 209 [3+] 26 [4+] 14 [5+] 2 Hits/KSLOC@level+ = [0+] 27.6321 [1+] 16.1845 [2+] 11.7859 [3+] 1.46619 [4+] 0.789489 [5+] 0.112784 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.