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/metapixel-1.0.2/pools.h Examining data/metapixel-1.0.2/allocator.c Examining data/metapixel-1.0.2/zoom.c Examining data/metapixel-1.0.2/pools.c Examining data/metapixel-1.0.2/lispscan.h Examining data/metapixel-1.0.2/getopt1.c Examining data/metapixel-1.0.2/allocator.h Examining data/metapixel-1.0.2/metapixel.c Examining data/metapixel-1.0.2/zoom.h Examining data/metapixel-1.0.2/metapixel.h Examining data/metapixel-1.0.2/vector.h Examining data/metapixel-1.0.2/getopt.h Examining data/metapixel-1.0.2/rwimg/readimage.c Examining data/metapixel-1.0.2/rwimg/writeimage.c Examining data/metapixel-1.0.2/rwimg/rwgif.h Examining data/metapixel-1.0.2/rwimg/writeimage.h Examining data/metapixel-1.0.2/rwimg/readimage.h Examining data/metapixel-1.0.2/rwimg/rwpng.h Examining data/metapixel-1.0.2/rwimg/rwjpeg.h Examining data/metapixel-1.0.2/rwimg/rwjpeg.c Examining data/metapixel-1.0.2/rwimg/rwgif.c Examining data/metapixel-1.0.2/rwimg/rwpng.c Examining data/metapixel-1.0.2/convert.c Examining data/metapixel-1.0.2/lispreader.c Examining data/metapixel-1.0.2/getopt.c Examining data/metapixel-1.0.2/vector.c Examining data/metapixel-1.0.2/lispreader.h Examining data/metapixel-1.0.2/imagesize.c FINAL RESULTS: data/metapixel-1.0.2/convert.c:80:2: [4] (buffer) scanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. scanf("%s", filename); data/metapixel-1.0.2/metapixel.c:1437: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(tables_name, library_dir); data/metapixel-1.0.2/metapixel.c:1439:5: [4] (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). strcat(tables_name, TABLES_FILENAME); data/metapixel-1.0.2/metapixel.c:1477: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(pixel->filename, library_dir); data/metapixel-1.0.2/metapixel.c:1479:3: [4] (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). strcat(pixel->filename, filename); data/metapixel-1.0.2/metapixel.c:1772: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(filename, homedir); data/metapixel-1.0.2/metapixel.c:1774:5: [4] (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). strcat(filename, RC_FILE_NAME); data/metapixel-1.0.2/metapixel.c:1776:9: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(filename, R_OK) == 0) data/metapixel-1.0.2/convert.c:51:11: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. option = getopt_long(argc, argv, "w:h:", long_options, &option_index); data/metapixel-1.0.2/getopt.c:197:7: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *getenv (); data/metapixel-1.0.2/getopt.c:328:21: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. posixly_correct = getenv ("POSIXLY_CORRECT"); data/metapixel-1.0.2/getopt.c:355:25: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. nonoption_flags = getenv (var); data/metapixel-1.0.2/getopt.c:748:1: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (argc, argv, optstring) data/metapixel-1.0.2/getopt.c:778:11: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt (argc, argv, "abc:d:0123456789"); data/metapixel-1.0.2/getopt.h:102:12: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt (int argc, char *const *argv, const char *shortopts); data/metapixel-1.0.2/getopt.h:104:12: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt (); data/metapixel-1.0.2/getopt.h:106:12: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt_long (int argc, char *const *argv, const char *shortopts, data/metapixel-1.0.2/getopt.h:118:12: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt (); data/metapixel-1.0.2/getopt.h:119:12: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt_long (); data/metapixel-1.0.2/getopt1.c:51:7: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *getenv (); data/metapixel-1.0.2/getopt1.c:59:1: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt_long (argc, argv, options, long_options, opt_index) data/metapixel-1.0.2/getopt1.c:115:11: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt_long (argc, argv, "abc:d:0123456789", data/metapixel-1.0.2/metapixel.c:1369:10: [3] (random) random: 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. x = random() % in_image_width - small_width / 2; data/metapixel-1.0.2/metapixel.c:1370:10: [3] (random) random: 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. y = random() % in_image_height - small_height / 2; data/metapixel-1.0.2/metapixel.c:1763:15: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. homedir = getenv("HOME"); data/metapixel-1.0.2/metapixel.c:1976:11: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. option = getopt_long(argc, argv, "l:m:e:w:h:y:i:q:s:cd:a:x:f:", long_options, &option_index); data/metapixel-1.0.2/allocator.c:63:2: [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, str, len); data/metapixel-1.0.2/convert.c:59:17: [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). small_width = atoi(optarg); data/metapixel-1.0.2/convert.c:63:18: [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). small_height = atoi(optarg); data/metapixel-1.0.2/convert.c:76: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 filename[1024]; data/metapixel-1.0.2/convert.c:111:13: [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. static char *channel_names[NUM_CHANNELS] = { "y", "i", "q" }; data/metapixel-1.0.2/getopt.c:353: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 var[100]; data/metapixel-1.0.2/getopt.c:354:7: [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 (var, "_%d_GNU_nonoption_argv_flags_", getpid ()); data/metapixel-1.0.2/lispreader.c:49: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. static char token_string[MAX_TOKEN_LENGTH + 1] = ""; data/metapixel-1.0.2/lispreader.c:82: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(token_string, mmap_token_start, token_length); data/metapixel-1.0.2/lispreader.c:204: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). fd = open(path, O_RDONLY, 0); data/metapixel-1.0.2/lispreader.c:318: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(obj->v.string, str, len + 1); data/metapixel-1.0.2/lispreader.c:507:54: [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). return lisp_make_integer_with_allocator(allocator, atoi(token_string)); data/metapixel-1.0.2/metapixel.c:311:2: [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, new_row, sizeof(float) * NUM_CHANNELS * h * 2); data/metapixel-1.0.2/metapixel.c:367: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(new_row, row, sizeof(float) * NUM_CHANNELS * IMAGE_SIZE); data/metapixel-1.0.2/metapixel.c:383:2: [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, new_row, sizeof(float) * NUM_CHANNELS * IMAGE_SIZE); data/metapixel-1.0.2/metapixel.c:690:63: [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. generate_metapixel_coefficients (metapixel_t *pixel, unsigned char *image_data, data/metapixel-1.0.2/metapixel.c:888:2: [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 + NUM_CHANNELS * (x + (y + i) * width), data/metapixel-1.0.2/metapixel.c:1435: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 tables_name[dir_strlen + 1 + strlen(TABLES_FILENAME) + 1]; data/metapixel-1.0.2/metapixel.c:1669:22: [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 *protocol_in = fopen(in_protocol_name, "rb"); data/metapixel-1.0.2/metapixel.c:1716:23: [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 *protocol_out = fopen(out_protocol_name, "wb"); data/metapixel-1.0.2/metapixel.c:2050:33: [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). small_width = prepare_width = atoi(optarg); data/metapixel-1.0.2/metapixel.c:2054:35: [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). small_height = prepare_height = atoi(optarg); data/metapixel-1.0.2/metapixel.c:2078:49: [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). classic_min_distance = collage_min_distance = atoi(optarg); data/metapixel-1.0.2/metapixel.c:2082:11: [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). cheat = atoi(optarg); data/metapixel-1.0.2/metapixel.c:2110:34: [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). forbid_reconstruction_radius = atoi(optarg) + 1; data/metapixel-1.0.2/metapixel.c:2233:16: [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). tables_file = fopen(tables_name, "ab"); data/metapixel-1.0.2/metapixel.c:2321:7: [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(pixel->filename, "(%d,%d)", x, y); data/metapixel-1.0.2/metapixel.c:2365:17: [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 *in = fopen(argv[optind], "rb"); data/metapixel-1.0.2/metapixel.h:82: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 subpixels[NUM_SUBPIXELS * NUM_CHANNELS]; data/metapixel-1.0.2/metapixel.h:128: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 subpixels[NUM_SUBPIXELS * NUM_CHANNELS]; data/metapixel-1.0.2/rwimg/readimage.c:45: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 magic[4]; data/metapixel-1.0.2/rwimg/readimage.c:53:12: [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 = fopen(filename, "r"); data/metapixel-1.0.2/rwimg/rwgif.c:150: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(lines, data->rgb, data->width * num_lines * 3); data/metapixel-1.0.2/rwimg/rwjpeg.c:48:18: [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). data->file = fopen(filename, "rb"); data/metapixel-1.0.2/rwimg/rwjpeg.c:128:18: [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). data->file = fopen(filename, "wb"); data/metapixel-1.0.2/rwimg/rwpng.c:48:18: [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). data->file = fopen(filename, "r"); data/metapixel-1.0.2/rwimg/rwpng.c:185:18: [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). data->file = fopen(filename, "w"); data/metapixel-1.0.2/zoom.c:328:17: [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). dst_width = atoi(argv[2]); data/metapixel-1.0.2/zoom.c:329:18: [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). dst_height = atoi(argv[3]); data/metapixel-1.0.2/allocator.c:59: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). size_t len = strlen(str) + 1; data/metapixel-1.0.2/convert.c:84: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). assert(strlen(filename) > 0); data/metapixel-1.0.2/getopt.c:221: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). extern int strlen (const char *); data/metapixel-1.0.2/getopt.c:359:24: [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). nonoption_flags_len = strlen (nonoption_flags); data/metapixel-1.0.2/getopt.c:561:32: [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 (nameend - nextchar == strlen (p->name)) data/metapixel-1.0.2/getopt.c:585: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). nextchar += strlen (nextchar); data/metapixel-1.0.2/getopt.c:615:17: [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). nextchar += strlen (nextchar); data/metapixel-1.0.2/getopt.c:631:17: [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). nextchar += strlen (nextchar); data/metapixel-1.0.2/getopt.c:636: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). nextchar += strlen (nextchar); data/metapixel-1.0.2/lispreader.c:97:13: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return getc(stream->v.file); data/metapixel-1.0.2/lispreader.c:259:32: [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). stream->v.mmap.end = buf + strlen(buf); data/metapixel-1.0.2/lispreader.c:327:71: [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 lisp_make_symbol_with_allocator_internal(allocator, value, strlen(value)); data/metapixel-1.0.2/lispreader.c:962: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). for (i = strlen(x) - 1; i >= 0; --i) data/metapixel-1.0.2/metapixel.c:1434:22: [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 dir_strlen = strlen(library_dir); data/metapixel-1.0.2/metapixel.c:1435: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). char tables_name[dir_strlen + 1 + strlen(TABLES_FILENAME) + 1]; data/metapixel-1.0.2/metapixel.c:1438:5: [1] (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 character. strcat(tables_name, "/"); data/metapixel-1.0.2/metapixel.c:1475:52: [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). pixel->filename = (char*)malloc(dir_strlen + 1 + strlen(filename) + 1); data/metapixel-1.0.2/metapixel.c:1478:3: [1] (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 character. strcat(pixel->filename, "/"); data/metapixel-1.0.2/metapixel.c:1771: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). filename = (char*)malloc(strlen(homedir) + 1 + strlen(RC_FILE_NAME) + 1); data/metapixel-1.0.2/metapixel.c:1771:52: [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). filename = (char*)malloc(strlen(homedir) + 1 + strlen(RC_FILE_NAME) + 1); data/metapixel-1.0.2/metapixel.c:1773:5: [1] (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 character. strcat(filename, "/"); data/metapixel-1.0.2/rwimg/writeimage.c:55:24: [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 filename_len = strlen(filename); data/metapixel-1.0.2/rwimg/writeimage.c:60: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 suffix_len = strlen(formats[i].suffix); ANALYSIS SUMMARY: Hits = 88 Lines analyzed = 7713 in approximately 0.23 seconds (34106 lines/second) Physical Source Lines of Code (SLOC) = 5428 Hits@level = [0] 137 [1] 23 [2] 39 [3] 18 [4] 8 [5] 0 Hits@level+ = [0+] 225 [1+] 88 [2+] 65 [3+] 26 [4+] 8 [5+] 0 Hits/KSLOC@level+ = [0+] 41.4517 [1+] 16.2122 [2+] 11.9749 [3+] 4.78998 [4+] 1.47384 [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.