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/libopenhmd-0.3.0/examples/opengl/gl.c Examining data/libopenhmd-0.3.0/examples/opengl/gl.h Examining data/libopenhmd-0.3.0/examples/opengl/main.c Examining data/libopenhmd-0.3.0/examples/simple/simple.c Examining data/libopenhmd-0.3.0/include/openhmd.h Examining data/libopenhmd-0.3.0/src/drv_3glasses/packet.c Examining data/libopenhmd-0.3.0/src/drv_3glasses/xgvr.c Examining data/libopenhmd-0.3.0/src/drv_3glasses/xgvr.h Examining data/libopenhmd-0.3.0/src/drv_android/android.c Examining data/libopenhmd-0.3.0/src/drv_android/android.h Examining data/libopenhmd-0.3.0/src/drv_deepoon/deepoon.c Examining data/libopenhmd-0.3.0/src/drv_deepoon/deepoon.h Examining data/libopenhmd-0.3.0/src/drv_deepoon/packet.c Examining data/libopenhmd-0.3.0/src/drv_dummy/dummy.c Examining data/libopenhmd-0.3.0/src/drv_external/external.c Examining data/libopenhmd-0.3.0/src/drv_htc_vive/magic.h Examining data/libopenhmd-0.3.0/src/drv_htc_vive/packet.c Examining data/libopenhmd-0.3.0/src/drv_htc_vive/vive.c Examining data/libopenhmd-0.3.0/src/drv_htc_vive/vive.h Examining data/libopenhmd-0.3.0/src/drv_nolo/nolo.c Examining data/libopenhmd-0.3.0/src/drv_nolo/nolo.h Examining data/libopenhmd-0.3.0/src/drv_nolo/packet.c Examining data/libopenhmd-0.3.0/src/drv_oculus_rift/packet.c Examining data/libopenhmd-0.3.0/src/drv_oculus_rift/rift.c Examining data/libopenhmd-0.3.0/src/drv_oculus_rift/rift.h Examining data/libopenhmd-0.3.0/src/drv_psvr/packet.c Examining data/libopenhmd-0.3.0/src/drv_psvr/psvr.c Examining data/libopenhmd-0.3.0/src/drv_psvr/psvr.h Examining data/libopenhmd-0.3.0/src/drv_wmr/config_key.h Examining data/libopenhmd-0.3.0/src/drv_wmr/packet.c Examining data/libopenhmd-0.3.0/src/drv_wmr/wmr.c Examining data/libopenhmd-0.3.0/src/drv_wmr/wmr.h Examining data/libopenhmd-0.3.0/src/ext_deps/miniz.c Examining data/libopenhmd-0.3.0/src/ext_deps/miniz.h Examining data/libopenhmd-0.3.0/src/ext_deps/nxjson.c Examining data/libopenhmd-0.3.0/src/ext_deps/nxjson.h Examining data/libopenhmd-0.3.0/src/fusion.c Examining data/libopenhmd-0.3.0/src/fusion.h Examining data/libopenhmd-0.3.0/src/hid.h Examining data/libopenhmd-0.3.0/src/log.h Examining data/libopenhmd-0.3.0/src/omath.c Examining data/libopenhmd-0.3.0/src/omath.h Examining data/libopenhmd-0.3.0/src/openhmd.c Examining data/libopenhmd-0.3.0/src/openhmdi.h Examining data/libopenhmd-0.3.0/src/platform-posix.c Examining data/libopenhmd-0.3.0/src/platform-win32.c Examining data/libopenhmd-0.3.0/src/platform.h Examining data/libopenhmd-0.3.0/src/shaders.c Examining data/libopenhmd-0.3.0/src/shaders.h Examining data/libopenhmd-0.3.0/tests/unittests/highlevel.c Examining data/libopenhmd-0.3.0/tests/unittests/main.c Examining data/libopenhmd-0.3.0/tests/unittests/quat.c Examining data/libopenhmd-0.3.0/tests/unittests/tests.h Examining data/libopenhmd-0.3.0/tests/unittests/vec.c FINAL RESULTS: data/libopenhmd-0.3.0/src/drv_3glasses/xgvr.c:270: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(desc->product, platform_sku[i].desc); data/libopenhmd-0.3.0/src/drv_3glasses/xgvr.c:277: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(desc->path, cur_dev->path); data/libopenhmd-0.3.0/src/drv_deepoon/deepoon.c:294:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(desc->path, cur_dev->path); data/libopenhmd-0.3.0/src/drv_nolo/nolo.c:267:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(mNOLO->path, desc->path); data/libopenhmd-0.3.0/src/drv_nolo/nolo.c:374:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(desc->product, rd[i].name); data/libopenhmd-0.3.0/src/drv_nolo/nolo.c:378:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(desc->path, cur_dev->path); data/libopenhmd-0.3.0/src/drv_nolo/nolo.c:393:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(desc->path, cur_dev->path); data/libopenhmd-0.3.0/src/drv_nolo/nolo.c:412:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(desc->path, cur_dev->path); data/libopenhmd-0.3.0/src/drv_oculus_rift/rift.c:448: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(desc->product, rd[i].name); data/libopenhmd-0.3.0/src/drv_oculus_rift/rift.c:455: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(desc->path, cur_dev->path); data/libopenhmd-0.3.0/src/log.h:21:95: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define LOG(_level, _levelstr, ...) do{ if(_level >= LOGLEVEL){ printf("[%s] ", (_levelstr)); printf(__VA_ARGS__); puts(""); } } while(0) data/libopenhmd-0.3.0/src/log.h:35:9: [4] (format) snprintf: 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. #define snprintf _snprintf data/libopenhmd-0.3.0/src/log.h:35:18: [4] (format) _snprintf: 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. #define snprintf _snprintf data/libopenhmd-0.3.0/src/log.h:38:37: [4] (format) snprintf: 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. #define ohmd_set_error(_ctx, ...) { snprintf((_ctx)->error_msg, OHMD_STR_SIZE, __VA_ARGS__); LOGE(__VA_ARGS__); } data/libopenhmd-0.3.0/tests/unittests/main.c:18:18: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define Test(_t) printf(" "#_t); _t(); printf("%*sok\n", 50 - (int)strlen(#_t), ""); data/libopenhmd-0.3.0/examples/opengl/main.c:47:2: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(42); data/libopenhmd-0.3.0/examples/opengl/gl.c:150: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 log[4096] = {0}; data/libopenhmd-0.3.0/examples/opengl/gl.c:185: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 log[4096] = {0}; data/libopenhmd-0.3.0/examples/opengl/main.c:21:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* f = fopen(filename, "rb"); data/libopenhmd-0.3.0/examples/simple/simple.c:46: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). device_idx = atoi(argv[1]); data/libopenhmd-0.3.0/src/drv_3glasses/xgvr.c:98:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buf[FEATURE_BUFFER_SIZE]; data/libopenhmd-0.3.0/src/drv_3glasses/xgvr.c:141:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buffer[FEATURE_BUFFER_SIZE]; data/libopenhmd-0.3.0/src/drv_3glasses/xgvr.c:268:13: [2] (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). Risk is low because the source is a constant string. strcpy(desc->driver, "OpenHMD 3Glasses Driver"); data/libopenhmd-0.3.0/src/drv_3glasses/xgvr.c:269:13: [2] (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). Risk is low because the source is a constant string. strcpy(desc->vendor, "3Glasses"); data/libopenhmd-0.3.0/src/drv_android/android.c:236:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->driver, "OpenHMD Generic Android Driver"); data/libopenhmd-0.3.0/src/drv_android/android.c:237:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->vendor, "OpenHMD"); data/libopenhmd-0.3.0/src/drv_android/android.c:238:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->product, "Android Device"); data/libopenhmd-0.3.0/src/drv_android/android.c:240:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->path, "(none)"); data/libopenhmd-0.3.0/src/drv_deepoon/deepoon.c:67: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[FEATURE_BUFFER_SIZE]; data/libopenhmd-0.3.0/src/drv_deepoon/deepoon.c:123:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buffer[FEATURE_BUFFER_SIZE]; data/libopenhmd-0.3.0/src/drv_deepoon/deepoon.c:218: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[FEATURE_BUFFER_SIZE]; data/libopenhmd-0.3.0/src/drv_deepoon/deepoon.c:286:4: [2] (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). Risk is low because the source is a constant string. strcpy(desc->driver, "Deepoon Driver"); data/libopenhmd-0.3.0/src/drv_deepoon/deepoon.c:287:4: [2] (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). Risk is low because the source is a constant string. strcpy(desc->vendor, "Deepoon"); data/libopenhmd-0.3.0/src/drv_deepoon/deepoon.c:288:4: [2] (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). Risk is low because the source is a constant string. strcpy(desc->product, "Deepoon E2"); data/libopenhmd-0.3.0/src/drv_dummy/dummy.c:126:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->driver, "OpenHMD Null Driver"); data/libopenhmd-0.3.0/src/drv_dummy/dummy.c:127:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->vendor, "OpenHMD"); data/libopenhmd-0.3.0/src/drv_dummy/dummy.c:128:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->product, "HMD Null Device"); data/libopenhmd-0.3.0/src/drv_dummy/dummy.c:130:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->path, "(none)"); data/libopenhmd-0.3.0/src/drv_dummy/dummy.c:143:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->driver, "OpenHMD Null Driver"); data/libopenhmd-0.3.0/src/drv_dummy/dummy.c:144:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->vendor, "OpenHMD"); data/libopenhmd-0.3.0/src/drv_dummy/dummy.c:145:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->product, "Left Controller Null Device"); data/libopenhmd-0.3.0/src/drv_dummy/dummy.c:147:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->path, "(none)"); data/libopenhmd-0.3.0/src/drv_dummy/dummy.c:164:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->driver, "OpenHMD Null Driver"); data/libopenhmd-0.3.0/src/drv_dummy/dummy.c:165:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->vendor, "OpenHMD"); data/libopenhmd-0.3.0/src/drv_dummy/dummy.c:166:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->product, "Right Controller Null Device"); data/libopenhmd-0.3.0/src/drv_dummy/dummy.c:168:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->path, "(none)"); data/libopenhmd-0.3.0/src/drv_external/external.c:111:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->driver, "OpenHMD Generic External Driver"); data/libopenhmd-0.3.0/src/drv_external/external.c:112:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->vendor, "OpenHMD"); data/libopenhmd-0.3.0/src/drv_external/external.c:113:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->product, "External Device"); data/libopenhmd-0.3.0/src/drv_external/external.c:115:2: [2] (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). Risk is low because the source is a constant string. strcpy(desc->path, "(none)"); data/libopenhmd-0.3.0/src/drv_htc_vive/magic.h:12:23: [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 const unsigned char vive_magic_power_on[64] = { data/libopenhmd-0.3.0/src/drv_htc_vive/magic.h:20:23: [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 const unsigned char vive_magic_power_off1[64] = { data/libopenhmd-0.3.0/src/drv_htc_vive/magic.h:28:23: [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 const unsigned char vive_magic_power_off2[64] = { data/libopenhmd-0.3.0/src/drv_htc_vive/magic.h:36:23: [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 const unsigned char vive_magic_enable_lighthouse[5] = { data/libopenhmd-0.3.0/src/drv_htc_vive/magic.h:40:23: [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 const unsigned char vive_pro_magic_power_on[64] = { data/libopenhmd-0.3.0/src/drv_htc_vive/magic.h:51:23: [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 const unsigned char vive_pro_magic_power_off[64] = { data/libopenhmd-0.3.0/src/drv_htc_vive/magic.h:62:23: [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 const unsigned char vive_pro_enable_imu[64] = { data/libopenhmd-0.3.0/src/drv_htc_vive/packet.c:116: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 output[32768]; data/libopenhmd-0.3.0/src/drv_htc_vive/vive.c:129:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buffer[FEATURE_BUFFER_SIZE]; data/libopenhmd-0.3.0/src/drv_htc_vive/vive.c:258:2: [2] (buffer) wchar_t: 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. wchar_t wbuffer[512] = {0}; data/libopenhmd-0.3.0/src/drv_htc_vive/vive.c:259: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 buffer[1024] = {0}; data/libopenhmd-0.3.0/src/drv_htc_vive/vive.c:272:2: [2] (buffer) wchar_t: 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. wchar_t wbuffer[512] = {0}; data/libopenhmd-0.3.0/src/drv_htc_vive/vive.c:273: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 buffer[1024] = {0}; data/libopenhmd-0.3.0/src/drv_htc_vive/vive.c:330:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buffer[128]; data/libopenhmd-0.3.0/src/drv_htc_vive/vive.c:353:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((uint8_t*)packet_buffer + offset, buffer+2, buffer[1]); data/libopenhmd-0.3.0/src/drv_htc_vive/vive.c:369: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 buffer[64]; data/libopenhmd-0.3.0/src/drv_htc_vive/vive.c:426:12: [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 idx = atoi(desc->path); data/libopenhmd-0.3.0/src/drv_htc_vive/vive.c:603:3: [2] (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). Risk is low because the source is a constant string. strcpy(desc->driver, "OpenHMD HTC Vive Driver"); data/libopenhmd-0.3.0/src/drv_htc_vive/vive.c:604:3: [2] (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). Risk is low because the source is a constant string. strcpy(desc->vendor, "HTC/Valve"); data/libopenhmd-0.3.0/src/drv_htc_vive/vive.c:605:3: [2] (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). Risk is low because the source is a constant string. strcpy(desc->product, "HTC Vive"); data/libopenhmd-0.3.0/src/drv_htc_vive/vive.h:47: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 config_data[99999]; data/libopenhmd-0.3.0/src/drv_nolo/nolo.c:73:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buffer[FEATURE_BUFFER_SIZE]; data/libopenhmd-0.3.0/src/drv_nolo/nolo.c:372:4: [2] (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). Risk is low because the source is a constant string. strcpy(desc->driver, "OpenHMD NOLO VR CV1 driver"); data/libopenhmd-0.3.0/src/drv_nolo/nolo.c:373:4: [2] (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). Risk is low because the source is a constant string. strcpy(desc->vendor, "LYRobotix"); data/libopenhmd-0.3.0/src/drv_nolo/nolo.c:389:4: [2] (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). Risk is low because the source is a constant string. strcpy(desc->driver, "OpenHMD NOLO VR CV1 driver"); data/libopenhmd-0.3.0/src/drv_nolo/nolo.c:390:4: [2] (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). Risk is low because the source is a constant string. strcpy(desc->vendor, "LYRobotix"); data/libopenhmd-0.3.0/src/drv_nolo/nolo.c:391:4: [2] (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). Risk is low because the source is a constant string. strcpy(desc->product, "NOLO CV1: Controller 0"); data/libopenhmd-0.3.0/src/drv_nolo/nolo.c:408:4: [2] (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). Risk is low because the source is a constant string. strcpy(desc->driver, "OpenHMD NOLO VR CV1 driver"); data/libopenhmd-0.3.0/src/drv_nolo/nolo.c:409:4: [2] (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). Risk is low because the source is a constant string. strcpy(desc->vendor, "LYRobotix"); data/libopenhmd-0.3.0/src/drv_nolo/nolo.c:410:4: [2] (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). Risk is low because the source is a constant string. strcpy(desc->product, "NOLO CV1: Controller 1"); data/libopenhmd-0.3.0/src/drv_nolo/nolo.h:50: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[OHMD_STR_SIZE]; data/libopenhmd-0.3.0/src/drv_oculus_rift/rift.c:87: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[FEATURE_BUFFER_SIZE]; data/libopenhmd-0.3.0/src/drv_oculus_rift/rift.c:152:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buffer[FEATURE_BUFFER_SIZE]; data/libopenhmd-0.3.0/src/drv_oculus_rift/rift.c:253: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[FEATURE_BUFFER_SIZE]; data/libopenhmd-0.3.0/src/drv_oculus_rift/rift.c:446:5: [2] (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). Risk is low because the source is a constant string. strcpy(desc->driver, "OpenHMD Rift Driver"); data/libopenhmd-0.3.0/src/drv_oculus_rift/rift.c:447:5: [2] (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). Risk is low because the source is a constant string. strcpy(desc->vendor, "Oculus VR, Inc."); data/libopenhmd-0.3.0/src/drv_oculus_rift/rift.h:58:23: [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 const unsigned char rift_enable_leds_dk2[17] = { data/libopenhmd-0.3.0/src/drv_oculus_rift/rift.h:62:23: [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 const unsigned char rift_enable_leds_cv1[17] = { data/libopenhmd-0.3.0/src/drv_psvr/psvr.c:133:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buffer[FEATURE_BUFFER_SIZE]; data/libopenhmd-0.3.0/src/drv_psvr/psvr.c:237:12: [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 idx = atoi(desc->path); data/libopenhmd-0.3.0/src/drv_psvr/psvr.c:341:4: [2] (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). Risk is low because the source is a constant string. strcpy(desc->driver, "OpenHMD Sony PSVR Driver"); data/libopenhmd-0.3.0/src/drv_psvr/psvr.c:342:4: [2] (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). Risk is low because the source is a constant string. strcpy(desc->vendor, "Sony"); data/libopenhmd-0.3.0/src/drv_psvr/psvr.c:343:4: [2] (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). Risk is low because the source is a constant string. strcpy(desc->product, "PSVR"); data/libopenhmd-0.3.0/src/drv_psvr/psvr.h:43:23: [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 const unsigned char psvr_cinematicmode_on[8] = { data/libopenhmd-0.3.0/src/drv_psvr/psvr.h:47:23: [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 const unsigned char psvr_vrmode_on[8] = { data/libopenhmd-0.3.0/src/drv_psvr/psvr.h:51:23: [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 const unsigned char psvr_tracking_on[12] = { data/libopenhmd-0.3.0/src/drv_psvr/psvr.h:56:23: [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 const unsigned char psvr_power_on[8] = { data/libopenhmd-0.3.0/src/drv_wmr/wmr.c:111:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buffer[FEATURE_BUFFER_SIZE]; data/libopenhmd-0.3.0/src/drv_wmr/wmr.c:208: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 cmd[64] = { 0x02, type }; data/libopenhmd-0.3.0/src/drv_wmr/wmr.c:225: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[33]; data/libopenhmd-0.3.0/src/drv_wmr/wmr.c:255:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data + offset, buf + 3, buf[2]); data/libopenhmd-0.3.0/src/drv_wmr/wmr.c:273: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 meta[84]; data/libopenhmd-0.3.0/src/drv_wmr/wmr.c:343:12: [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 idx = atoi(desc->path); data/libopenhmd-0.3.0/src/drv_wmr/wmr.c:472:3: [2] (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). Risk is low because the source is a constant string. strcpy(desc->driver, "OpenHMD Windows Mixed Reality Driver"); data/libopenhmd-0.3.0/src/drv_wmr/wmr.c:473:3: [2] (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). Risk is low because the source is a constant string. strcpy(desc->vendor, "Microsoft"); data/libopenhmd-0.3.0/src/drv_wmr/wmr.c:474:3: [2] (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). Risk is low because the source is a constant string. strcpy(desc->product, "HoloLens Sensors"); data/libopenhmd-0.3.0/src/drv_wmr/wmr.h:36:23: [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 const unsigned char hololens_sensors_imu_on[64] = { data/libopenhmd-0.3.0/src/drv_wmr/wmr.h:43:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char manufacturer[0x40]; data/libopenhmd-0.3.0/src/drv_wmr/wmr.h:44:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char device[0x40]; data/libopenhmd-0.3.0/src/drv_wmr/wmr.h:45:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char serial[0x40]; data/libopenhmd-0.3.0/src/drv_wmr/wmr.h:46:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char uid[0x26]; data/libopenhmd-0.3.0/src/drv_wmr/wmr.h:47:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char unk[0xd5]; data/libopenhmd-0.3.0/src/drv_wmr/wmr.h:48:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[0x40]; data/libopenhmd-0.3.0/src/drv_wmr/wmr.h:49:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char revision[0x20]; data/libopenhmd-0.3.0/src/drv_wmr/wmr.h:50:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char revision_date[0x20]; data/libopenhmd-0.3.0/src/ext_deps/miniz.c:517: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 m_filename[MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE]; data/libopenhmd-0.3.0/src/ext_deps/miniz.c:518: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 m_comment[MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE]; data/libopenhmd-0.3.0/src/ext_deps/miniz.c:932:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. typedef unsigned char mz_validate_uint16[sizeof(mz_uint16)==2 ? 1 : -1]; data/libopenhmd-0.3.0/src/ext_deps/miniz.c:933:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. typedef unsigned char mz_validate_uint32[sizeof(mz_uint32)==4 ? 1 : -1]; data/libopenhmd-0.3.0/src/ext_deps/miniz.c:934:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. typedef unsigned char mz_validate_uint64[sizeof(mz_uint64)==8 ? 1 : -1]; data/libopenhmd-0.3.0/src/ext_deps/miniz.c:1260:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n); data/libopenhmd-0.3.0/src/ext_deps/miniz.c:1280:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n); data/libopenhmd-0.3.0/src/ext_deps/miniz.c:1360:31: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define TINFL_MEMCPY(d, s, l) memcpy(d, s, l) data/libopenhmd-0.3.0/src/ext_deps/miniz.c:1949:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(code_sizes_to_pack, &d->m_huff_code_sizes[0][0], num_lit_codes); data/libopenhmd-0.3.0/src/ext_deps/miniz.c:1950:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(code_sizes_to_pack + num_lit_codes, &d->m_huff_code_sizes[1][0], num_dist_codes); data/libopenhmd-0.3.0/src/ext_deps/miniz.c:2246:7: [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((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs, d->m_output_buf, bytes_to_copy); data/libopenhmd-0.3.0/src/ext_deps/miniz.c:2347:7: [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(d->m_dict + dst_pos, d->m_pSrc, n); data/libopenhmd-0.3.0/src/ext_deps/miniz.c:2349:9: [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(d->m_dict + TDEFL_LZ_DICT_SIZE + dst_pos, d->m_pSrc, MZ_MIN(n, (TDEFL_MAX_MATCH_LEN - 1) - dst_pos)); data/libopenhmd-0.3.0/src/ext_deps/miniz.c:2625:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs, d->m_output_buf + d->m_output_flush_ofs, n); data/libopenhmd-0.3.0/src/ext_deps/miniz.c:2753:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((mz_uint8*)p->m_pBuf + p->m_size, pBuf, len); p->m_size = new_size; data/libopenhmd-0.3.0/src/ext_deps/miniz.c:2823:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out_buf.m_pBuf, pnghdr, 41); data/libopenhmd-0.3.0/src/ext_deps/miniz.c:2885:28: [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). #define MZ_FOPEN(f, m) fopen(f, m) data/libopenhmd-0.3.0/src/ext_deps/miniz.c:2901:28: [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). #define MZ_FOPEN(f, m) fopen(f, m) data/libopenhmd-0.3.0/src/ext_deps/miniz.c:2933:28: [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). #define MZ_FOPEN(f, m) fopen(f, m) data/libopenhmd-0.3.0/src/ext_deps/miniz.c:3026:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((mz_uint8*)pArray->m_p + orig_size * pArray->m_element_size, pElements, n * pArray->m_element_size); data/libopenhmd-0.3.0/src/ext_deps/miniz.c:3287:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(pBuf, (const mz_uint8 *)pZip->m_pState->m_pMem + file_ofs, s); data/libopenhmd-0.3.0/src/ext_deps/miniz.c:3425:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(pStat->m_filename, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, n); pStat->m_filename[n] = '\0'; data/libopenhmd-0.3.0/src/ext_deps/miniz.c:3429:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(pStat->m_comment, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS) + MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS), n); pStat->m_comment[n] = '\0'; data/libopenhmd-0.3.0/src/ext_deps/miniz.c:3443:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(pFilename, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, n); data/libopenhmd-0.3.0/src/ext_deps/miniz.c:4021:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((mz_uint8 *)pState->m_pMem + file_ofs, pBuf, n); data/libopenhmd-0.3.0/src/ext_deps/miniz.c:4069:28: [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. mz_uint64 cur_ofs = 0; char buf[4096]; MZ_CLEAR_OBJ(buf); data/libopenhmd-0.3.0/src/ext_deps/miniz.c:4249:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[4096]; data/libopenhmd-0.3.0/src/ext_deps/miniz.c:4686:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(central_header, pSrc_central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE); data/libopenhmd-0.3.0/src/hid.h:12: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 bus [5]; data/libopenhmd-0.3.0/src/hid.h:13: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 dev [5]; data/libopenhmd-0.3.0/src/hid.h:16:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (bus, "%.*s", 4, path); data/libopenhmd-0.3.0/src/hid.h:17:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (dev, "%.*s", 4, path + 5); data/libopenhmd-0.3.0/src/hid.h:19:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (result, "/dev/bus/usb/%03d/%03d", data/libopenhmd-0.3.0/src/openhmd.c:464:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, device->properties.controls_types, device->properties.control_count * sizeof(int)); data/libopenhmd-0.3.0/src/openhmd.c:468:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, device->properties.controls_hints, device->properties.control_count * sizeof(int)); data/libopenhmd-0.3.0/src/openhmdi.h:37: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 driver[OHMD_STR_SIZE]; data/libopenhmd-0.3.0/src/openhmdi.h:38: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 vendor[OHMD_STR_SIZE]; data/libopenhmd-0.3.0/src/openhmdi.h:39: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 product[OHMD_STR_SIZE]; data/libopenhmd-0.3.0/src/openhmdi.h:40: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[OHMD_STR_SIZE]; data/libopenhmd-0.3.0/src/openhmdi.h: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 error_msg[OHMD_STR_SIZE]; data/libopenhmd-0.3.0/src/platform-posix.c:184: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 comp[6]; data/libopenhmd-0.3.0/src/platform-posix.c:185:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(comp,":0%d",endpoint); data/libopenhmd-0.3.0/src/platform-win32.c:126: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 comp[8]; data/libopenhmd-0.3.0/src/platform-win32.c:127:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(comp,"mi_0%d",endpoint); data/libopenhmd-0.3.0/src/ext_deps/miniz.c:3483:41: [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). const mz_uint filename_len = (mz_uint)strlen(pFilename); data/libopenhmd-0.3.0/src/ext_deps/miniz.c:3505:14: [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). name_len = strlen(pName); if (name_len > 0xFFFF) return -1; data/libopenhmd-0.3.0/src/ext_deps/miniz.c:3506:28: [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). comment_len = pComment ? strlen(pComment) : 0; if (comment_len > 0xFFFF) return -1; data/libopenhmd-0.3.0/src/ext_deps/miniz.c:4297: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). archive_name_size = strlen(pArchive_name); data/libopenhmd-0.3.0/src/ext_deps/miniz.c:4432: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). archive_name_size = strlen(pArchive_name); data/libopenhmd-0.3.0/tests/unittests/main.c:18:70: [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). #define Test(_t) printf(" "#_t); _t(); printf("%*sok\n", 50 - (int)strlen(#_t), ""); ANALYSIS SUMMARY: Hits = 165 Lines analyzed = 14999 in approximately 0.50 seconds (29864 lines/second) Physical Source Lines of Code (SLOC) = 10884 Hits@level = [0] 87 [1] 6 [2] 143 [3] 1 [4] 15 [5] 0 Hits@level+ = [0+] 252 [1+] 165 [2+] 159 [3+] 16 [4+] 15 [5+] 0 Hits/KSLOC@level+ = [0+] 23.1533 [1+] 15.1599 [2+] 14.6086 [3+] 1.47005 [4+] 1.37817 [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.