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/gopchop-1.1.8/tests/test-stub.cpp Examining data/gopchop-1.1.8/libvo/video_out_pgm.c Examining data/gopchop-1.1.8/libvo/video_out_null.c Examining data/gopchop-1.1.8/libvo/video_out_dx.c Examining data/gopchop-1.1.8/libvo/video_out_x11.c Examining data/gopchop-1.1.8/libvo/video_out.c Examining data/gopchop-1.1.8/libvo/video_out_sdl.c Examining data/gopchop-1.1.8/src/widgets.cpp Examining data/gopchop-1.1.8/src/mpegcat.c Examining data/gopchop-1.1.8/src/interface.h Examining data/gopchop-1.1.8/src/Bounds.h Examining data/gopchop-1.1.8/src/Picture.h Examining data/gopchop-1.1.8/src/callbacks.h Examining data/gopchop-1.1.8/src/sessions.cpp Examining data/gopchop-1.1.8/src/rc.h Examining data/gopchop-1.1.8/src/GOPutils.cpp Examining data/gopchop-1.1.8/src/FirstPack.h Examining data/gopchop-1.1.8/src/callbacks.cpp Examining data/gopchop-1.1.8/src/Parser.h Examining data/gopchop-1.1.8/src/List.h Examining data/gopchop-1.1.8/src/sessions.h Examining data/gopchop-1.1.8/src/display.h Examining data/gopchop-1.1.8/src/MPEG2Parser.h Examining data/gopchop-1.1.8/src/List.cpp Examining data/gopchop-1.1.8/src/m2parse.cpp Examining data/gopchop-1.1.8/src/interface.c Examining data/gopchop-1.1.8/src/rc.c Examining data/gopchop-1.1.8/src/Pack.cpp Examining data/gopchop-1.1.8/src/main.h Examining data/gopchop-1.1.8/src/Pack.h Examining data/gopchop-1.1.8/src/ElementStream.h Examining data/gopchop-1.1.8/src/MPEG2Parser.cpp Examining data/gopchop-1.1.8/src/GOPutils.h Examining data/gopchop-1.1.8/src/file_buffer.c Examining data/gopchop-1.1.8/src/FirstPack.cpp Examining data/gopchop-1.1.8/src/Vector.cpp Examining data/gopchop-1.1.8/src/mpeg2structs.h Examining data/gopchop-1.1.8/src/Bounds.cpp Examining data/gopchop-1.1.8/src/mpeg2consts.h Examining data/gopchop-1.1.8/src/file_buffer.h Examining data/gopchop-1.1.8/src/mpeg2consts.c Examining data/gopchop-1.1.8/src/Vector.h Examining data/gopchop-1.1.8/src/GroupOfPictures.cpp Examining data/gopchop-1.1.8/src/support.c Examining data/gopchop-1.1.8/src/gtkspu.c Examining data/gopchop-1.1.8/src/display.cpp Examining data/gopchop-1.1.8/src/widgets.h Examining data/gopchop-1.1.8/src/GroupOfPictures.h Examining data/gopchop-1.1.8/src/ElementStream.cpp Examining data/gopchop-1.1.8/src/support.h Examining data/gopchop-1.1.8/src/Picture.cpp Examining data/gopchop-1.1.8/src/Main.cpp Examining data/gopchop-1.1.8/src/Parser.cpp Examining data/gopchop-1.1.8/include/video_out.h Examining data/gopchop-1.1.8/include/gettext.h Examining data/gopchop-1.1.8/include/GOPchop.h FINAL RESULTS: data/gopchop-1.1.8/src/Bounds.cpp:36:26: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define REPORT(f, s...) printf(f, ##s) data/gopchop-1.1.8/src/MPEG2Parser.cpp:52:28: [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. #define WRITE_OUT(t, s...) fprintf(report, t, ##s) data/gopchop-1.1.8/src/Main.cpp:215:9: [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(lasttask, task); data/gopchop-1.1.8/src/Main.cpp:402:9: [4] (format) snprintf: 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. snprintf(report,REPORT_LENGTH,finish == 1 data/gopchop-1.1.8/src/Main.cpp:407:9: [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, report, clip_info.written_bytes); data/gopchop-1.1.8/src/Main.cpp:447:5: [4] (format) snprintf: 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. snprintf(report,REPORT_LENGTH,finish == 1 data/gopchop-1.1.8/src/Main.cpp:452: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, report, speed); data/gopchop-1.1.8/src/Main.cpp:460:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(gop_cache_filename,"%s.gop",filename); data/gopchop-1.1.8/src/Main.cpp:694:9: [4] (format) snprintf: 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. snprintf(dataoffset, 128, "%" OFF_T_FORMAT, pic_start); data/gopchop-1.1.8/src/Main.cpp:695:9: [4] (format) snprintf: 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. snprintf(datasize, 128, "%" OFF_T_FORMAT, pic_len); data/gopchop-1.1.8/src/Main.cpp:753:5: [4] (format) snprintf: 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. snprintf(dataoffset, 128, "%" OFF_T_FORMAT, gop_start); data/gopchop-1.1.8/src/Main.cpp:754:5: [4] (format) snprintf: 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. snprintf(datasize, 128, "%" OFF_T_FORMAT, gop_len); data/gopchop-1.1.8/src/Main.cpp:764:5: [4] (format) snprintf: 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. snprintf(dataoffset, 128, "%" OFF_T_FORMAT, gop_start); data/gopchop-1.1.8/src/Main.cpp:765:5: [4] (format) snprintf: 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. snprintf(datasize, 128, "%" OFF_T_FORMAT, audio_len); data/gopchop-1.1.8/src/Parser.cpp:283:5: [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. vsnprintf(buf, 1024, fmt, vaptr); data/gopchop-1.1.8/src/Parser.cpp:304: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(error, buf); data/gopchop-1.1.8/src/callbacks.cpp:278:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(result,"%s%s",one,two); data/gopchop-1.1.8/src/callbacks.cpp:655:10: [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, F_OK) ) { data/gopchop-1.1.8/src/callbacks.cpp:707:10: [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, F_OK) ) { data/gopchop-1.1.8/src/display.cpp:431:13: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl(shell,shell,"-c", opt_output_arg, NULL); data/gopchop-1.1.8/src/mpegcat.c:614:21: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(length_str, length_format, data/gopchop-1.1.8/src/mpegcat.c:687:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " Picture (%s) Start (%u)", data/gopchop-1.1.8/src/mpegcat.c:724:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, data/gopchop-1.1.8/src/mpegcat.c:791:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, data/gopchop-1.1.8/src/mpegcat.c:873:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer," System Header (scrambling: %d)%s", data/gopchop-1.1.8/src/mpegcat.c:877:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " System Header%s", length_str); data/gopchop-1.1.8/src/mpegcat.c:882:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " Program Stream Map%s", length_str); data/gopchop-1.1.8/src/mpegcat.c:887:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer," Private Stream 1 (scrambling: %d)%s", data/gopchop-1.1.8/src/mpegcat.c:922:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " DVD Audio 0x%02X (%s %d)%s", data/gopchop-1.1.8/src/mpegcat.c:929:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " Private Stream 1%s", length_str); data/gopchop-1.1.8/src/mpegcat.c:936:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " Padding Stream%s", length_str); data/gopchop-1.1.8/src/mpegcat.c:941:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " %s%s", data/gopchop-1.1.8/src/mpegcat.c:948:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " ECM Stream%s", length_str); data/gopchop-1.1.8/src/mpegcat.c:953:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " EMM Stream%s", length_str); data/gopchop-1.1.8/src/mpegcat.c:958:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " DSMCC Stream%s", length_str); data/gopchop-1.1.8/src/mpegcat.c:964:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer," ISO13522 Stream (scrambling: %d)%s", data/gopchop-1.1.8/src/mpegcat.c:968:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " ISO13522 Stream%s", length_str); data/gopchop-1.1.8/src/mpegcat.c:974:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer," H222.1A (scrambling: %d)%s", data/gopchop-1.1.8/src/mpegcat.c:978:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " H222.1A%s", length_str); data/gopchop-1.1.8/src/mpegcat.c:984:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer," H222.1B (scrambling: %d)%s", data/gopchop-1.1.8/src/mpegcat.c:988:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " H222.1B%s", length_str); data/gopchop-1.1.8/src/mpegcat.c:994:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer," H222.1C (scrambling: %d)%s", data/gopchop-1.1.8/src/mpegcat.c:998:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " H222.1C%s", length_str); data/gopchop-1.1.8/src/mpegcat.c:1004:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer," H222.1D (scrambling: %d)%s", data/gopchop-1.1.8/src/mpegcat.c:1008:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " H222.1D%s", length_str); data/gopchop-1.1.8/src/mpegcat.c:1013:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " H222.1E Stream%s", length_str); data/gopchop-1.1.8/src/mpegcat.c:1019:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer," Ancillary Stream (scrambling: %d)%s", data/gopchop-1.1.8/src/mpegcat.c:1023:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " Ancillary Stream%s", length_str); data/gopchop-1.1.8/src/mpegcat.c:1028:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " Program Stream Directory%s", length_str); data/gopchop-1.1.8/src/mpegcat.c:1036:21: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer," Slice Start (scrambling: %d)%s", data/gopchop-1.1.8/src/mpegcat.c:1040:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " Slice Start%s", length_str); data/gopchop-1.1.8/src/mpegcat.c:1048:21: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer," Video Stream 0x%02X (scrambling: %d)%s", data/gopchop-1.1.8/src/mpegcat.c:1054:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " Video Stream 0x%02X%s", data/gopchop-1.1.8/src/mpegcat.c:1065:21: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer," Audio Stream 0x%02X (scrambling: %d)%s", data/gopchop-1.1.8/src/mpegcat.c:1070:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, " Audio Stream 0x%02X%s", data/gopchop-1.1.8/src/mpegcat.c:1082:21: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer,"Reserved (scrambling: %d)%s", data/gopchop-1.1.8/src/mpegcat.c:1086:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, "Reserved%s", length_str); data/gopchop-1.1.8/src/mpegcat.c:1094:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer,"Unknown (scrambling: %d)%s", data/gopchop-1.1.8/src/mpegcat.c:1098:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(answer, "Unknown%s", length_str); data/gopchop-1.1.8/src/mpegcat.c:1230:21: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(report_format, buffer_tell(fb) - 4, byte, str); data/gopchop-1.1.8/src/mpegcat.c:1243:17: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(report_format, buffer_tell(fb), 0x00, "End of File"); data/gopchop-1.1.8/src/mpegcat.c:1251:17: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(report_format, buffer_tell(fb), 0x00, "End of Report"); data/gopchop-1.1.8/src/rc.c:65:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(dirname,"%s/.%s",path,package); data/gopchop-1.1.8/src/rc.c:68: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(dirname,W_OK)) { data/gopchop-1.1.8/src/rc.c:87:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename,"%s/%s",dirname,rc_name); data/gopchop-1.1.8/src/rc.c:160:13: [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,F_OK)==0) perror(filename); data/gopchop-1.1.8/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/gopchop-1.1.8/src/Main.cpp:872:13: [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, "Vhsv:p:", long_options, &index); data/gopchop-1.1.8/src/display.cpp:424: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. if (!(shell=getenv("SHELL"))) data/gopchop-1.1.8/src/gtkspu.c:115:13: [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, short_options, long_options, &option_index); data/gopchop-1.1.8/src/mpegcat.c:345:13: [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, short_options, long_options, data/gopchop-1.1.8/src/rc.c:54:16: [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. if (!(path=getenv("HOME"))) { data/gopchop-1.1.8/include/video_out.h:57: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/gopchop-1.1.8/libvo/video_out_dx.c:454: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/gopchop-1.1.8/libvo/video_out_dx.c:456: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/gopchop-1.1.8/libvo/video_out_dx.c:458: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/gopchop-1.1.8/libvo/video_out_dx.c:460: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/gopchop-1.1.8/libvo/video_out_pgm.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 header[1024]; data/gopchop-1.1.8/libvo/video_out_pgm.c:81: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/gopchop-1.1.8/libvo/video_out_pgm.c:83: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/gopchop-1.1.8/libvo/video_out_pgm.c:84: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/gopchop-1.1.8/libvo/video_out_pgm.c:116: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/gopchop-1.1.8/libvo/video_out_pgm.c:273: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/gopchop-1.1.8/libvo/video_out_pgm.c:277: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/gopchop-1.1.8/libvo/video_out_pgm.c:286: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/gopchop-1.1.8/libvo/video_out_pgm.c:296: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/gopchop-1.1.8/src/GOPutils.cpp:69: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 (!(fp=fopen(filename,"w"))) { data/gopchop-1.1.8/src/GOPutils.cpp:398: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(GOPareaPtr + GOPoffset, area, len); data/gopchop-1.1.8/src/GroupOfPictures.cpp:105: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. static char buf[32]; data/gopchop-1.1.8/src/MPEG2Parser.cpp:782:17: [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 report[REPORT_LENGTH]; data/gopchop-1.1.8/src/MPEG2Parser.cpp:1005:25: [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(&seq_header,bytes,sizeof(sequence_header)); data/gopchop-1.1.8/src/MPEG2Parser.cpp:1226: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). report = fopen("mpeg2parsing.output", "w"); data/gopchop-1.1.8/src/Main.cpp:343: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 buf[1024]; data/gopchop-1.1.8/src/Main.cpp:349:19: [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 (!(mpeg2 = fopen(filename, "w"))) data/gopchop-1.1.8/src/Main.cpp:357:9: [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 report[REPORT_LENGTH]; data/gopchop-1.1.8/src/Main.cpp:414: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 buf[128]; data/gopchop-1.1.8/src/Main.cpp:416: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 report[REPORT_LENGTH]; data/gopchop-1.1.8/src/Main.cpp:475: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(buf, _("Clips: %d"), count); data/gopchop-1.1.8/src/Main.cpp:575: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(seqbuf,_("GOP %u information:"),num); data/gopchop-1.1.8/src/Main.cpp:789: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. const char *frame_type_map[MAX_FRAME_TYPES] = { data/gopchop-1.1.8/src/Parser.cpp:122:15: [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). if ((fd = open(pathname, OPEN_MODE)) < 0) data/gopchop-1.1.8/src/Parser.cpp:272: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 buf[1024]; data/gopchop-1.1.8/src/callbacks.cpp:443: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. static char buf[1024]; data/gopchop-1.1.8/src/callbacks.cpp:863:9: [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[128]; data/gopchop-1.1.8/src/callbacks.cpp:868:9: [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(buf, "%d", mark_start); data/gopchop-1.1.8/src/display.cpp:110: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). ves_debug = fopen("video.es", "a"); data/gopchop-1.1.8/src/display.cpp:483:31: [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). return drivers[i].open; data/gopchop-1.1.8/src/file_buffer.c:127: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). if (!(fp = fopen(filename, "r"))) { data/gopchop-1.1.8/src/file_buffer.c:221: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(bytes,fb->buffer+fb->buffer_min,count); data/gopchop-1.1.8/src/file_buffer.h:82:24: [2] (integer) atol: 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). # define ATOL(arg) atol(arg) data/gopchop-1.1.8/src/gtkspu.c:135:29: [2] (integer) atol: 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). opt_width = atol(optarg); data/gopchop-1.1.8/src/gtkspu.c:138:30: [2] (integer) atol: 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). opt_height = atol(optarg); data/gopchop-1.1.8/src/gtkspu.c:141:28: [2] (integer) atol: 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). opt_skip = atol(optarg); data/gopchop-1.1.8/src/gtkspu.c:927:25: [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). packet_wanted = atoi(argv[optind+1]); data/gopchop-1.1.8/src/m2parse.cpp:94:38: [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/gopchop-1.1.8/src/m2parse.cpp:153:16: [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). if ((out = open(argv[2], O_WRONLY | O_CREAT | O_EXCL | O_LARGEFILE, data/gopchop-1.1.8/src/m2parse.cpp:311: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 userin[128]; data/gopchop-1.1.8/src/mpeg2consts.c:124: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. static char answer[64]; data/gopchop-1.1.8/src/mpeg2consts.c:127:9: [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(answer, "%0.2fMbs", (float) speed / 1000000.0); data/gopchop-1.1.8/src/mpeg2consts.c:130:9: [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(answer, "%0.2fKbs", (float) speed / 1000.0); data/gopchop-1.1.8/src/mpeg2consts.c:133:9: [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(answer, "%dbs", speed); data/gopchop-1.1.8/src/mpegcat.c:241: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). if (!(fp = fopen(filename, "w"))) data/gopchop-1.1.8/src/mpegcat.c:489: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. static char answer[128]; data/gopchop-1.1.8/src/mpegcat.c:497: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. static char length_str[64]; data/gopchop-1.1.8/src/mpegcat.c:678:17: [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(answer," Picture Start (scrambling: %d)",scramble); data/gopchop-1.1.8/src/mpegcat.c:699:17: [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(answer," User Data Start (scrambling: %d)",scramble); data/gopchop-1.1.8/src/mpegcat.c:709:17: [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(answer," Sequence Header (scrambling: %d)",scramble); data/gopchop-1.1.8/src/mpegcat.c:741:17: [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(answer," Sequence Error (scrambling: %d)",scramble); data/gopchop-1.1.8/src/mpegcat.c:750:17: [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(answer," Sequence Extension Start (scrambling: %d)",scramble); data/gopchop-1.1.8/src/mpegcat.c:759:17: [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(answer," Sequence End (scrambling: %d)",scramble); data/gopchop-1.1.8/src/mpegcat.c:769:17: [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(answer," GOP Start (scrambling: %d)",scramble); data/gopchop-1.1.8/src/mpegcat.c:808:17: [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(answer,"Program End (scrambling: %d)",scramble); data/gopchop-1.1.8/src/mpegcat.c:818:17: [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(answer,"Pack Start (scrambling: %d)",scramble); data/gopchop-1.1.8/src/mpegcat.c:856:17: [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(answer, "Pack Start (Mux Rate: %u Stuffing: %u)", data/gopchop-1.1.8/src/rc.c:108: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 (!(rc=fopen(filename,"w"))) { data/gopchop-1.1.8/src/rc.c:151: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 line[LINE_LENGTH]; data/gopchop-1.1.8/src/rc.c:158: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 (!(rc=fopen(filename,"r"))) { data/gopchop-1.1.8/src/rc.c:218:43: [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). *((int*)match->variable)=(atoi(value)!=0); data/gopchop-1.1.8/src/rc.c:221:42: [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). *((int*)match->variable)=atoi(value); data/gopchop-1.1.8/src/sessions.cpp:49:21: [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). start = atoi( (const char*)value ); data/gopchop-1.1.8/src/sessions.cpp:53:19: [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). end = atoi( (const char*)value ); data/gopchop-1.1.8/src/sessions.cpp:144: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, "w" ); data/gopchop-1.1.8/libvo/video_out_pgm.c:62: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/gopchop-1.1.8/src/Main.cpp:214:49: [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). lasttask = (char *) g_realloc(lasttask, strlen(task) + 1); data/gopchop-1.1.8/src/Main.cpp:456: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). if (!(gop_cache_filename=(char*)malloc(strlen(filename)+5))) { data/gopchop-1.1.8/src/Parser.cpp:286: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). len = strlen(buf) + 1; // one for NULL data/gopchop-1.1.8/src/Parser.cpp:290: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). leftoff = strlen(error); data/gopchop-1.1.8/src/callbacks.cpp:274: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 (!(result=(char*)malloc(strlen(one)+strlen(two)+1))) { data/gopchop-1.1.8/src/callbacks.cpp:274: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). if (!(result=(char*)malloc(strlen(one)+strlen(two)+1))) { data/gopchop-1.1.8/src/rc.c:60: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). length=strlen(path)+strlen(package)+3; /* "/", ".", and NULL */ data/gopchop-1.1.8/src/rc.c:60: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). length=strlen(path)+strlen(package)+3; /* "/", ".", and NULL */ data/gopchop-1.1.8/src/rc.c:82: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). length=strlen(dirname)+strlen(rc_name)+2; /* need "/" and NULL */ data/gopchop-1.1.8/src/rc.c:82:28: [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). length=strlen(dirname)+strlen(rc_name)+2; /* need "/" and NULL */ ANALYSIS SUMMARY: Hits = 153 Lines analyzed = 15039 in approximately 0.47 seconds (32072 lines/second) Physical Source Lines of Code (SLOC) = 11183 Hits@level = [0] 329 [1] 11 [2] 70 [3] 6 [4] 66 [5] 0 Hits@level+ = [0+] 482 [1+] 153 [2+] 142 [3+] 72 [4+] 66 [5+] 0 Hits/KSLOC@level+ = [0+] 43.1011 [1+] 13.6815 [2+] 12.6978 [3+] 6.43834 [4+] 5.90182 [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.