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/buici-clock-0.4.9.4/version.cxx Examining data/buici-clock-0.4.9.4/clock.cxx Examining data/buici-clock-0.4.9.4/version.h Examining data/buici-clock-0.4.9.4/xo/wbutton.cxx Examining data/buici-clock-0.4.9.4/xo/lwindowclass.cxx Examining data/buici-clock-0.4.9.4/xo/stats.h Examining data/buici-clock-0.4.9.4/xo/lhash.cxx Examining data/buici-clock-0.4.9.4/xo/lwindow.cxx Examining data/buici-clock-0.4.9.4/xo/wtext.cxx Examining data/buici-clock-0.4.9.4/xo/lhash.h Examining data/buici-clock-0.4.9.4/xo/wdialog.h Examining data/buici-clock-0.4.9.4/xo/dither.h Examining data/buici-clock-0.4.9.4/xo/lfont.h Examining data/buici-clock-0.4.9.4/xo/lpicture.h Examining data/buici-clock-0.4.9.4/xo/wbutton.h Examining data/buici-clock-0.4.9.4/xo/lwindowclass.h Examining data/buici-clock-0.4.9.4/xo/larray.cxx Examining data/buici-clock-0.4.9.4/xo/dmalloc.cxx Examining data/buici-clock-0.4.9.4/xo/wdialog.cxx Examining data/buici-clock-0.4.9.4/xo/larray.h Examining data/buici-clock-0.4.9.4/xo/lwindow.h Examining data/buici-clock-0.4.9.4/xo/main.cxx Examining data/buici-clock-0.4.9.4/xo/res.h Examining data/buici-clock-0.4.9.4/xo/ldisplay.h Examining data/buici-clock-0.4.9.4/xo/lfont.cxx Examining data/buici-clock-0.4.9.4/xo/stats.cxx Examining data/buici-clock-0.4.9.4/xo/classes.cxx Examining data/buici-clock-0.4.9.4/xo/dmalloc.h Examining data/buici-clock-0.4.9.4/xo/ldisplay.cxx Examining data/buici-clock-0.4.9.4/xo/messages.h Examining data/buici-clock-0.4.9.4/xo/lres.h Examining data/buici-clock-0.4.9.4/xo/lpicture.cxx Examining data/buici-clock-0.4.9.4/xo/standard.h Examining data/buici-clock-0.4.9.4/xo/res.cxx Examining data/buici-clock-0.4.9.4/xo/wtext.h Examining data/buici-clock-0.4.9.4/xo/dither.cxx Examining data/buici-clock-0.4.9.4/xo/loupe.cxx Examining data/buici-clock-0.4.9.4/options.cxx Examining data/buici-clock-0.4.9.4/signal.h Examining data/buici-clock-0.4.9.4/draw.cc Examining data/buici-clock-0.4.9.4/main.cxx Examining data/buici-clock-0.4.9.4/acconfig.h Examining data/buici-clock-0.4.9.4/standard.h Examining data/buici-clock-0.4.9.4/signal.cxx Examining data/buici-clock-0.4.9.4/options.h FINAL RESULTS: data/buici-clock-0.4.9.4/clock.cxx:309:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stderr, sz, ap); data/buici-clock-0.4.9.4/main.cxx:95:3: [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. printf ( data/buici-clock-0.4.9.4/xo/loupe.cxx:63:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stderr, sz, ap); data/buici-clock-0.4.9.4/xo/lwindowclass.cxx:61:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy (m_szName, szName); data/buici-clock-0.4.9.4/xo/main.cxx:52:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stderr, sz, ap); data/buici-clock-0.4.9.4/xo/res.cxx:54:20: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define DPRINTF(a) printf a data/buici-clock-0.4.9.4/clock.cxx:895:18: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!display.open ()) data/buici-clock-0.4.9.4/options.cxx:338: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 sz[2]; data/buici-clock-0.4.9.4/xo/dither.cxx:278: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). FILE* fp = fopen (sz, "rb"); data/buici-clock-0.4.9.4/xo/dmalloc.cxx:43: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 szModule[16]; // Word aligned name of allocating source data/buici-clock-0.4.9.4/xo/dmalloc.cxx:198: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 ((unsigned8*) pv + sizeof (WRAPPER), data/buici-clock-0.4.9.4/xo/dmalloc.cxx:225:3: [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 (pWrapper->szModule, "%.10s.%.4d", szModule, iLine); data/buici-clock-0.4.9.4/xo/larray.cxx:61: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 (_at (m_cItems++), pv, m_cbEach); data/buici-clock-0.4.9.4/xo/larray.cxx:251: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 (pv, _at (iItem), m_cbEach); data/buici-clock-0.4.9.4/xo/larray.cxx:389: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 (_at (iItem), pv, m_cbEach); data/buici-clock-0.4.9.4/xo/ldisplay.cxx:87:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). bool LDisplay::open (char* szDisplay) data/buici-clock-0.4.9.4/xo/ldisplay.h:154:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). bool open (char* szDisplay = NULL); data/buici-clock-0.4.9.4/xo/lhash.cxx:54: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 (pvItem, pv, m_cbEach); data/buici-clock-0.4.9.4/xo/loupe.cxx:240: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 (pbSrc, pbDst, height*cbRowSrc); data/buici-clock-0.4.9.4/xo/loupe.cxx:306:18: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!display.open ()) data/buici-clock-0.4.9.4/xo/lpicture.cxx:69:10: [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). m_fh = open (szPath, O_RDONLY); data/buici-clock-0.4.9.4/xo/lwindow.cxx:128: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. char sz[256]; data/buici-clock-0.4.9.4/xo/lwindow.cxx:264: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 (this + 1, pWindow + 1, m_cbInstance);// Duplicate instance data data/buici-clock-0.4.9.4/xo/lwindow.cxx:344: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 ((void*) m_szXName, szXName, strlen (szXName) + 1); data/buici-clock-0.4.9.4/xo/lwindow.cxx:356: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 ((void*) m_szXClass, szXClass, cch + 1); data/buici-clock-0.4.9.4/xo/lwindow.cxx:370: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 ((void*) m_szName, sz, strlen (sz) + 1); data/buici-clock-0.4.9.4/xo/lwindowclass.h:77: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 (pAttribute, &m_attribute, sizeof (m_attribute)); data/buici-clock-0.4.9.4/xo/main.cxx:71:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!display.open ()) data/buici-clock-0.4.9.4/xo/res.cxx:71: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 (pvNew, pv, cb); data/buici-clock-0.4.9.4/xo/res.cxx:350: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 fh = open ("resources", O_WRONLY | O_CREAT | O_TRUNC, 0660); data/buici-clock-0.4.9.4/xo/wdialog.cxx:67: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). FILE* fp = fopen (szFileResource, "r"); data/buici-clock-0.4.9.4/xo/wtext.cxx:173: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 sz[80]; data/buici-clock-0.4.9.4/xo/wtext.cxx:255: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 rgb[128]; data/buici-clock-0.4.9.4/xo/wtext.cxx:280: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 (m_sz, sz, cb); data/buici-clock-0.4.9.4/options.cxx:151: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). if ((result = eval_option (pch, strlen (pch), NULL, pOption))) data/buici-clock-0.4.9.4/options.cxx:160: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). pch += strlen (pch) - 1; data/buici-clock-0.4.9.4/options.cxx:176:43: [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). cch = (pOption->sz && pOption->sz[1] ? strlen (pch) : 1); data/buici-clock-0.4.9.4/options.cxx:188:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). cch = strlen (pch); data/buici-clock-0.4.9.4/options.cxx:202:43: [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). cch = (pOption->sz && pOption->sz[1] ? strlen (pch) : 1); data/buici-clock-0.4.9.4/options.cxx:275: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 cch = pch ? strlen (pch) : 0; data/buici-clock-0.4.9.4/xo/lhash.cxx:229:43: [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 LHashTable::make_string_key (sz, strlen (sz)); data/buici-clock-0.4.9.4/xo/lhash.cxx:251:48: [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 LHashTable::make_case_string_key (sz, strlen (sz)); data/buici-clock-0.4.9.4/xo/loupe.cxx:165:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (!picture.read (szFile)) data/buici-clock-0.4.9.4/xo/lpicture.cxx:67:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool LPicture::read (const char* szPath) data/buici-clock-0.4.9.4/xo/lpicture.h:77:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool read (const char* szPath); data/buici-clock-0.4.9.4/xo/lwindow.cxx:85: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). (unsigned char*) m_szXName, strlen (m_szXName)); data/buici-clock-0.4.9.4/xo/lwindow.cxx:88: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). (unsigned char*) m_szXName, strlen (m_szXName)); data/buici-clock-0.4.9.4/xo/lwindow.cxx:94:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). cch += 1 + strlen (m_szXClass + cch)); data/buici-clock-0.4.9.4/xo/lwindow.cxx:132: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). (unsigned char*) sz, strlen (sz)); data/buici-clock-0.4.9.4/xo/lwindow.cxx:343:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). m_szXName = (char*) malloc (strlen (szXName) + 1); data/buici-clock-0.4.9.4/xo/lwindow.cxx:344: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). memcpy ((void*) m_szXName, szXName, strlen (szXName) + 1); data/buici-clock-0.4.9.4/xo/lwindow.cxx:353: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). cch += 1 + strlen (szXClass + cch); data/buici-clock-0.4.9.4/xo/lwindow.cxx:369:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). m_szName = (char*) malloc (strlen (sz) + 1); data/buici-clock-0.4.9.4/xo/lwindow.cxx:370:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memcpy ((void*) m_szName, sz, strlen (sz) + 1); data/buici-clock-0.4.9.4/xo/lwindowclass.cxx:60:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). m_szName = (char*) malloc (strlen (szName) + 1); data/buici-clock-0.4.9.4/xo/res.cxx:91: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 (sz) > 10) data/buici-clock-0.4.9.4/xo/wbutton.cxx:121:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int cchTitle = strlen (szTitle); data/buici-clock-0.4.9.4/xo/wtext.cxx:277:12: [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 cb = strlen (sz); ANALYSIS SUMMARY: Hits = 58 Lines analyzed = 8552 in approximately 0.24 seconds (35903 lines/second) Physical Source Lines of Code (SLOC) = 4988 Hits@level = [0] 53 [1] 24 [2] 28 [3] 0 [4] 6 [5] 0 Hits@level+ = [0+] 111 [1+] 58 [2+] 34 [3+] 6 [4+] 6 [5+] 0 Hits/KSLOC@level+ = [0+] 22.2534 [1+] 11.6279 [2+] 6.81636 [3+] 1.20289 [4+] 1.20289 [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.