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/libmrss-0.19.2/src/mrss_free.c Examining data/libmrss-0.19.2/src/mrss_write.c Examining data/libmrss-0.19.2/src/mrss_download.c Examining data/libmrss-0.19.2/src/mrss_edit.c Examining data/libmrss-0.19.2/src/mrss_generic.c Examining data/libmrss-0.19.2/src/mrss_options.c Examining data/libmrss-0.19.2/src/mrss_search.c Examining data/libmrss-0.19.2/src/mrss.h Examining data/libmrss-0.19.2/src/mrss_internal.h Examining data/libmrss-0.19.2/src/mrss_parser.c Examining data/libmrss-0.19.2/test/new.c Examining data/libmrss-0.19.2/test/parser.c Examining data/libmrss-0.19.2/test/search.c Examining data/libmrss-0.19.2/test/time.c Examining data/libmrss-0.19.2/test/write.c Examining data/libmrss-0.19.2/phpmrss/php.c FINAL RESULTS: data/libmrss-0.19.2/phpmrss/php.c:123: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(data->magic_code, PHP_MRSS_EXTNAME); data/libmrss-0.19.2/phpmrss/php.c:142: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(data->magic_code, PHP_MRSS_EXTNAME); data/libmrss-0.19.2/phpmrss/php.c:160: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(data->magic_code, PHP_MRSS_EXTNAME); data/libmrss-0.19.2/phpmrss/php.c:178: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(data->magic_code, PHP_MRSS_EXTNAME); data/libmrss-0.19.2/src/mrss_parser.c:235:8: [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 (total + size, p); data/libmrss-0.19.2/src/mrss_write.c:1172: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 ((FILE *) obj, str, va); data/libmrss-0.19.2/src/mrss_write.c:1185:9: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. len = vsnprintf (s, sizeof (s), str, va); data/libmrss-0.19.2/phpmrss/php.c:107: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 magic_code[5]; data/libmrss-0.19.2/src/mrss_parser.c:267: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 datebuf[256]; data/libmrss-0.19.2/src/mrss_parser.c:493:28: [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). data->image_width = atoi (c); data/libmrss-0.19.2/src/mrss_parser.c:501:29: [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). data->image_height = atoi (c); data/libmrss-0.19.2/src/mrss_parser.c:680:30: [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). item->enclosure_length = atoi (attr); data/libmrss-0.19.2/src/mrss_parser.c:1106:22: [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). data->cloud_port = atoi (attr); data/libmrss-0.19.2/src/mrss_parser.c:1127:20: [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). data->ttl = atoi (c); data/libmrss-0.19.2/src/mrss_write.c:33: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 buf[1024]; data/libmrss-0.19.2/src/mrss_write.c:1180: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 s[4096]; data/libmrss-0.19.2/src/mrss_write.c:1216: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). if (!(fl = fopen (file, "wb"))) data/libmrss-0.19.2/test/new.c:63: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 s[1024]; data/libmrss-0.19.2/test/new.c:78: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 s[1024]; data/libmrss-0.19.2/test/new.c:93: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 s1[1024]; data/libmrss-0.19.2/test/new.c:94: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 s2[1024]; data/libmrss-0.19.2/test/new.c:112: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 s1[1024]; data/libmrss-0.19.2/test/new.c:113: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 s2[1024]; data/libmrss-0.19.2/test/new.c:114: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 s3[1024]; data/libmrss-0.19.2/test/new.c:160: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 s1[1024]; data/libmrss-0.19.2/test/new.c:161: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 s2[1024]; data/libmrss-0.19.2/test/new.c:179: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 s1[1024]; data/libmrss-0.19.2/test/new.c:180: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 s2[1024]; data/libmrss-0.19.2/test/new.c:181: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 s3[1024]; data/libmrss-0.19.2/test/new.c:200:8: [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 s1[1024]; data/libmrss-0.19.2/test/new.c:201:8: [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 s2[1024]; data/libmrss-0.19.2/test/new.c:202:8: [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 s3[1024]; data/libmrss-0.19.2/src/mrss_parser.c:163: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). size = strlen (total); data/libmrss-0.19.2/src/mrss_parser.c:219: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). len = strlen (p); data/libmrss-0.19.2/src/mrss_write.c:42: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). len = strlen (str); data/libmrss-0.19.2/src/mrss_write.c:1193:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (*buffer, s, len + 1); data/libmrss-0.19.2/src/mrss_write.c:1198: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). sizeof (char) * (strlen (*buffer) + data/libmrss-0.19.2/src/mrss_write.c:1201:7: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat (*buffer, s, len + 1); ANALYSIS SUMMARY: Hits = 38 Lines analyzed = 7380 in approximately 0.22 seconds (34094 lines/second) Physical Source Lines of Code (SLOC) = 5212 Hits@level = [0] 134 [1] 6 [2] 25 [3] 0 [4] 7 [5] 0 Hits@level+ = [0+] 172 [1+] 38 [2+] 32 [3+] 7 [4+] 7 [5+] 0 Hits/KSLOC@level+ = [0+] 33.0008 [1+] 7.29087 [2+] 6.13968 [3+] 1.34305 [4+] 1.34305 [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.