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/mpeg2dec-0.5.1/vc++/config.h Examining data/mpeg2dec-0.5.1/vc++/inttypes.h Examining data/mpeg2dec-0.5.1/src/mpeg2dec.c Examining data/mpeg2dec-0.5.1/src/dump_state.c Examining data/mpeg2dec-0.5.1/src/corrupt_mpeg2.c Examining data/mpeg2dec-0.5.1/src/gettimeofday.c Examining data/mpeg2dec-0.5.1/src/getopt.h Examining data/mpeg2dec-0.5.1/src/extract_mpeg2.c Examining data/mpeg2dec-0.5.1/src/gettimeofday.h Examining data/mpeg2dec-0.5.1/src/getopt.c Examining data/mpeg2dec-0.5.1/include/mpeg2.h Examining data/mpeg2dec-0.5.1/include/mmx.h Examining data/mpeg2dec-0.5.1/include/video_out.h Examining data/mpeg2dec-0.5.1/include/mpeg2convert.h Examining data/mpeg2dec-0.5.1/include/alpha_asm.h Examining data/mpeg2dec-0.5.1/include/attributes.h Examining data/mpeg2dec-0.5.1/include/vis.h Examining data/mpeg2dec-0.5.1/include/tendra.h Examining data/mpeg2dec-0.5.1/doc/sample3.c Examining data/mpeg2dec-0.5.1/doc/sample4.c Examining data/mpeg2dec-0.5.1/doc/sample5.c Examining data/mpeg2dec-0.5.1/doc/sample1.c Examining data/mpeg2dec-0.5.1/doc/sample2.c Examining data/mpeg2dec-0.5.1/doc/sample6.c Examining data/mpeg2dec-0.5.1/libmpeg2/idct_mmx.c Examining data/mpeg2dec-0.5.1/libmpeg2/convert/rgb.c Examining data/mpeg2dec-0.5.1/libmpeg2/convert/rgb_mmx.c Examining data/mpeg2dec-0.5.1/libmpeg2/convert/rgb_vis.c Examining data/mpeg2dec-0.5.1/libmpeg2/convert/convert_internal.h Examining data/mpeg2dec-0.5.1/libmpeg2/convert/uyvy.c Examining data/mpeg2dec-0.5.1/libmpeg2/slice.c Examining data/mpeg2dec-0.5.1/libmpeg2/decode.c Examining data/mpeg2dec-0.5.1/libmpeg2/cpu_state.c Examining data/mpeg2dec-0.5.1/libmpeg2/vlc.h Examining data/mpeg2dec-0.5.1/libmpeg2/idct_altivec.c Examining data/mpeg2dec-0.5.1/libmpeg2/cpu_accel.c Examining data/mpeg2dec-0.5.1/libmpeg2/motion_comp.c Examining data/mpeg2dec-0.5.1/libmpeg2/motion_comp_alpha.c Examining data/mpeg2dec-0.5.1/libmpeg2/motion_comp_altivec.c Examining data/mpeg2dec-0.5.1/libmpeg2/motion_comp_mmx.c Examining data/mpeg2dec-0.5.1/libmpeg2/idct.c Examining data/mpeg2dec-0.5.1/libmpeg2/header.c Examining data/mpeg2dec-0.5.1/libmpeg2/idct_alpha.c Examining data/mpeg2dec-0.5.1/libmpeg2/alloc.c Examining data/mpeg2dec-0.5.1/libmpeg2/motion_comp_arm.c Examining data/mpeg2dec-0.5.1/libmpeg2/motion_comp_vis.c Examining data/mpeg2dec-0.5.1/libmpeg2/mpeg2_internal.h Examining data/mpeg2dec-0.5.1/libvo/video_out_sdl.c Examining data/mpeg2dec-0.5.1/libvo/video_out_null.c Examining data/mpeg2dec-0.5.1/libvo/video_out_dx.c Examining data/mpeg2dec-0.5.1/libvo/video_out_pgm.c Examining data/mpeg2dec-0.5.1/libvo/video_out.c Examining data/mpeg2dec-0.5.1/libvo/video_out_x11.c Examining data/mpeg2dec-0.5.1/libvo/vo_internal.h FINAL RESULTS: data/mpeg2dec-0.5.1/src/mpeg2dec.c:770:5: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf (stderr, PACKAGE"-"VERSION data/mpeg2dec-0.5.1/libvo/video_out_dx.c:210:28: [3] (misc) LoadLibrary: Ensure that the full path to the library is specified, or current directory may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to find library path, if you aren't already. instance->hddraw_dll = LoadLibrary ("DDRAW.DLL"); data/mpeg2dec-0.5.1/src/corrupt_mpeg2.c:167:17: [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. while ((c = getopt (argc, argv, "hl:s:r:v:")) != -1) data/mpeg2dec-0.5.1/src/corrupt_mpeg2.c:330: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 (time (NULL)); data/mpeg2dec-0.5.1/src/extract_mpeg2.c:61:17: [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. while ((c = getopt (argc, argv, "hs:t:p")) != -1) data/mpeg2dec-0.5.1/src/getopt.c:210:9: [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. #ifndef getenv data/mpeg2dec-0.5.1/src/getopt.c:211:14: [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. extern char *getenv (); data/mpeg2dec-0.5.1/src/getopt.c:403: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/mpeg2dec-0.5.1/src/getopt.c:972: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/mpeg2dec-0.5.1/src/getopt.c:1002: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/mpeg2dec-0.5.1/src/getopt.h:134: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/mpeg2dec-0.5.1/src/getopt.h:136: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/mpeg2dec-0.5.1/src/getopt.h:140: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/mpeg2dec-0.5.1/src/getopt.h:153: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/mpeg2dec-0.5.1/src/getopt.h:155: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/mpeg2dec-0.5.1/src/mpeg2dec.c:165:17: [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. while ((c = getopt (argc, argv, "hs::t:pco:vb::")) != -1) data/mpeg2dec-0.5.1/doc/sample1.c:42: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 filename[100]; data/mpeg2dec-0.5.1/doc/sample1.c:47:5: [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 (filename, "%d.pgm", num); data/mpeg2dec-0.5.1/doc/sample1.c:48: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). pgmfile = fopen (filename, "wb"); data/mpeg2dec-0.5.1/doc/sample1.c:114: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). mpgfile = fopen (argv[1], "rb"); data/mpeg2dec-0.5.1/doc/sample2.c:41: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 filename[100]; data/mpeg2dec-0.5.1/doc/sample2.c:44:5: [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 (filename, "%d.ppm", num); data/mpeg2dec-0.5.1/doc/sample2.c:45: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). ppmfile = fopen (filename, "wb"); data/mpeg2dec-0.5.1/doc/sample2.c:103: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). mpgfile = fopen (argv[1], "rb"); data/mpeg2dec-0.5.1/doc/sample3.c:44: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 filename[100]; data/mpeg2dec-0.5.1/doc/sample3.c:49:5: [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 (filename, "%d.pgm", num); data/mpeg2dec-0.5.1/doc/sample3.c:50: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). pgmfile = fopen (filename, "wb"); data/mpeg2dec-0.5.1/doc/sample3.c:141: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). mpgfile = fopen (argv[1], "rb"); data/mpeg2dec-0.5.1/doc/sample4.c:41: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 filename[100]; data/mpeg2dec-0.5.1/doc/sample4.c:44:5: [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 (filename, "%d.ppm", num); data/mpeg2dec-0.5.1/doc/sample4.c:45: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). ppmfile = fopen (filename, "wb"); data/mpeg2dec-0.5.1/doc/sample4.c:119: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). mpgfile = fopen (argv[1], "rb"); data/mpeg2dec-0.5.1/doc/sample5.c:44: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 filename[100]; data/mpeg2dec-0.5.1/doc/sample5.c:49:5: [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 (filename, "%d.pgm", num); data/mpeg2dec-0.5.1/doc/sample5.c:50: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). pgmfile = fopen (filename, "wb"); data/mpeg2dec-0.5.1/doc/sample5.c:170: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). mpgfile = fopen (argv[1], "rb"); data/mpeg2dec-0.5.1/doc/sample6.c:41: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 filename[100]; data/mpeg2dec-0.5.1/doc/sample6.c:44:5: [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 (filename, "%d.ppm", num); data/mpeg2dec-0.5.1/doc/sample6.c:45: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). ppmfile = fopen (filename, "wb"); data/mpeg2dec-0.5.1/doc/sample6.c:148: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). mpgfile = fopen (argv[1], "rb"); data/mpeg2dec-0.5.1/include/mmx.h:40: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 b[8]; /* 8 Byte (8-bit) values */ data/mpeg2dec-0.5.1/include/mmx.h:41: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 ub[8]; /* 8 Unsigned Byte */ data/mpeg2dec-0.5.1/include/mmx.h:273: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 b[16]; /* 8 Byte (8-bit) values */ data/mpeg2dec-0.5.1/include/mmx.h:274: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 ub[16]; /* 8 Unsigned Byte */ data/mpeg2dec-0.5.1/include/video_out.h:55: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). vo_open_t * open; data/mpeg2dec-0.5.1/libmpeg2/header.c:415: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 (mpeg2dec->quantizer_matrix[idx], data/mpeg2dec-0.5.1/libvo/video_out_dx.c:455: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 (dest[0], buf[0] + 2 * i * width, width); data/mpeg2dec-0.5.1/libvo/video_out_dx.c:457: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 (dest[0], buf[0] + (2 * i + 1) * width, width); data/mpeg2dec-0.5.1/libvo/video_out_dx.c:459: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 (dest[1], buf[1] + i * (width >> 1), width >> 1); data/mpeg2dec-0.5.1/libvo/video_out_dx.c:461: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 (dest[2], buf[2] + i * (width >> 1), width >> 1); data/mpeg2dec-0.5.1/libvo/video_out_pgm.c:43: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 header[1024]; data/mpeg2dec-0.5.1/libvo/video_out_pgm.c:82: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 filename[128]; data/mpeg2dec-0.5.1/libvo/video_out_pgm.c:84:5: [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 (filename, "%d.pgm", instance->framenum++); data/mpeg2dec-0.5.1/libvo/video_out_pgm.c:85: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). instance->file = fopen (filename, "wb"); data/mpeg2dec-0.5.1/libvo/video_out_pgm.c:115:5: [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 (instance->header, "P5\n%d %d\n255\n", 2 * chroma_width, data/mpeg2dec-0.5.1/libvo/video_out_pgm.c:276: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 ((char *)instance->md5_block + offset, ptr, size); data/mpeg2dec-0.5.1/libvo/video_out_pgm.c:280: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 ((char *)instance->md5_block + offset, ptr, avail); data/mpeg2dec-0.5.1/libvo/video_out_pgm.c:289: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 (instance->md5_block, ptr, 64); data/mpeg2dec-0.5.1/libvo/video_out_pgm.c:299: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 (instance->md5_block, ptr, size); data/mpeg2dec-0.5.1/src/corrupt_mpeg2.c:181: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). seed_file = fopen (optarg, "wt"); data/mpeg2dec-0.5.1/src/corrupt_mpeg2.c:211: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). in_file = fopen (argv[optind], "rb"); data/mpeg2dec-0.5.1/src/corrupt_mpeg2.c:221: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). seed_file = fopen ("seed", "wt"); data/mpeg2dec-0.5.1/src/corrupt_mpeg2.c:304: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 (buf, terminator, 4); data/mpeg2dec-0.5.1/src/corrupt_mpeg2.c:306: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 (lastbuf_end, buf, 4); data/mpeg2dec-0.5.1/src/corrupt_mpeg2.c:312: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 (end, terminator, 4); data/mpeg2dec-0.5.1/src/dump_state.c:330: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 prim[16], trans[16], matrix[16]; data/mpeg2dec-0.5.1/src/dump_state.c:331:3: [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 (prim, "%d", seq->colour_primaries); data/mpeg2dec-0.5.1/src/dump_state.c:332:3: [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 (trans, "%d", seq->transfer_characteristics); data/mpeg2dec-0.5.1/src/dump_state.c:333:3: [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 (matrix, "%d", seq->matrix_coefficients); data/mpeg2dec-0.5.1/src/extract_mpeg2.c:90: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). in_file = fopen (argv[optind], "rb"); data/mpeg2dec-0.5.1/src/extract_mpeg2.c:142: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 (header + bytes, buf, missing); \ data/mpeg2dec-0.5.1/src/extract_mpeg2.c:146: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 (header + bytes, buf, end - buf); \ data/mpeg2dec-0.5.1/src/extract_mpeg2.c:151: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 (head_buf, header, bytes); \ data/mpeg2dec-0.5.1/src/extract_mpeg2.c:440: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 (buffer, buf, end - buf); data/mpeg2dec-0.5.1/src/mpeg2dec.c:170:32: [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). output_open = drivers[i].open; data/mpeg2dec-0.5.1/src/mpeg2dec.c:228:27: [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). output_open = drivers[0].open; data/mpeg2dec-0.5.1/src/mpeg2dec.c:231: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). in_file = fopen (argv[optind], "rb"); data/mpeg2dec-0.5.1/src/mpeg2dec.c:400: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 (header + bytes, buf, missing); \ data/mpeg2dec-0.5.1/src/mpeg2dec.c:404: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 (header + bytes, buf, end - buf); \ data/mpeg2dec-0.5.1/src/mpeg2dec.c:409: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 (head_buf, header, bytes); \ data/mpeg2dec-0.5.1/src/mpeg2dec.c:743: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 (buffer, buf, end - buf); data/mpeg2dec-0.5.1/libmpeg2/slice.c:350:9: [1] (buffer) mismatch: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. int mismatch; data/mpeg2dec-0.5.1/libmpeg2/slice.c:386:6: [1] (buffer) mismatch: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. mismatch ^= val; data/mpeg2dec-0.5.1/libmpeg2/slice.c:415:6: [1] (buffer) mismatch: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. mismatch ^= val; data/mpeg2dec-0.5.1/libmpeg2/slice.c:447:17: [1] (buffer) mismatch: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. dest[63] ^= mismatch & 16; data/mpeg2dec-0.5.1/libmpeg2/slice.c:461:9: [1] (buffer) mismatch: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. int mismatch; data/mpeg2dec-0.5.1/libmpeg2/slice.c:496:3: [1] (buffer) mismatch: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. mismatch ^= val; data/mpeg2dec-0.5.1/libmpeg2/slice.c:524:3: [1] (buffer) mismatch: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. mismatch ^= val; data/mpeg2dec-0.5.1/libmpeg2/slice.c:557:17: [1] (buffer) mismatch: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. dest[63] ^= mismatch & 16; data/mpeg2dec-0.5.1/libmpeg2/slice.c:571:9: [1] (buffer) mismatch: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. int mismatch; data/mpeg2dec-0.5.1/libmpeg2/slice.c:613:6: [1] (buffer) mismatch: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. mismatch ^= val; data/mpeg2dec-0.5.1/libmpeg2/slice.c:646:6: [1] (buffer) mismatch: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. mismatch ^= val; data/mpeg2dec-0.5.1/libmpeg2/slice.c:678:17: [1] (buffer) mismatch: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. dest[63] ^= mismatch & 16; data/mpeg2dec-0.5.1/libvo/video_out_pgm.c:63: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). strlen (instance->header)); data/mpeg2dec-0.5.1/src/dump_state.c:336:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (prim, colour[seq->colour_primaries], 15); data/mpeg2dec-0.5.1/src/dump_state.c:339:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (trans, colour[seq->transfer_characteristics], 15); data/mpeg2dec-0.5.1/src/dump_state.c:341:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (matrix, "FCC", 15); data/mpeg2dec-0.5.1/src/dump_state.c:344:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (matrix, colour[seq->matrix_coefficients], 15); data/mpeg2dec-0.5.1/src/getopt.c:233:51: [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 (!defined __STDC__ || !__STDC__) && !defined strlen data/mpeg2dec-0.5.1/src/getopt.c:236: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/mpeg2dec-0.5.1/src/getopt.c:434:44: [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 len = nonoption_flags_max_len = strlen (orig_str); data/mpeg2dec-0.5.1/src/getopt.c:659:21: [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). == (unsigned int) strlen (p->name)) data/mpeg2dec-0.5.1/src/getopt.c:683: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/mpeg2dec-0.5.1/src/getopt.c:715: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/mpeg2dec-0.5.1/src/getopt.c:731: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/mpeg2dec-0.5.1/src/getopt.c:736: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/mpeg2dec-0.5.1/src/getopt.c:847:51: [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 ((unsigned int) (nameend - nextchar) == strlen (p->name)) data/mpeg2dec-0.5.1/src/getopt.c:870: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). nextchar += strlen (nextchar); data/mpeg2dec-0.5.1/src/getopt.c:890: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). nextchar += strlen (nextchar); data/mpeg2dec-0.5.1/src/getopt.c:904: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). nextchar += strlen (nextchar); data/mpeg2dec-0.5.1/src/getopt.c:908: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). nextchar += strlen (nextchar); ANALYSIS SUMMARY: Hits = 111 Lines analyzed = 20603 in approximately 0.58 seconds (35682 lines/second) Physical Source Lines of Code (SLOC) = 15471 Hits@level = [0] 168 [1] 30 [2] 65 [3] 15 [4] 1 [5] 0 Hits@level+ = [0+] 279 [1+] 111 [2+] 81 [3+] 16 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 18.0337 [1+] 7.17471 [2+] 5.2356 [3+] 1.03419 [4+] 0.0646371 [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.