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/hexxagon-1.0pl1/src/libhexx/lookup.h Examining data/hexxagon-1.0pl1/src/libhexx/game.h Examining data/hexxagon-1.0pl1/src/libhexx/view.h Examining data/hexxagon-1.0pl1/src/libhexx/layout.h Examining data/hexxagon-1.0pl1/src/libhexx/board.cpp Examining data/hexxagon-1.0pl1/src/libhexx/bitboard64.cpp Examining data/hexxagon-1.0pl1/src/libhexx/layout.cpp Examining data/hexxagon-1.0pl1/src/libhexx/libhexx.h Examining data/hexxagon-1.0pl1/src/libhexx/lookup.cpp Examining data/hexxagon-1.0pl1/src/libhexx/game.cpp Examining data/hexxagon-1.0pl1/src/libhexx/board.h Examining data/hexxagon-1.0pl1/src/libhexx/bitboard64.h Examining data/hexxagon-1.0pl1/src/libhexx/move.cpp Examining data/hexxagon-1.0pl1/src/libhexx/move.h Examining data/hexxagon-1.0pl1/src/gui/gtkboardlist.h Examining data/hexxagon-1.0pl1/src/gui/gtkscaleimage.h Examining data/hexxagon-1.0pl1/src/gui/gamemodel.h Examining data/hexxagon-1.0pl1/src/gui/gtkhexxagonboardedit.cpp Examining data/hexxagon-1.0pl1/src/gui/gtkscaleimage.cpp Examining data/hexxagon-1.0pl1/src/gui/gtkgameoverdialog.h Examining data/hexxagon-1.0pl1/src/gui/gtkhexxagonboard.h Examining data/hexxagon-1.0pl1/src/gui/gtkhexxagonboardedit.h Examining data/hexxagon-1.0pl1/src/gui/helper_functions.cpp Examining data/hexxagon-1.0pl1/src/gui/gtkaboutwindow.cpp Examining data/hexxagon-1.0pl1/src/gui/gtkhexxagonboardplay.cpp Examining data/hexxagon-1.0pl1/src/gui/helper_functions.h Examining data/hexxagon-1.0pl1/src/gui/gtkaboutwindow.h Examining data/hexxagon-1.0pl1/src/gui/gtknavbar.cpp Examining data/hexxagon-1.0pl1/src/gui/gtkmainmenu.cpp Examining data/hexxagon-1.0pl1/src/gui/hexxagon.cpp Examining data/hexxagon-1.0pl1/src/gui/gtkscore.cpp Examining data/hexxagon-1.0pl1/src/gui/gtkmainwindow.cpp Examining data/hexxagon-1.0pl1/src/gui/gtkeditwindow.cpp Examining data/hexxagon-1.0pl1/src/gui/gtkmainmenu.h Examining data/hexxagon-1.0pl1/src/gui/gtknavbar.h Examining data/hexxagon-1.0pl1/src/gui/gtkmainwindow.h Examining data/hexxagon-1.0pl1/src/gui/gtkscore.h Examining data/hexxagon-1.0pl1/src/gui/gtkeditwindow.h Examining data/hexxagon-1.0pl1/src/gui/gtkboardlist.cpp Examining data/hexxagon-1.0pl1/src/gui/gamemodel.cpp Examining data/hexxagon-1.0pl1/src/gui/gtkhexxagonboardplay.h Examining data/hexxagon-1.0pl1/src/gui/gtkgameoverdialog.cpp Examining data/hexxagon-1.0pl1/src/gui/gtkhexxagonboard.cpp Examining data/hexxagon-1.0pl1/src/gui/microtime.h FINAL RESULTS: data/hexxagon-1.0pl1/src/gui/gtkboardlist.cpp:59:24: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. return std::string(getenv("HOME")) + "/.hexxagon"; data/hexxagon-1.0pl1/src/libhexx/game.cpp:270: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 str[64]; data/hexxagon-1.0pl1/src/libhexx/game.cpp:283: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 str[64]; data/hexxagon-1.0pl1/src/gui/gtkhexxagonboardplay.cpp:140: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(10000); data/hexxagon-1.0pl1/src/libhexx/game.cpp:271:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). in.read(str, strlen(FILE_HDR_V1)); data/hexxagon-1.0pl1/src/libhexx/game.cpp:271: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). in.read(str, strlen(FILE_HDR_V1)); data/hexxagon-1.0pl1/src/libhexx/game.cpp:273: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). if(!memcmp(str, FILE_HDR_V1, strlen(FILE_HDR_V1))) data/hexxagon-1.0pl1/src/libhexx/game.cpp:275: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). if(!memcmp(str, FILE_HDR_V2, strlen(FILE_HDR_V2))) data/hexxagon-1.0pl1/src/libhexx/game.cpp:284:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). input.read(str, strlen(FILE_HDR_V1)); data/hexxagon-1.0pl1/src/libhexx/game.cpp:284:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). input.read(str, strlen(FILE_HDR_V1)); data/hexxagon-1.0pl1/src/libhexx/game.cpp:286: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). if(!memcmp(str, FILE_HDR_V1, strlen(FILE_HDR_V1))) data/hexxagon-1.0pl1/src/libhexx/game.cpp:288: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). else if(!memcmp(str, FILE_HDR_V2, strlen(FILE_HDR_V2))) ANALYSIS SUMMARY: Hits = 12 Lines analyzed = 4789 in approximately 0.14 seconds (35165 lines/second) Physical Source Lines of Code (SLOC) = 2889 Hits@level = [0] 1 [1] 9 [2] 2 [3] 1 [4] 0 [5] 0 Hits@level+ = [0+] 13 [1+] 12 [2+] 3 [3+] 1 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 4.49983 [1+] 4.15369 [2+] 1.03842 [3+] 0.346141 [4+] 0 [5+] 0 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.