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/python-apt-2.1.6/doc/client-example.cc Examining data/python-apt-2.1.6/python/acquire-item.cc Examining data/python-apt-2.1.6/python/acquire.cc Examining data/python-apt-2.1.6/python/apt_instmodule.cc Examining data/python-apt-2.1.6/python/apt_instmodule.h Examining data/python-apt-2.1.6/python/apt_pkgmodule.cc Examining data/python-apt-2.1.6/python/apt_pkgmodule.h Examining data/python-apt-2.1.6/python/arfile.cc Examining data/python-apt-2.1.6/python/cache.cc Examining data/python-apt-2.1.6/python/cachegroup.cc Examining data/python-apt-2.1.6/python/cdrom.cc Examining data/python-apt-2.1.6/python/configuration.cc Examining data/python-apt-2.1.6/python/depcache.cc Examining data/python-apt-2.1.6/python/generic.cc Examining data/python-apt-2.1.6/python/generic.h Examining data/python-apt-2.1.6/python/hashes.cc Examining data/python-apt-2.1.6/python/hashstring.cc Examining data/python-apt-2.1.6/python/hashstringlist.cc Examining data/python-apt-2.1.6/python/indexfile.cc Examining data/python-apt-2.1.6/python/lock.cc Examining data/python-apt-2.1.6/python/metaindex.cc Examining data/python-apt-2.1.6/python/orderlist.cc Examining data/python-apt-2.1.6/python/pkgmanager.cc Examining data/python-apt-2.1.6/python/pkgrecords.cc Examining data/python-apt-2.1.6/python/pkgrecords.h Examining data/python-apt-2.1.6/python/pkgsrcrecords.cc Examining data/python-apt-2.1.6/python/policy.cc Examining data/python-apt-2.1.6/python/progress.cc Examining data/python-apt-2.1.6/python/progress.h Examining data/python-apt-2.1.6/python/python-apt-helpers.cc Examining data/python-apt-2.1.6/python/python-apt.h Examining data/python-apt-2.1.6/python/sourcelist.cc Examining data/python-apt-2.1.6/python/string.cc Examining data/python-apt-2.1.6/python/tag.cc Examining data/python-apt-2.1.6/python/tarfile.cc FINAL RESULTS: data/python-apt-2.1.6/python/lock.cc:196: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(self->filename, filename); data/python-apt-2.1.6/python/tarfile.cc:146: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(py_member->Object.Name, Itm.Name); data/python-apt-2.1.6/python/tarfile.cc:147: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(py_member->Object.LinkTarget,Itm.LinkTarget); data/python-apt-2.1.6/python/arfile.cc:224:17: [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). IntFD outfd(open(outfile, O_NDELAY|O_WRONLY|O_CREAT|O_TRUNC|O_APPEND, data/python-apt-2.1.6/python/generic.cc:60:33: [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 **Res = new const char *[Length + (NullTerm == true?1:0)]; data/python-apt-2.1.6/python/tag.cc:386: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(Obj.Section->Data, Start, Stop - Start); data/python-apt-2.1.6/python/tarfile.cc:118: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(copy + Pos, Data,Size); data/python-apt-2.1.6/python/arfile.cc:239:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (size < read) data/python-apt-2.1.6/python/arfile.cc:241:36: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (!Fd.Read(value.data(), read, true)) data/python-apt-2.1.6/python/arfile.cc:243:40: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (write(outfd, value.data(), read) != (signed long long)read) data/python-apt-2.1.6/python/arfile.cc:243:67: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (write(outfd, value.data(), read) != (signed long long)read) data/python-apt-2.1.6/python/arfile.cc:245:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size -= read; data/python-apt-2.1.6/python/lock.cc:195: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). self->filename = new char[strlen(filename) + 1]; data/python-apt-2.1.6/python/tag.cc:93: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). return PyUnicode_Decode(v, strlen(v), data/python-apt-2.1.6/python/tag.cc:510: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). New->Data = new char[strlen(Data)+2]; data/python-apt-2.1.6/python/tag.cc:511: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). snprintf(New->Data,strlen(Data)+2,"%s\n",Data); data/python-apt-2.1.6/python/tag.cc:517:35: [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 (New->Object.Scan(New->Data,strlen(New->Data)) == false) data/python-apt-2.1.6/python/tarfile.cc:144:39: [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). py_member->Object.Name = new char[strlen(Itm.Name)+1]; data/python-apt-2.1.6/python/tarfile.cc:145:45: [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). py_member->Object.LinkTarget = new char[strlen(Itm.LinkTarget)+1]; ANALYSIS SUMMARY: Hits = 19 Lines analyzed = 12730 in approximately 0.37 seconds (34308 lines/second) Physical Source Lines of Code (SLOC) = 10147 Hits@level = [0] 1 [1] 12 [2] 4 [3] 0 [4] 3 [5] 0 Hits@level+ = [0+] 20 [1+] 19 [2+] 7 [3+] 3 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 1.97103 [1+] 1.87247 [2+] 0.689859 [3+] 0.295654 [4+] 0.295654 [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.