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/wxhexeditor-0.24+repack/resources/osx/png2c.h Examining data/wxhexeditor-0.24+repack/resources/win/png2c.h Examining data/wxhexeditor-0.24+repack/src/FAL.cpp Examining data/wxhexeditor-0.24+repack/src/FAL.h Examining data/wxhexeditor-0.24+repack/src/HexDialogs.h Examining data/wxhexeditor-0.24+repack/src/HexEditorApp.cpp Examining data/wxhexeditor-0.24+repack/src/HexEditorApp.h Examining data/wxhexeditor-0.24+repack/src/HexEditorCtrl/HexEditorCtrl.cpp Examining data/wxhexeditor-0.24+repack/src/HexEditorCtrl/HexEditorCtrlGui.cpp Examining data/wxhexeditor-0.24+repack/src/HexEditorCtrl/HexEditorCtrlGui.h Examining data/wxhexeditor-0.24+repack/src/HexEditorCtrl/app.cpp Examining data/wxhexeditor-0.24+repack/src/HexEditorCtrl/app.h Examining data/wxhexeditor-0.24+repack/src/HexEditorCtrl/main.cpp Examining data/wxhexeditor-0.24+repack/src/HexEditorCtrl/main.h Examining data/wxhexeditor-0.24+repack/src/HexEditorCtrl/wxHexCtrl/Tag.cpp Examining data/wxhexeditor-0.24+repack/src/HexEditorCtrl/wxHexCtrl/Tag.h Examining data/wxhexeditor-0.24+repack/src/HexEditorCtrl/wxHexCtrl/TagDialogGui.cpp Examining data/wxhexeditor-0.24+repack/src/HexEditorCtrl/wxHexCtrl/TagDialogGui.h Examining data/wxhexeditor-0.24+repack/src/HexEditorCtrl/wxHexCtrl/app.cpp Examining data/wxhexeditor-0.24+repack/src/HexEditorCtrl/wxHexCtrl/app.h Examining data/wxhexeditor-0.24+repack/src/HexEditorCtrl/wxHexCtrl/main.cpp Examining data/wxhexeditor-0.24+repack/src/HexEditorCtrl/wxHexCtrl/main.h Examining data/wxhexeditor-0.24+repack/src/HexEditorCtrl/wxHexCtrl/wxHexCtrl.h Examining data/wxhexeditor-0.24+repack/src/HexEditorCtrl/wxHexCtrl/wxHexCtrl.cpp Examining data/wxhexeditor-0.24+repack/src/HexEditorCtrl/HexEditorCtrl.h Examining data/wxhexeditor-0.24+repack/src/HexEditorFrame.h Examining data/wxhexeditor-0.24+repack/src/HexEditorGui.h Examining data/wxhexeditor-0.24+repack/src/windrv.cpp Examining data/wxhexeditor-0.24+repack/src/windrv.h Examining data/wxhexeditor-0.24+repack/src/HexDialogs.cpp Examining data/wxhexeditor-0.24+repack/src/HexEditor.h Examining data/wxhexeditor-0.24+repack/src/HexEditorGui.cpp Examining data/wxhexeditor-0.24+repack/src/HexPanels.cpp Examining data/wxhexeditor-0.24+repack/src/HexPanels.h Examining data/wxhexeditor-0.24+repack/src/HexEditor.cpp Examining data/wxhexeditor-0.24+repack/src/HexEditorFrame.cpp FINAL RESULTS: data/wxhexeditor-0.24+repack/src/windrv.cpp:31:3: [4] (buffer) wcscpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using a function version that stops copying at the end of the buffer. wcscpy(lpszCFDevice, lpszDiskFile); data/wxhexeditor-0.24+repack/src/HexDialogs.cpp:3370:2: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand((unsigned)time(0)); data/wxhexeditor-0.24+repack/src/HexEditorCtrl/HexEditorCtrl.cpp:793:3: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand ( time(NULL) ); data/wxhexeditor-0.24+repack/src/FAL.cpp:448: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( newnode->new_data, data, size); data/wxhexeditor-0.24+repack/src/FAL.cpp:462: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( newnode->new_data, data, size); data/wxhexeditor-0.24+repack/src/FAL.cpp:525:8: [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( bfr+rd , &word, 4); data/wxhexeditor-0.24+repack/src/FAL.cpp:541:6: [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( bfr+StartShift, (DiffArray[i]->flag_commit ? DiffArray[i]->old_data : DiffArray[i]->new_data), DiffArray[i]->size); data/wxhexeditor-0.24+repack/src/FAL.cpp:807:6: [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( bfr+rd , &word, 4); data/wxhexeditor-0.24+repack/src/FAL.cpp:819: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(buffer, bfr+StartShift, wxMin(wxMin( rd, rd_size-StartShift) , size)); //wxMin protects file ends. data/wxhexeditor-0.24+repack/src/FAL.cpp:883: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( data, Inject_Node->new_data + movement, first_part ); // Copy first part to buffer data/wxhexeditor-0.24+repack/src/FAL.cpp:893: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( data, Inject_Node->new_data + movement, size ); // Copy first part to buffer data/wxhexeditor-0.24+repack/src/FAL.cpp:903: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( data+first_part, Inject_Node->new_data, Inject_Node->size ); // Copy second part to buffer data/wxhexeditor-0.24+repack/src/FAL.cpp:914: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( data+first_part, Inject_Node->new_data, size-first_part ); // Copy second part to buffer data/wxhexeditor-0.24+repack/src/FAL.cpp:991:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data+irq_loc , Patch->flag_undo ? Patch->old_data : Patch->new_data, irq_size ); data/wxhexeditor-0.24+repack/src/FAL.cpp:998:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data, Patch->flag_undo ? Patch->old_data : Patch->new_data + irq_skipper, irq_size ); data/wxhexeditor-0.24+repack/src/FAL.cpp:1004:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data, Patch->flag_undo ? Patch->old_data : Patch->new_data + irq_skipper, size ); data/wxhexeditor-0.24+repack/src/HexDialogs.cpp:337: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 buff[STEP]; data/wxhexeditor-0.24+repack/src/HexDialogs.cpp:344: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 ers[10]; data/wxhexeditor-0.24+repack/src/HexDialogs.cpp:349: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( buff+i, target, sz ); data/wxhexeditor-0.24+repack/src/HexDialogs.cpp:360: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( buff+i, ers, sz ); data/wxhexeditor-0.24+repack/src/HexDialogs.cpp:657:6: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). FAL tmpfile(a, FAL::ReadWrite ) ; data/wxhexeditor-0.24+repack/src/HexDialogs.cpp:658:12: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). findfile=&tmpfile; data/wxhexeditor-0.24+repack/src/HexDialogs.cpp:674:3: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). tmpfile.Add( i, teststr, strlen(teststr) ); data/wxhexeditor-0.24+repack/src/HexDialogs.cpp:687:3: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). tmpfile.Undo();//remove last mod data/wxhexeditor-0.24+repack/src/HexDialogs.cpp:1381:6: [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 s[16]; data/wxhexeditor-0.24+repack/src/HexDialogs.cpp:1429:6: [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 s[16]; data/wxhexeditor-0.24+repack/src/HexDialogs.cpp:1525:4: [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 s[16]; data/wxhexeditor-0.24+repack/src/HexDialogs.cpp:1578:4: [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 s[16]; data/wxhexeditor-0.24+repack/src/HexDialogs.cpp:3218:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buff[rdBlockSz]; data/wxhexeditor-0.24+repack/src/HexDialogs.cpp:3310:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buff[rdBlockSz]; data/wxhexeditor-0.24+repack/src/HexDialogs.cpp:3360:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buff[rdBlockSz]; data/wxhexeditor-0.24+repack/src/HexDialogs.h:77: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 UTF8SpeedHackChrs[2]; data/wxhexeditor-0.24+repack/src/HexEditor.cpp:183:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buff[rdBlockSz]; data/wxhexeditor-0.24+repack/src/HexEditorCtrl/wxHexCtrl/wxHexCtrl.cpp:1825: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 bf[256]; data/wxhexeditor-0.24+repack/src/HexPanels.cpp:50: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( unidata.raw, buffer.GetData(), size ); data/wxhexeditor-0.24+repack/src/HexPanels.cpp:51: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( unidata.mraw, buffer.GetData(), size ); data/wxhexeditor-0.24+repack/src/HexPanels.cpp:408:4: [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 line[256]; data/wxhexeditor-0.24+repack/src/windrv.cpp:67:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t size[100] = {0}, partTypeStr[1024] = {0}, *partType = partTypeStr; data/wxhexeditor-0.24+repack/src/FAL.cpp:303:43: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). Open(myfilename.GetFullPath(), wxFile::read); data/wxhexeditor-0.24+repack/src/FAL.cpp:388:66: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if( Access( the_file.GetFullPath() , (fam == ReadOnly ? wxFile::read : wxFile::read_write) ) data/wxhexeditor-0.24+repack/src/HexDialogs.cpp:669: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). for(int i=fs-strlen(teststr); i > 0 ; i-- ) //for Forward Search, put search string to last possible location first data/wxhexeditor-0.24+repack/src/HexDialogs.cpp:674: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). tmpfile.Add( i, teststr, strlen(teststr) ); data/wxhexeditor-0.24+repack/src/windrv.cpp:90:25: [1] (buffer) wcslen: 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). char* ascii = new char[wcslen(szTmp) + 1]; data/wxhexeditor-0.24+repack/src/windrv.cpp:91:19: [1] (buffer) wcslen: 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). memset(ascii, 0, wcslen(szTmp) + 1); data/wxhexeditor-0.24+repack/src/windrv.cpp:92:26: [1] (buffer) wcslen: 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). wcstombs( ascii, szTmp, wcslen(szTmp) ); data/wxhexeditor-0.24+repack/src/windrv.cpp:131:28: [1] (buffer) wcslen: 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). char* ascii = new char[wcslen(szTmp) + 1]; data/wxhexeditor-0.24+repack/src/windrv.cpp:132:22: [1] (buffer) wcslen: 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). memset(ascii, 0, wcslen(szTmp) + 1); data/wxhexeditor-0.24+repack/src/windrv.cpp:133:29: [1] (buffer) wcslen: 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). wcstombs( ascii, szTmp, wcslen(szTmp) ); ANALYSIS SUMMARY: Hits = 48 Lines analyzed = 23788 in approximately 0.92 seconds (25785 lines/second) Physical Source Lines of Code (SLOC) = 19302 Hits@level = [0] 22 [1] 10 [2] 35 [3] 2 [4] 1 [5] 0 Hits@level+ = [0+] 70 [1+] 48 [2+] 38 [3+] 3 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 3.62657 [1+] 2.48679 [2+] 1.96871 [3+] 0.155424 [4+] 0.0518081 [5+] 0 Dot directories skipped = 2 (--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.