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/kblocks-20.04.3/AI/PlannerInterface.h Examining data/kblocks-20.04.3/AI/KBlocksAIPlayer.cpp Examining data/kblocks-20.04.3/AI/KBlocksAIFeature.h Examining data/kblocks-20.04.3/AI/KBlocksAIPlayer.h Examining data/kblocks-20.04.3/AI/KBlocksAILog.cpp Examining data/kblocks-20.04.3/AI/KBlocksAIEvaluation.h Examining data/kblocks-20.04.3/AI/KBlocksAIPlanner.h Examining data/kblocks-20.04.3/AI/EvaluationInterface.h Examining data/kblocks-20.04.3/AI/KBlocksAIPlannerExtend.h Examining data/kblocks-20.04.3/AI/KBlocksAIPlannerExtend.cpp Examining data/kblocks-20.04.3/AI/KBlocksAIPlanner.cpp Examining data/kblocks-20.04.3/AI/KBlocksAILog.h Examining data/kblocks-20.04.3/AI/KBlocksAIFeature.cpp Examining data/kblocks-20.04.3/AI/KBlocksAITypeDefine.h Examining data/kblocks-20.04.3/AI/KBlocksAIEvaluation.cpp Examining data/kblocks-20.04.3/KBlocksSinglePlayer.h Examining data/kblocks-20.04.3/KBlocksConfigManager.cpp Examining data/kblocks-20.04.3/KBlocksSvgItem.h Examining data/kblocks-20.04.3/FieldInterface.h Examining data/kblocks-20.04.3/KBlocksNetClient.h Examining data/kblocks-20.04.3/KBlocksGameMessage.cpp Examining data/kblocks-20.04.3/KBlocksAppThread.cpp Examining data/kblocks-20.04.3/KBlocksAppThread.h Examining data/kblocks-20.04.3/KBlocksView.h Examining data/kblocks-20.04.3/KBlocksWin.cpp Examining data/kblocks-20.04.3/KBlocksItemGroup.h Examining data/kblocks-20.04.3/KBlocksDummyAI.cpp Examining data/kblocks-20.04.3/KBlocksRepWin.cpp Examining data/kblocks-20.04.3/KBlocksNetPlayer.cpp Examining data/kblocks-20.04.3/KBlocksScene.h Examining data/kblocks-20.04.3/KBlocksPlayNetwork.cpp Examining data/kblocks-20.04.3/KBlocksNetClient.cpp Examining data/kblocks-20.04.3/KBlocksGraphics.cpp Examining data/kblocks-20.04.3/KBlocksAnimator.cpp Examining data/kblocks-20.04.3/KBlocksKeyboardPlayer.h Examining data/kblocks-20.04.3/KBlocksSinglePlayer.cpp Examining data/kblocks-20.04.3/KBlocksConfigManager.h Examining data/kblocks-20.04.3/utils.h Examining data/kblocks-20.04.3/KBlocksGameReplayer.cpp Examining data/kblocks-20.04.3/KBlocksSound.h Examining data/kblocks-20.04.3/KBlocksRepWin.h Examining data/kblocks-20.04.3/KBlocksWin.h Examining data/kblocks-20.04.3/PieceInterface.h Examining data/kblocks-20.04.3/KBlocksPlayManager.cpp Examining data/kblocks-20.04.3/KBlocksNetServer.h Examining data/kblocks-20.04.3/KBlocksPieceGenerator.cpp Examining data/kblocks-20.04.3/KBlocksDefine.cpp Examining data/kblocks-20.04.3/KBlocksDisplay.cpp Examining data/kblocks-20.04.3/KBlocksAnimDrop.cpp Examining data/kblocks-20.04.3/KBlocksSvgItem.cpp Examining data/kblocks-20.04.3/KBlocksDefine.h Examining data/kblocks-20.04.3/KBlocksDummyAI.h Examining data/kblocks-20.04.3/KBlocksItemGroup.cpp Examining data/kblocks-20.04.3/KBlocksLayout.h Examining data/kblocks-20.04.3/GamePlayerInterface.h Examining data/kblocks-20.04.3/KBlocksPieceGenerator.h Examining data/kblocks-20.04.3/KBlocksPlayNetwork.h Examining data/kblocks-20.04.3/KBlocksGameMessage.h Examining data/kblocks-20.04.3/GameLogicInterface.h Examining data/kblocks-20.04.3/KBlocksGameRecorder.cpp Examining data/kblocks-20.04.3/KBlocksGameLogic.cpp Examining data/kblocks-20.04.3/main.cpp Examining data/kblocks-20.04.3/KBlocksNetPlayer.h Examining data/kblocks-20.04.3/utils.cpp Examining data/kblocks-20.04.3/KBlocksPlayManager.h Examining data/kblocks-20.04.3/KBlocksScore.h Examining data/kblocks-20.04.3/KBlocksSound.cpp Examining data/kblocks-20.04.3/KBlocksPiece.h Examining data/kblocks-20.04.3/KBlocksGameReplayer.h Examining data/kblocks-20.04.3/KBlocksNetServer.cpp Examining data/kblocks-20.04.3/KBlocksDisplay.h Examining data/kblocks-20.04.3/KBlocksSingleGame.cpp Examining data/kblocks-20.04.3/KBlocksAnimFade.h Examining data/kblocks-20.04.3/KBlocksView.cpp Examining data/kblocks-20.04.3/KBlocksGameRecorder.h Examining data/kblocks-20.04.3/KBlocksLayout.cpp Examining data/kblocks-20.04.3/KBlocksScene.cpp Examining data/kblocks-20.04.3/KBlocksGameLogic.h Examining data/kblocks-20.04.3/KBlocksGraphics.h Examining data/kblocks-20.04.3/KBlocksSingleGame.h Examining data/kblocks-20.04.3/KBlocksAnimator.h Examining data/kblocks-20.04.3/SingleGameInterface.h Examining data/kblocks-20.04.3/KBlocksPiece.cpp Examining data/kblocks-20.04.3/KBlocksField.h Examining data/kblocks-20.04.3/KBlocksAnimDrop.h Examining data/kblocks-20.04.3/KBlocksScore.cpp Examining data/kblocks-20.04.3/KBlocksField.cpp Examining data/kblocks-20.04.3/KBlocksAnimFade.cpp Examining data/kblocks-20.04.3/KBlocksKeyboardPlayer.cpp FINAL RESULTS: data/kblocks-20.04.3/AI/KBlocksAILog.cpp:85:5: [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). strcat(essq, ystr); data/kblocks-20.04.3/AI/KBlocksAILog.cpp:90:5: [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). strcat(essq, xstr); data/kblocks-20.04.3/AI/KBlocksAILog.cpp:53: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). channel[ch] = fopen(fn, "w"); data/kblocks-20.04.3/AI/KBlocksAILog.cpp:76: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 essq[100]; data/kblocks-20.04.3/AI/KBlocksAILog.cpp:77: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 xstr[100]; data/kblocks-20.04.3/AI/KBlocksAILog.cpp:78: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 ystr[100]; data/kblocks-20.04.3/AI/KBlocksAILog.cpp:80: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(xstr, "%d", x); data/kblocks-20.04.3/AI/KBlocksAILog.cpp:81: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(ystr, "%d", y); data/kblocks-20.04.3/AI/KBlocksAILog.cpp:84:5: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(essq, "\033["); data/kblocks-20.04.3/AI/KBlocksAILog.cpp:89:5: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(essq, "\033["); data/kblocks-20.04.3/AI/KBlocksAILog.cpp:187:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *Piece_Type_Name[7] = { data/kblocks-20.04.3/KBlocksConfigManager.cpp:47:10: [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). fp = fopen(filename.c_str(), "r"); data/kblocks-20.04.3/KBlocksConfigManager.cpp:65:10: [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). fp = fopen(filename.c_str(), "w+"); data/kblocks-20.04.3/KBlocksConfigManager.cpp:271: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 tmpBuff[1024]; data/kblocks-20.04.3/KBlocksConfigManager.cpp:383: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 tmpChar[2] = {0, 0}; data/kblocks-20.04.3/KBlocksDefine.cpp:12:7: [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. const char *KBlocksRecordText[RecordDataType_Max_Count] = { data/kblocks-20.04.3/KBlocksDefine.h:70:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. extern const char *KBlocksRecordText[RecordDataType_Max_Count]; data/kblocks-20.04.3/KBlocksDisplay.cpp:120: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 tmpByteData[5] = {'|', 'r', 'g', '|', '\0'}; data/kblocks-20.04.3/KBlocksGameRecorder.cpp:35: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 *pFile = fopen(fileName, "w"); data/kblocks-20.04.3/KBlocksGameReplayer.cpp:35:20: [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). replayFile.open(fileName, std::ios::binary); data/kblocks-20.04.3/KBlocksGameReplayer.cpp:37:20: [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). replayFile.open(fileName); data/kblocks-20.04.3/KBlocksNetPlayer.cpp:33: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 tmpByteData[256]; data/kblocks-20.04.3/KBlocksNetPlayer.cpp:52: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 tmpByteData[5] = {'|', 'd', 'p', '|', '\0'}; data/kblocks-20.04.3/KBlocksNetPlayer.cpp:58: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 tmpByteData[4] = {'|', 's', '|', '\0'}; data/kblocks-20.04.3/KBlocksNetPlayer.cpp:69: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 tmpByteData[4] = {'|', 'c', '|', '\0'}; data/kblocks-20.04.3/KBlocksNetServer.cpp:243: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 tmpData[256]; data/kblocks-20.04.3/KBlocksNetServer.cpp:308: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 tmpData[256]; data/kblocks-20.04.3/main.cpp:254: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 tmpBuf[256]; data/kblocks-20.04.3/main.cpp:255: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(tmpBuf, "PlayerType%d", i + 1); data/kblocks-20.04.3/main.cpp:257: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(tmpBuf, "PlayerName%d", i + 1); data/kblocks-20.04.3/AI/KBlocksAILog.cpp:87:5: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(essq, "d"); data/kblocks-20.04.3/AI/KBlocksAILog.cpp:91:5: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(essq, "G"); data/kblocks-20.04.3/KBlocksPlayNetwork.cpp:98: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(100000); ANALYSIS SUMMARY: Hits = 33 Lines analyzed = 11360 in approximately 0.29 seconds (39829 lines/second) Physical Source Lines of Code (SLOC) = 8327 Hits@level = [0] 77 [1] 3 [2] 28 [3] 0 [4] 2 [5] 0 Hits@level+ = [0+] 110 [1+] 33 [2+] 30 [3+] 2 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 13.21 [1+] 3.96301 [2+] 3.60274 [3+] 0.240183 [4+] 0.240183 [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.