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/gif2apng-1.9+srconly/gif2apng.cpp FINAL RESULTS: data/gif2apng-1.9+srconly/gif2apng.cpp:526:7: [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(szIn, szOpt); data/gif2apng-1.9+srconly/gif2apng.cpp:529:7: [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(szOut, szOpt); data/gif2apng-1.9+srconly/gif2apng.cpp:542: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(szOut, szIn); data/gif2apng-1.9+srconly/gif2apng.cpp:80:10: [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 png_sign[8] = {137, 80, 78, 71, 13, 10, 26, 10}; data/gif2apng-1.9+srconly/gif2apng.cpp:81:10: [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 png_Software[24] = { 83, 111, 102, 116, 119, 97, 114, 101, '\0', data/gif2apng-1.9+srconly/gif2apng.cpp:109:12: [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 suffix[4097]; data/gif2apng-1.9+srconly/gif2apng.cpp:110:12: [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 str[4097]; data/gif2apng-1.9+srconly/gif2apng.cpp:111:12: [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 data[1024]; data/gif2apng-1.9+srconly/gif2apng.cpp:279: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(p, row, rowbytes); data/gif2apng-1.9+srconly/gif2apng.cpp:293:7: [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(zbuf, data, size); data/gif2apng-1.9+srconly/gif2apng.cpp:328: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(row_buf+1, row, w*bpp); data/gif2apng-1.9+srconly/gif2apng.cpp:407:7: [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(pc, &c2, 3); data/gif2apng-1.9+srconly/gif2apng.cpp:442: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 szIn[256]; data/gif2apng-1.9+srconly/gif2apng.cpp:443: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 szOut[256]; data/gif2apng-1.9+srconly/gif2apng.cpp:448:12: [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 data[1024]; data/gif2apng-1.9+srconly/gif2apng.cpp:449:12: [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 cube[4096]; data/gif2apng-1.9+srconly/gif2apng.cpp:450:12: [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 gray[256]; data/gif2apng-1.9+srconly/gif2apng.cpp:451:12: [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 pal_g[256][3]; data/gif2apng-1.9+srconly/gif2apng.cpp:452:12: [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 pal_l[256][3]; data/gif2apng-1.9+srconly/gif2apng.cpp:453:12: [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 plte[256][3]; data/gif2apng-1.9+srconly/gif2apng.cpp:454:12: [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 trns[256]; data/gif2apng-1.9+srconly/gif2apng.cpp:520:16: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). iter = atoi(szOpt+2); data/gif2apng-1.9+srconly/gif2apng.cpp:544: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(szOut, ".png"); data/gif2apng-1.9+srconly/gif2apng.cpp:559:13: [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). if ((f1 = fopen(szIn, "rb")) != 0) data/gif2apng-1.9+srconly/gif2apng.cpp:561: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. unsigned char sig[6]; data/gif2apng-1.9+srconly/gif2apng.cpp:655: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(&pal_l, &pal_g, 256*3); data/gif2apng-1.9+srconly/gif2apng.cpp:931:15: [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). if ((f2 = fopen(szOut, "wb")) != 0) data/gif2apng-1.9+srconly/gif2apng.cpp:1067:11: [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(&pal_l, &pal_g, 256*3); data/gif2apng-1.9+srconly/gif2apng.cpp:1111:11: [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(rest, frame0, imagesize); data/gif2apng-1.9+srconly/gif2apng.cpp:1126:19: [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(dst, &pal_l[*src][0], 3); data/gif2apng-1.9+srconly/gif2apng.cpp:1176:15: [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(temp, frame1, imagesize); data/gif2apng-1.9+srconly/gif2apng.cpp:1251:17: [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(frame1 + ((j+y1)*w + x1)*bpp, frame2 + ((j+y1)*w + x1)*bpp, w1*bpp); data/gif2apng-1.9+srconly/gif2apng.cpp:1263:13: [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(frame2, frame1, imagesize); data/gif2apng-1.9+srconly/gif2apng.cpp:1265:11: [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(frame1, frame0, imagesize); data/gif2apng-1.9+srconly/gif2apng.cpp:1272:15: [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(frame0, rest, imagesize); ANALYSIS SUMMARY: Hits = 35 Lines analyzed = 1357 in approximately 0.08 seconds (18027 lines/second) Physical Source Lines of Code (SLOC) = 1168 Hits@level = [0] 57 [1] 0 [2] 32 [3] 0 [4] 3 [5] 0 Hits@level+ = [0+] 92 [1+] 35 [2+] 35 [3+] 3 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 78.7671 [1+] 29.9658 [2+] 29.9658 [3+] 2.56849 [4+] 2.56849 [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.