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/zookeeper-3.4.13/src/c/src/st_adaptor.c Examining data/zookeeper-3.4.13/src/c/src/zk_log.c Examining data/zookeeper-3.4.13/src/c/src/zk_hashtable.c Examining data/zookeeper-3.4.13/src/c/src/load_gen.c Examining data/zookeeper-3.4.13/src/c/src/winport.h Examining data/zookeeper-3.4.13/src/c/src/recordio.c Examining data/zookeeper-3.4.13/src/c/src/zk_hashtable.h Examining data/zookeeper-3.4.13/src/c/src/winport.c Examining data/zookeeper-3.4.13/src/c/src/mt_adaptor.c Examining data/zookeeper-3.4.13/src/c/src/hashtable/hashtable_itr.c Examining data/zookeeper-3.4.13/src/c/src/hashtable/hashtable.c Examining data/zookeeper-3.4.13/src/c/src/hashtable/hashtable.h Examining data/zookeeper-3.4.13/src/c/src/hashtable/hashtable_itr.h Examining data/zookeeper-3.4.13/src/c/src/hashtable/hashtable_private.h Examining data/zookeeper-3.4.13/src/c/src/zk_adaptor.h Examining data/zookeeper-3.4.13/src/c/src/zookeeper.c Examining data/zookeeper-3.4.13/src/c/src/cli.c Examining data/zookeeper-3.4.13/src/c/include/winconfig.h Examining data/zookeeper-3.4.13/src/c/include/zookeeper.h Examining data/zookeeper-3.4.13/src/c/include/proto.h Examining data/zookeeper-3.4.13/src/c/include/zookeeper_log.h Examining data/zookeeper-3.4.13/src/c/include/zookeeper_version.h Examining data/zookeeper-3.4.13/src/c/include/recordio.h Examining data/zookeeper-3.4.13/src/c/tests/LibCMocks.cc Examining data/zookeeper-3.4.13/src/c/tests/LibCMocks.h Examining data/zookeeper-3.4.13/src/c/tests/TestClientRetry.cc Examining data/zookeeper-3.4.13/src/c/tests/LibCSymTable.cc Examining data/zookeeper-3.4.13/src/c/tests/CppAssertHelper.h Examining data/zookeeper-3.4.13/src/c/tests/TestOperations.cc Examining data/zookeeper-3.4.13/src/c/tests/Vector.h Examining data/zookeeper-3.4.13/src/c/tests/ZKMocks.cc Examining data/zookeeper-3.4.13/src/c/tests/PthreadMocks.cc Examining data/zookeeper-3.4.13/src/c/tests/LibCSymTable.h Examining data/zookeeper-3.4.13/src/c/tests/ZKMocks.h Examining data/zookeeper-3.4.13/src/c/tests/Util.h Examining data/zookeeper-3.4.13/src/c/tests/CollectionUtil.h Examining data/zookeeper-3.4.13/src/c/tests/TestZookeeperClose.cc Examining data/zookeeper-3.4.13/src/c/tests/TestZookeeperInit.cc Examining data/zookeeper-3.4.13/src/c/tests/ThreadingUtil.h Examining data/zookeeper-3.4.13/src/c/tests/Util.cc Examining data/zookeeper-3.4.13/src/c/tests/TestWatchers.cc Examining data/zookeeper-3.4.13/src/c/tests/PthreadMocks.h Examining data/zookeeper-3.4.13/src/c/tests/TestMulti.cc Examining data/zookeeper-3.4.13/src/c/tests/MocksBase.cc Examining data/zookeeper-3.4.13/src/c/tests/ThreadingUtil.cc Examining data/zookeeper-3.4.13/src/c/tests/MocksBase.h Examining data/zookeeper-3.4.13/src/c/tests/TestDriver.cc Examining data/zookeeper-3.4.13/src/c/tests/TestClient.cc Examining data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkfuse.cc Examining data/zookeeper-3.4.13/src/contrib/zkfuse/src/log.cc Examining data/zookeeper-3.4.13/src/contrib/zkfuse/src/event.cc Examining data/zookeeper-3.4.13/src/contrib/zkfuse/src/thread.cc Examining data/zookeeper-3.4.13/src/contrib/zkfuse/src/thread.h Examining data/zookeeper-3.4.13/src/contrib/zkfuse/src/blockingqueue.h Examining data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkadapter.h Examining data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkadapter.cc Examining data/zookeeper-3.4.13/src/contrib/zkfuse/src/log.h Examining data/zookeeper-3.4.13/src/contrib/zkfuse/src/mutex.h Examining data/zookeeper-3.4.13/src/contrib/zkfuse/src/event.h Examining data/zookeeper-3.4.13/src/contrib/zkpython/src/c/pyzk_docstrings.h Examining data/zookeeper-3.4.13/src/contrib/zkpython/src/c/zookeeper.c Examining data/zookeeper-3.4.13/src/contrib/zkperl/build/check_zk_version.c Examining data/zookeeper-3.4.13/src/contrib/zkperl/build/check_zk_version.h Examining data/zookeeper-3.4.13/src/contrib/zktreeutil/src/SimpleTree.h Examining data/zookeeper-3.4.13/src/contrib/zktreeutil/src/ZkTreeUtil.cc Examining data/zookeeper-3.4.13/src/contrib/zktreeutil/src/ZkTreeUtil.h Examining data/zookeeper-3.4.13/src/contrib/zktreeutil/src/ZkAdaptor.h Examining data/zookeeper-3.4.13/src/contrib/zktreeutil/src/ZkTreeUtilMain.cc Examining data/zookeeper-3.4.13/src/contrib/zktreeutil/src/ZkAdaptor.cc Examining data/zookeeper-3.4.13/src/recipes/queue/src/c/src/zoo_queue.c Examining data/zookeeper-3.4.13/src/recipes/queue/src/c/include/zoo_queue.h Examining data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc Examining data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/Util.h Examining data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/Util.cc Examining data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestDriver.cc Examining data/zookeeper-3.4.13/src/recipes/lock/src/c/src/zoo_lock.c Examining data/zookeeper-3.4.13/src/recipes/lock/src/c/include/zoo_lock.h Examining data/zookeeper-3.4.13/src/recipes/lock/src/c/tests/TestClient.cc Examining data/zookeeper-3.4.13/src/recipes/lock/src/c/tests/Util.h Examining data/zookeeper-3.4.13/src/recipes/lock/src/c/tests/Util.cc Examining data/zookeeper-3.4.13/src/recipes/lock/src/c/tests/TestDriver.cc FINAL RESULTS: data/zookeeper-3.4.13/src/c/src/winport.h:46: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/zookeeper-3.4.13/src/c/src/winport.h:46: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/zookeeper-3.4.13/src/c/src/zk_log.c:164:5: [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, FORMAT_LOG_BUF_SIZE-1,format,va); data/zookeeper-3.4.13/src/c/src/zookeeper.c:774:48: [4] (misc) getlogin: It's often easy to fool getlogin. Sometimes it does not work at all, because some program messed up the utmp file. Often, it gives only the first 8 characters of the login name. The user currently logged in on the controlling tty of our program need not be the user who started it. Avoid getlogin() for security-related purposes (CWE-807). Use getpwuid(geteuid()) and extract the desired information instead. LOG_INFO(("Client environment:user.name=%s", getlogin())); data/zookeeper-3.4.13/src/c/src/zookeeper.c:932: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(ret_str, zh->chroot); data/zookeeper-3.4.13/src/c/src/zookeeper.c:933:12: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). return strcat(ret_str, client_path); data/zookeeper-3.4.13/src/c/src/zookeeper.c:1291:9: [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)-1,format,va); data/zookeeper-3.4.13/src/c/src/zookeeper.c:3503:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf,"%s:%d",addrstring,ntohs(port)); data/zookeeper-3.4.13/src/c/src/zookeeper.c:3506:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf,"%s:%d",addrstr,ntohs(port)); data/zookeeper-3.4.13/src/c/tests/LibCSymTable.cc:42:14: [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. LOAD_SYM(printf); data/zookeeper-3.4.13/src/c/tests/LibCSymTable.h:71:21: [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. DECLARE_SYM(int,printf,(const char*, ...)); data/zookeeper-3.4.13/src/c/tests/TestClient.cc:285:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "%s start %s", ZKSERVER_CMD, getHostPorts()); data/zookeeper-3.4.13/src/c/tests/TestClient.cc:286:24: [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. CPPUNIT_ASSERT(system(cmd) == 0); data/zookeeper-3.4.13/src/c/tests/TestClient.cc:291:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "%s stop %s", ZKSERVER_CMD, getHostPorts()); data/zookeeper-3.4.13/src/c/tests/TestClient.cc:292:24: [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. CPPUNIT_ASSERT(system(cmd) == 0); data/zookeeper-3.4.13/src/c/tests/TestClientRetry.cc:218:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "%s stop %s", ZKSERVER_CMD, getHostPorts()); data/zookeeper-3.4.13/src/c/tests/TestClientRetry.cc:219:24: [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. CPPUNIT_ASSERT(system(cmd) == 0); data/zookeeper-3.4.13/src/c/tests/TestClientRetry.cc:222:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "export ZKMAXCNXNS=1;%s startClean %s", ZKSERVER_CMD, getHostPorts()); data/zookeeper-3.4.13/src/c/tests/TestClientRetry.cc:223:24: [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. CPPUNIT_ASSERT(system(cmd) == 0); data/zookeeper-3.4.13/src/c/tests/TestClientRetry.cc:235:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "%s stop %s", ZKSERVER_CMD, getHostPorts()); data/zookeeper-3.4.13/src/c/tests/TestClientRetry.cc:236:24: [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. CPPUNIT_ASSERT(system(cmd) == 0); data/zookeeper-3.4.13/src/c/tests/TestClientRetry.cc:239:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "%s startClean %s", ZKSERVER_CMD, getHostPorts()); data/zookeeper-3.4.13/src/c/tests/TestClientRetry.cc:240:24: [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. CPPUNIT_ASSERT(system(cmd) == 0); data/zookeeper-3.4.13/src/c/tests/TestDriver.cc:105:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "%s startClean %s", ZKSERVER_CMD, "127.0.0.1:22181"); data/zookeeper-3.4.13/src/c/tests/TestDriver.cc:106:24: [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. CPPUNIT_ASSERT(system(cmd) == 0); data/zookeeper-3.4.13/src/c/tests/TestDriver.cc:116:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "%s stop %s", ZKSERVER_CMD, "127.0.0.1:22181"); data/zookeeper-3.4.13/src/c/tests/TestDriver.cc:117:24: [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. CPPUNIT_ASSERT(system(cmd) == 0); data/zookeeper-3.4.13/src/contrib/zkfuse/src/log.h:52:5: [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. snprintf( buffer, MAX_BUFFER_SIZE, fmt, ##args ); data/zookeeper-3.4.13/src/recipes/lock/src/c/src/zoo_lock.c:86:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s/%s", mutex->path, mutex->id); data/zookeeper-3.4.13/src/recipes/lock/src/c/src/zoo_lock.c:292:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(last_child, "%s/%s",mutex->path, lessthanme); data/zookeeper-3.4.13/src/recipes/lock/src/c/tests/TestClient.cc:138:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "%s startClean %s", ZKSERVER_CMD, getHostPorts()); data/zookeeper-3.4.13/src/recipes/lock/src/c/tests/TestClient.cc:139:24: [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. CPPUNIT_ASSERT(system(cmd) == 0); data/zookeeper-3.4.13/src/recipes/lock/src/c/tests/TestClient.cc:145:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "%s start %s", ZKSERVER_CMD, getHostPorts()); data/zookeeper-3.4.13/src/recipes/lock/src/c/tests/TestClient.cc:146:24: [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. CPPUNIT_ASSERT(system(cmd) == 0); data/zookeeper-3.4.13/src/recipes/lock/src/c/tests/TestClient.cc:156:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "%s stop %s", ZKSERVER_CMD, getHostPorts()); data/zookeeper-3.4.13/src/recipes/lock/src/c/tests/TestClient.cc:157:24: [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. CPPUNIT_ASSERT(system(cmd) == 0); data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:189:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "%s startClean %s", ZKSERVER_CMD, getHostPorts()); data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:190:28: [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. CPPUNIT_ASSERT(system(cmd) == 0); data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:196:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "%s start %s", ZKSERVER_CMD, getHostPorts()); data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:197:24: [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. CPPUNIT_ASSERT(system(cmd) == 0); data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:207:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "%s stop %s", ZKSERVER_CMD, getHostPorts()); data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:208:28: [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. CPPUNIT_ASSERT(system(cmd) == 0); data/zookeeper-3.4.13/src/c/src/load_gen.c:109:10: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. char realpath[1024]; data/zookeeper-3.4.13/src/c/src/load_gen.c:110:63: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. return zoo_create(zh,root,"root",4,&ZOO_OPEN_ACL_UNSAFE,0,realpath,sizeof(realpath)-1); data/zookeeper-3.4.13/src/c/src/load_gen.c:110:79: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. return zoo_create(zh,root,"root",4,&ZOO_OPEN_ACL_UNSAFE,0,realpath,sizeof(realpath)-1); data/zookeeper-3.4.13/src/c/src/winport.c:101:3: [3] (misc) InitializeCriticalSection: Exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. InitializeCriticalSection (&cv->waiters_count_lock_); data/zookeeper-3.4.13/src/c/src/winport.c:123:3: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection (& (cv->waiters_count_lock_)); data/zookeeper-3.4.13/src/c/src/winport.c:141:3: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection (&cv->waiters_count_lock_); data/zookeeper-3.4.13/src/c/src/winport.c:175:3: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection (&cv->waiters_count_lock_); data/zookeeper-3.4.13/src/c/src/winport.c:185:3: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection (&cv->waiters_count_lock_); data/zookeeper-3.4.13/src/c/src/zk_adaptor.h:229:11: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. char *chroot; data/zookeeper-3.4.13/src/c/src/zookeeper.c:83:9: [3] (random) random: 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. #define random rand /* replace POSIX random with Windows rand */ data/zookeeper-3.4.13/src/c/src/zookeeper.c:435:13: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. if (zh->chroot != 0) { data/zookeeper-3.4.13/src/c/src/zookeeper.c:436:18: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. free(zh->chroot); data/zookeeper-3.4.13/src/c/src/zookeeper.c:472:5: [3] (random) srandom: 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. srandom(seed); data/zookeeper-3.4.13/src/c/src/zookeeper.c:691:26: [3] (random) random: 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. long int j = random()%(i+1); data/zookeeper-3.4.13/src/c/src/zookeeper.c:856:24: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. if (strlen(zh->chroot) == 1) { data/zookeeper-3.4.13/src/c/src/zookeeper.c:857:22: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. free(zh->chroot); data/zookeeper-3.4.13/src/c/src/zookeeper.c:870:13: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. if (zh->chroot && !isValidPath(zh->chroot, 0)) { data/zookeeper-3.4.13/src/c/src/zookeeper.c:870:40: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. if (zh->chroot && !isValidPath(zh->chroot, 0)) { data/zookeeper-3.4.13/src/c/src/zookeeper.c:929:27: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. return strdup(zh->chroot); data/zookeeper-3.4.13/src/c/src/zookeeper.c:931:42: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. ret_str = (char *) malloc(strlen(zh->chroot) + strlen(client_path) + 1); data/zookeeper-3.4.13/src/c/src/zookeeper.c:932:25: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. strcpy(ret_str, zh->chroot); data/zookeeper-3.4.13/src/c/src/zookeeper.c:945:34: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. if (strncmp(server_path, zh->chroot, strlen(zh->chroot)) != 0) { data/zookeeper-3.4.13/src/c/src/zookeeper.c:945:53: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. if (strncmp(server_path, zh->chroot, strlen(zh->chroot)) != 0) { data/zookeeper-3.4.13/src/c/src/zookeeper.c:947:37: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. server_path, zh->chroot)); data/zookeeper-3.4.13/src/c/src/zookeeper.c:950:43: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. if (strlen(server_path) == strlen(zh->chroot)) { data/zookeeper-3.4.13/src/c/src/zookeeper.c:955:47: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. ret_str = strdup(server_path + strlen(zh->chroot)); data/zookeeper-3.4.13/src/c/tests/LibCMocks.cc:170:17: [3] (random) random: 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. RANDOM_RET_TYPE random(){ data/zookeeper-3.4.13/src/c/tests/LibCMocks.cc:172:29: [3] (random) random: 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. return LIBC_SYMBOLS.random(); data/zookeeper-3.4.13/src/c/tests/LibCMocks.cc:176:6: [3] (random) srandom: 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. void srandom(unsigned long seed){ data/zookeeper-3.4.13/src/c/tests/LibCMocks.cc:178:22: [3] (random) srandom: 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. LIBC_SYMBOLS.srandom(seed); data/zookeeper-3.4.13/src/c/tests/LibCSymTable.cc:40:14: [3] (random) random: 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. LOAD_SYM(random); data/zookeeper-3.4.13/src/c/tests/LibCSymTable.cc:41:14: [3] (random) srandom: 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. LOAD_SYM(srandom); data/zookeeper-3.4.13/src/c/tests/LibCSymTable.h:69:33: [3] (random) random: 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. DECLARE_SYM(RANDOM_RET_TYPE,random,(void)); data/zookeeper-3.4.13/src/c/tests/LibCSymTable.h:70:22: [3] (random) srandom: 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. DECLARE_SYM(void,srandom,(unsigned long)); data/zookeeper-3.4.13/src/c/tests/TestClient.cc:255:60: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. zhandle_t *createchClient(watchctx_t *ctx, const char* chroot) { data/zookeeper-3.4.13/src/c/tests/TestClient.cc:256:40: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. zhandle_t *zk = zookeeper_init(chroot, watcher, 10000, 0, ctx, 0); data/zookeeper-3.4.13/src/c/tests/TestOperations.cc:557:14: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. char realpath[1024]; data/zookeeper-3.4.13/src/c/tests/TestOperations.cc:558:67: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. int rc=zoo_create(lzh,"/xyz","1",1,&ZOO_OPEN_ACL_UNSAFE,0,realpath,sizeof(realpath)-1); data/zookeeper-3.4.13/src/c/tests/TestOperations.cc:558:83: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. int rc=zoo_create(lzh,"/xyz","1",1,&ZOO_OPEN_ACL_UNSAFE,0,realpath,sizeof(realpath)-1); data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkfuse.cc:4325:13: [3] (buffer) getopt_long: 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. c = getopt_long(argc, argv, shortOptions, longOptions, 0); data/zookeeper-3.4.13/src/contrib/zktreeutil/src/ZkTreeUtilMain.cc:149:18: [3] (buffer) getopt_long: 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. int c = getopt_long(argc, argv, short_options, long_options, 0); data/zookeeper-3.4.13/src/c/include/zookeeper.h:263:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char passwd[16]; data/zookeeper-3.4.13/src/c/src/cli.c:59: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 cmd[1024]; data/zookeeper-3.4.13/src/c/src/cli.c:132:32: [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 *fh = fopen(clientIdFile, "w"); data/zookeeper-3.4.13/src/c/src/cli.c:159:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tctimes[40]; data/zookeeper-3.4.13/src/c/src/cli.c:160:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmtimes[40]; data/zookeeper-3.4.13/src/c/src/cli.c:301: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 buf[4096*16]; data/zookeeper-3.4.13/src/c/src/cli.c:529:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[4096]; data/zookeeper-3.4.13/src/c/src/cli.c:530:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char p[2048]; data/zookeeper-3.4.13/src/c/src/cli.c:533:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char appId[64]; data/zookeeper-3.4.13/src/c/src/cli.c:564:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fh = fopen(clientIdFile, "r"); data/zookeeper-3.4.13/src/c/src/cli.c:574: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(appId,"yahoo.example.yca_test"); data/zookeeper-3.4.13/src/c/src/cli.c:582:7: [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(p,"dummy"); data/zookeeper-3.4.13/src/c/src/cli.c:585: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(p, "dummy"); data/zookeeper-3.4.13/src/c/src/load_gen.c:92:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nodeName[1024]; data/zookeeper-3.4.13/src/c/src/load_gen.c:109:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char realpath[1024]; data/zookeeper-3.4.13/src/c/src/load_gen.c:121:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nodeName[1024]; data/zookeeper-3.4.13/src/c/src/load_gen.c:142: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 buf[value_len+1]; data/zookeeper-3.4.13/src/c/src/load_gen.c:143: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(buf,value,value_len);buf[value_len]=0; data/zookeeper-3.4.13/src/c/src/load_gen.c:150:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nodeName[1024]; data/zookeeper-3.4.13/src/c/src/load_gen.c:168:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nodeName[1024]; data/zookeeper-3.4.13/src/c/src/load_gen.c:206: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. char nodeName[2048]; data/zookeeper-3.4.13/src/c/src/load_gen.c:261:15: [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). nodeCount=atoi(argv[3]); data/zookeeper-3.4.13/src/c/src/mt_adaptor.c:393: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. char b[128]; data/zookeeper-3.4.13/src/c/src/mt_adaptor.c:433: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. char b[128]; data/zookeeper-3.4.13/src/c/src/recordio.c:81: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(priv->buffer+priv->off, &i, sizeof(i)); data/zookeeper-3.4.13/src/c/src/recordio.c:109: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(priv->buffer+priv->off, &i, sizeof(i)); data/zookeeper-3.4.13/src/c/src/recordio.c:157: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(priv->buffer+priv->off, b->buff, b->len); data/zookeeper-3.4.13/src/c/src/recordio.c:179: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(priv->buffer+priv->off, *s, len); data/zookeeper-3.4.13/src/c/src/recordio.c:197: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(count, priv->buffer+priv->off, sizeof(*count)); data/zookeeper-3.4.13/src/c/src/recordio.c:210: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(count, priv->buffer+priv->off, sizeof(*count)); data/zookeeper-3.4.13/src/c/src/recordio.c:256: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(b->buff, priv->buffer+priv->off, b->len); data/zookeeper-3.4.13/src/c/src/recordio.c:277: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(*s, priv->buffer+priv->off, len); data/zookeeper-3.4.13/src/c/src/zk_adaptor.h:141:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char passwd[16]; data/zookeeper-3.4.13/src/c/src/zk_adaptor.h:151:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char passwd[16]; data/zookeeper-3.4.13/src/c/src/zk_adaptor.h:210:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char primer_storage_buffer[40]; /* the true size of primer_storage */ data/zookeeper-3.4.13/src/c/src/zk_log.c:78: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. static char buf[TIME_NOW_BUF_SIZE]; data/zookeeper-3.4.13/src/c/src/zk_log.c:83: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. static char buf[FORMAT_LOG_BUF_SIZE]; data/zookeeper-3.4.13/src/c/src/zk_log.c:135:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char timebuf [TIME_NOW_BUF_SIZE]; data/zookeeper-3.4.13/src/c/src/zookeeper.c:450: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). int fd = open("/dev/urandom", O_RDONLY); data/zookeeper-3.4.13/src/c/src/zookeeper.c:578:17: [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(&addr4->sin_addr, *ptr, he->h_length); data/zookeeper-3.4.13/src/c/src/zookeeper.c:589:17: [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(&addr6->sin6_addr, *ptr, he->h_length); data/zookeeper-3.4.13/src/c/src/zookeeper.c:669:17: [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(addr, res->ai_addr, res->ai_addrlen); data/zookeeper-3.4.13/src/c/src/zookeeper.c:742: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[2048]; data/zookeeper-3.4.13/src/c/src/zookeeper.c:1289: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 buf[1024]; data/zookeeper-3.4.13/src/c/src/zookeeper.c:1449: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(buffer + offset, &req->protocolVersion, sizeof(req->protocolVersion)); data/zookeeper-3.4.13/src/c/src/zookeeper.c:1453: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(buffer + offset, &req->lastZxidSeen, sizeof(req->lastZxidSeen)); data/zookeeper-3.4.13/src/c/src/zookeeper.c:1457: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(buffer + offset, &req->timeOut, sizeof(req->timeOut)); data/zookeeper-3.4.13/src/c/src/zookeeper.c:1461: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(buffer + offset, &req->sessionId, sizeof(req->sessionId)); data/zookeeper-3.4.13/src/c/src/zookeeper.c:1465: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(buffer + offset, &req->passwd_len, sizeof(req->passwd_len)); data/zookeeper-3.4.13/src/c/src/zookeeper.c:1468: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(buffer + offset, req->passwd, sizeof(req->passwd)); data/zookeeper-3.4.13/src/c/src/zookeeper.c:1504:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer_req[HANDSHAKE_REQ_SIZE]; data/zookeeper-3.4.13/src/c/src/zookeeper.c:1511: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(req.passwd, zh->client_id.passwd, sizeof(zh->client_id.passwd)); data/zookeeper-3.4.13/src/c/src/zookeeper.c:1948:17: [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(sc->u.data.buffer, res.data.buff, len); data/zookeeper-3.4.13/src/c/src/zookeeper.c:1993:17: [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(sc->u.str.str, client_path, len - 1); data/zookeeper-3.4.13/src/c/src/zookeeper.c:3098: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(result->value, value, len - 1); data/zookeeper-3.4.13/src/c/src/zookeeper.c:3455: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(auth.buff,cert,certLen); data/zookeeper-3.4.13/src/c/src/zookeeper.c:3480: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. static char buf[128 + 6]; // include space for the port :xxxxx data/zookeeper-3.4.13/src/c/src/zookeeper.c:3481:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char addrstr[128]; data/zookeeper-3.4.13/src/c/tests/LibCMocks.cc:75: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(ptr,str,len); data/zookeeper-3.4.13/src/c/tests/LibCMocks.h:182: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(optval,&optvalSO_ERROR,len); data/zookeeper-3.4.13/src/c/tests/LibCMocks.h:226: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(buf,recvReturnBuffer.data(),k); data/zookeeper-3.4.13/src/c/tests/TestClient.cc:284: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 cmd[1024]; data/zookeeper-3.4.13/src/c/tests/TestClient.cc:290: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 cmd[1024]; data/zookeeper-3.4.13/src/c/tests/TestClient.cc:320: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 buff[10] = "testall"; data/zookeeper-3.4.13/src/c/tests/TestClient.cc:321: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 path[512]; data/zookeeper-3.4.13/src/c/tests/TestClient.cc:345: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 path[80]; data/zookeeper-3.4.13/src/c/tests/TestClient.cc:346:9: [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(path, "/testping"); data/zookeeper-3.4.13/src/c/tests/TestClient.cc:351: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(path, "/testping/%i", i); data/zookeeper-3.4.13/src/c/tests/TestClient.cc:357: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(path, "/testping/%i", i); data/zookeeper-3.4.13/src/c/tests/TestClient.cc:364: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(path, "/testping/%i", i); data/zookeeper-3.4.13/src/c/tests/TestClient.cc:587: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 buf[1024]; data/zookeeper-3.4.13/src/c/tests/TestClient.cc:714: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 buffer[512]; data/zookeeper-3.4.13/src/c/tests/TestClient.cc:729: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 pathbuf[20]; data/zookeeper-3.4.13/src/c/tests/TestClient.cc:824: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 buf[60]; data/zookeeper-3.4.13/src/c/tests/TestClient.cc:907: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 path_buffer[1024]; data/zookeeper-3.4.13/src/c/tests/TestClient.cc:920: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 path[80]; data/zookeeper-3.4.13/src/c/tests/TestClient.cc:926: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(path, "/awar%d", i); data/zookeeper-3.4.13/src/c/tests/TestClient.cc:934: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(path, "/awar%d", i); data/zookeeper-3.4.13/src/c/tests/TestClient.cc:941: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(path, "/awar%d", i); data/zookeeper-3.4.13/src/c/tests/TestClient.cc:949: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(path, "/awar%d", i); data/zookeeper-3.4.13/src/c/tests/TestClient.cc:961: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(path, "/awar%d", i); data/zookeeper-3.4.13/src/c/tests/TestClient.cc:975: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 buf[1024]; data/zookeeper-3.4.13/src/c/tests/TestClientRetry.cc:217: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 cmd[1024]; data/zookeeper-3.4.13/src/c/tests/TestClientRetry.cc:234: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 cmd[1024]; data/zookeeper-3.4.13/src/c/tests/TestDriver.cc:104: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 cmd[1024]; data/zookeeper-3.4.13/src/c/tests/TestDriver.cc:115: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 cmd[1024]; data/zookeeper-3.4.13/src/c/tests/TestMulti.cc:273: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 p1[sz]; data/zookeeper-3.4.13/src/c/tests/TestMulti.cc:274: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 p2[sz]; data/zookeeper-3.4.13/src/c/tests/TestMulti.cc:275: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 p3[sz]; data/zookeeper-3.4.13/src/c/tests/TestMulti.cc:306: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 p1[sz]; data/zookeeper-3.4.13/src/c/tests/TestMulti.cc:355: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 p1[sz]; data/zookeeper-3.4.13/src/c/tests/TestMulti.cc:395: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 buf[sz]; data/zookeeper-3.4.13/src/c/tests/TestMulti.cc:398: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 p1[sz], p2[sz]; data/zookeeper-3.4.13/src/c/tests/TestMulti.cc:444: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 buf[sz]; data/zookeeper-3.4.13/src/c/tests/TestMulti.cc:446: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 p1[sz]; data/zookeeper-3.4.13/src/c/tests/TestMulti.cc:480: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 buf[sz]; data/zookeeper-3.4.13/src/c/tests/TestMulti.cc:482: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 p1[sz]; data/zookeeper-3.4.13/src/c/tests/TestMulti.cc:507: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 p1[sz], p2[sz], p3[sz]; data/zookeeper-3.4.13/src/c/tests/TestMulti.cc:539: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 p1[sz], p2[sz], p3[sz]; data/zookeeper-3.4.13/src/c/tests/TestMulti.cc:565: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 p1[sz]; data/zookeeper-3.4.13/src/c/tests/TestMulti.cc:612: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 p1[sz]; data/zookeeper-3.4.13/src/c/tests/TestMulti.cc:642: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 p1[sz]; data/zookeeper-3.4.13/src/c/tests/TestOperations.cc:557: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 realpath[1024]; data/zookeeper-3.4.13/src/c/tests/TestZookeeperInit.cc:291: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 ACTUAL_SEQ[EXPECTED_ADDR_COUNT+1]; ACTUAL_SEQ[EXPECTED_ADDR_COUNT]=0; data/zookeeper-3.4.13/src/c/tests/Util.cc:34: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 name[1024]; data/zookeeper-3.4.13/src/c/tests/Util.cc:35: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(name, "TEST-"); data/zookeeper-3.4.13/src/c/tests/Util.cc:38: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(name + strlen(name), "-mt.txt"); data/zookeeper-3.4.13/src/c/tests/Util.cc:40: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(name + strlen(name), "-st.txt"); data/zookeeper-3.4.13/src/c/tests/Util.cc:43: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). FILE *logfile = fopen(name, "a"); data/zookeeper-3.4.13/src/c/tests/ZKMocks.cc:343:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/zookeeper-3.4.13/src/c/tests/ZKMocks.h:284: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(this,&other,sizeof(*this)); data/zookeeper-3.4.13/src/c/tests/ZKMocks.h:315:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char passwd[16]; data/zookeeper-3.4.13/src/contrib/zkfuse/src/log.h:51:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[MAX_BUFFER_SIZE]; \ data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkadapter.cc:544:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char realPath[MAX_PATH_LENGTH]; data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkadapter.cc:811:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[MAX_DATA_LENGTH]; data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkadapter.h:67: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. char tmp[100]; data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkadapter.h:68: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( tmp, " (ZK error code: %d)", errorCode ); data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkfuse.cc:583: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). int open(const std::string & path, bool justCreated); data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkfuse.cc:805:27: [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). _handle(_manager->open(path, false)), data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkfuse.cc:1406: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 key[128]; data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkfuse.cc:1407: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 value[1024]; data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkfuse.cc:2634:17: [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(&_activeData[offset], buf, size); data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkfuse.cc:3237: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). res = open(path, false); data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkfuse.cc:3286:23: [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). res = open(path, true); data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkfuse.cc:3289:31: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int openRes = open(path, false); data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkfuse.cc:3337:26: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int ZkFuseHandleManager::open(const std::string & path, bool justCreated) data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkfuse.cc:3943:26: [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. int zkfuse_utimens(const char *path, const struct timespec ts[2]) data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkfuse.cc:3972:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(path, fi->flags, mode); data/zookeeper-3.4.13/src/contrib/zkpython/src/c/zookeeper.c:175: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(zhandles, tmp, sizeof(zhandle_t*)*max_zhandles/2); data/zookeeper-3.4.13/src/contrib/zkpython/src/c/zookeeper.c:183: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(watchers, wtmp, sizeof(pywatcher_t*)*max_zhandles/2); data/zookeeper-3.4.13/src/contrib/zkpython/src/c/zookeeper.c:443:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char msg[256]; data/zookeeper-3.4.13/src/contrib/zkpython/src/c/zookeeper.c:444:5: [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(msg, "pywatcher: %d %p %d", pyw->zhandle, pyw->callback, pyw->permanent); data/zookeeper-3.4.13/src/contrib/zkpython/src/c/zookeeper.c:1023: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 realbuf[256]; data/zookeeper-3.4.13/src/contrib/zkpython/src/c/zookeeper.c:1577: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 version_str[size]; data/zookeeper-3.4.13/src/contrib/zktreeutil/src/ZkAdaptor.cc:268: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 realPath[MAX_PATH_LENGTH]; data/zookeeper-3.4.13/src/contrib/zktreeutil/src/ZkAdaptor.cc:462: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 buffer[MAX_DATA_LENGTH]; data/zookeeper-3.4.13/src/contrib/zktreeutil/src/ZkAdaptor.h:59:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp[100]; data/zookeeper-3.4.13/src/contrib/zktreeutil/src/ZkAdaptor.h:60:17: [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( tmp, " (ZK error code: %d)", errorCode ); data/zookeeper-3.4.13/src/contrib/zktreeutil/src/ZkTreeUtilMain.cc:170:32: [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). case 'd': depth = atoi (optarg); data/zookeeper-3.4.13/src/recipes/lock/src/c/src/zoo_lock.c:85: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 buf[len]; data/zookeeper-3.4.13/src/recipes/lock/src/c/src/zoo_lock.c:241: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 prefix[30]; data/zookeeper-3.4.13/src/recipes/lock/src/c/src/zoo_lock.c:260: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. char buf[len]; data/zookeeper-3.4.13/src/recipes/lock/src/c/src/zoo_lock.c:261: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. char retbuf[len+20]; data/zookeeper-3.4.13/src/recipes/lock/src/c/src/zoo_lock.c:291:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char last_child[flen]; data/zookeeper-3.4.13/src/recipes/lock/src/c/tests/TestClient.cc:137: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 cmd[1024]; data/zookeeper-3.4.13/src/recipes/lock/src/c/tests/TestClient.cc:144: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 cmd[1024]; data/zookeeper-3.4.13/src/recipes/lock/src/c/tests/TestClient.cc:155: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 cmd[1024]; data/zookeeper-3.4.13/src/recipes/lock/src/c/tests/TestClient.cc:166: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 buf[1024]; data/zookeeper-3.4.13/src/recipes/queue/src/c/src/zoo_queue.c:159: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. char child_path[child_path_length]; data/zookeeper-3.4.13/src/recipes/queue/src/c/src/zoo_queue.c:207: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. char child_path[child_path_length]; data/zookeeper-3.4.13/src/recipes/queue/src/c/src/zoo_queue.c:406: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. char child_path[child_path_length]; data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:188: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. char cmd[1024]; data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:195: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 cmd[1024]; data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:206: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. char cmd[1024]; data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:258: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 buffer[test_string_buffer_length]; data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:284: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 correct_buffer[buffer_length]; data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:285: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 receive_buffer[buffer_length]; data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:345: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 correct_buffer[buffer_length]; data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:346: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 receive_buffer[buffer_length]; data/zookeeper-3.4.13/src/c/src/cli.c:40:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int read(int _FileHandle, void * _DstBuf, unsigned int _MaxCharCount); data/zookeeper-3.4.13/src/c/src/cli.c:119: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). if (path && strlen(path) > 0) { data/zookeeper-3.4.13/src/c/src/cli.c:287: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). zoo_aset(zh, "/od", data, strlen(data), -1, my_silent_stat_completion, data/zookeeper-3.4.13/src/c/src/cli.c:309:15: [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). int len = strlen(prefix); data/zookeeper-3.4.13/src/c/src/cli.c:376: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). rc = zoo_aset(zh, line, ptr, strlen(ptr), -1, my_stat_completion, data/zookeeper-3.4.13/src/c/src/cli.c:380: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). rc = zoo_set2(zh, line, ptr, strlen(ptr), -1, &stat); data/zookeeper-3.4.13/src/c/src/cli.c:520: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). zoo_add_auth(zh, line, ptr, ptr ? strlen(ptr) : 0, NULL, NULL); data/zookeeper-3.4.13/src/c/src/cli.c:551: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). size_t cmdlen = strlen(argv[2]); data/zookeeper-3.4.13/src/c/src/cli.c:559:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cmd, argv[2]+4, sizeof(cmd)-1); data/zookeeper-3.4.13/src/c/src/cli.c:578:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(p,cert,sizeof(p)-1); data/zookeeper-3.4.13/src/c/src/cli.c:597: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(zoo_add_auth(zh,"yca",p,strlen(p),0,0)!=ZOK) data/zookeeper-3.4.13/src/c/src/cli.c:609:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rc = read(0, buffer+bufoff, len); data/zookeeper-3.4.13/src/c/src/cli.c:622: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). memmove(buffer, ptr, strlen(ptr)+1); data/zookeeper-3.4.13/src/c/src/cli.c:674:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rc = read(0, buffer+bufoff, len); data/zookeeper-3.4.13/src/c/src/cli.c:686:38: [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). memmove(buffer, ptr, strlen(ptr)+1); data/zookeeper-3.4.13/src/c/src/mt_adaptor.c:394:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(read(adaptor_threads->self_pipe[0],b,sizeof(b))==sizeof(b)){} data/zookeeper-3.4.13/src/c/src/recordio.c:170:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(*s); data/zookeeper-3.4.13/src/c/src/zookeeper.c:464:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int rc = read(fd, &seed + seed_len, sizeof(seed) - seed_len); data/zookeeper-3.4.13/src/c/src/zookeeper.c:856: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). if (strlen(zh->chroot) == 1) { data/zookeeper-3.4.13/src/c/src/zookeeper.c:862:24: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). zh->hostname = strncpy(zh->hostname, host, (index_chroot - host)); data/zookeeper-3.4.13/src/c/src/zookeeper.c:928:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(client_path) == 1) { data/zookeeper-3.4.13/src/c/src/zookeeper.c:931: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). ret_str = (char *) malloc(strlen(zh->chroot) + strlen(client_path) + 1); data/zookeeper-3.4.13/src/c/src/zookeeper.c:931:52: [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). ret_str = (char *) malloc(strlen(zh->chroot) + strlen(client_path) + 1); data/zookeeper-3.4.13/src/c/src/zookeeper.c:945: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). if (strncmp(server_path, zh->chroot, strlen(zh->chroot)) != 0) { data/zookeeper-3.4.13/src/c/src/zookeeper.c:950:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(server_path) == strlen(zh->chroot)) { data/zookeeper-3.4.13/src/c/src/zookeeper.c:950: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 (strlen(server_path) == strlen(zh->chroot)) { data/zookeeper-3.4.13/src/c/src/zookeeper.c:955:36: [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). ret_str = strdup(server_path + strlen(zh->chroot)); data/zookeeper-3.4.13/src/c/src/zookeeper.c:1989: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). len = strlen(client_path) + 1;if (len > sc->u.str.str_len) { data/zookeeper-3.4.13/src/c/src/zookeeper.c:2603:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(path); data/zookeeper-3.4.13/src/c/src/zookeeper.c:3093: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). int len = strlen(value) + 1; data/zookeeper-3.4.13/src/c/tests/LibCMocks.cc:72: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(str)+1; data/zookeeper-3.4.13/src/c/tests/TestClient.cc:365:13: [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(500000); data/zookeeper-3.4.13/src/c/tests/TestClient.cc:743:24: [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). CPPUNIT_ASSERT(strlen(pathbuf) == 0); data/zookeeper-3.4.13/src/c/tests/Util.cc:36:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(name + 5, testname, sizeof(name) - 5); data/zookeeper-3.4.13/src/c/tests/Util.cc:38: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). strcpy(name + strlen(name), "-mt.txt"); data/zookeeper-3.4.13/src/c/tests/Util.cc:40: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). strcpy(name + strlen(name), "-st.txt"); data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkfuse.cc:2557:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int read(char *buf, size_t size, off_t offset) const data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkfuse.cc:3546:24: [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). unsigned pathLen = strlen(path); data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkfuse.cc:4025:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(buf, size, offset); data/zookeeper-3.4.13/src/contrib/zkfuse/src/zkfuse.cc:4474:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(0); data/zookeeper-3.4.13/src/contrib/zkpython/src/c/zookeeper.c:623:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cid.passwd, passwd, 16*sizeof(char)); data/zookeeper-3.4.13/src/recipes/lock/src/c/src/zoo_lock.c:84: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). int len = strlen(mutex->path) + strlen(mutex->id) + 2; data/zookeeper-3.4.13/src/recipes/lock/src/c/src/zoo_lock.c:84: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). int len = strlen(mutex->path) + strlen(mutex->id) + 2; data/zookeeper-3.4.13/src/recipes/lock/src/c/src/zoo_lock.c:197:40: [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 (strncmp(prefix, child, strlen(prefix)) == 0) { data/zookeeper-3.4.13/src/recipes/lock/src/c/src/zoo_lock.c:259: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). int len = strlen(path) + strlen(prefix) + 2; data/zookeeper-3.4.13/src/recipes/lock/src/c/src/zoo_lock.c:259:38: [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). int len = strlen(path) + strlen(prefix) + 2; data/zookeeper-3.4.13/src/recipes/lock/src/c/src/zoo_lock.c:290: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). int flen = strlen(mutex->path) + strlen(lessthanme) + 2; data/zookeeper-3.4.13/src/recipes/lock/src/c/src/zoo_lock.c:290:50: [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). int flen = strlen(mutex->path) + strlen(lessthanme) + 2; data/zookeeper-3.4.13/src/recipes/queue/src/c/src/zoo_queue.c:76: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). int node_path_length = strlen(path) + 1+ strlen(node_name) +1; data/zookeeper-3.4.13/src/recipes/queue/src/c/src/zoo_queue.c:76:46: [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). int node_path_length = strlen(path) + 1+ strlen(node_name) +1; data/zookeeper-3.4.13/src/recipes/queue/src/c/src/zoo_queue.c:94: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). queue->node_name_length = strlen(queue->node_name); data/zookeeper-3.4.13/src/recipes/queue/src/c/src/zoo_queue.c:133: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). int path_length = strlen(queue->path); data/zookeeper-3.4.13/src/recipes/queue/src/c/src/zoo_queue.c:158: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). int child_path_length = path_length + 1 + strlen(child_name) +1; data/zookeeper-3.4.13/src/recipes/queue/src/c/src/zoo_queue.c:179: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). int path_length = strlen(queue->path); data/zookeeper-3.4.13/src/recipes/queue/src/c/src/zoo_queue.c:206: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). int child_path_length = path_length + 1 + strlen(child_name) +1; data/zookeeper-3.4.13/src/recipes/queue/src/c/src/zoo_queue.c:366: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). int path_length = strlen(queue->path); data/zookeeper-3.4.13/src/recipes/queue/src/c/src/zoo_queue.c:405: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). int child_path_length = path_length + 1 + strlen(child_name) +1; data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:104: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). int test_string_buffer_length = strlen(thread_test_string) + 1; data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:112: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). int test_string_buffer_length = strlen(thread_test_string) + 1; data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:129:60: [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). return !strncmp(result_string, thread_test_string, strlen(thread_test_string)); data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:256: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). int test_string_length = strlen(test_string); data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:283: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). int buffer_length = strlen(test_string) + max_digits + 1; data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:344: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). int buffer_length = strlen(test_string) + max_digits + 1; data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:405:9: [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(1000); data/zookeeper-3.4.13/src/recipes/queue/src/c/tests/TestClient.cc:435:13: [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(1000); ANALYSIS SUMMARY: Hits = 307 Lines analyzed = 31827 in approximately 0.87 seconds (36412 lines/second) Physical Source Lines of Code (SLOC) = 21327 Hits@level = [0] 115 [1] 65 [2] 159 [3] 41 [4] 42 [5] 0 Hits@level+ = [0+] 422 [1+] 307 [2+] 242 [3+] 83 [4+] 42 [5+] 0 Hits/KSLOC@level+ = [0+] 19.7871 [1+] 14.3949 [2+] 11.3471 [3+] 3.89178 [4+] 1.96933 [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.