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/gmerlin-encoders-1.2.0/utils/cpuinfo.c Examining data/gmerlin-encoders-1.2.0/plugins/faac/e_faac.c Examining data/gmerlin-encoders-1.2.0/plugins/lame/e_lame.c Examining data/gmerlin-encoders-1.2.0/plugins/lame/b_lame.c Examining data/gmerlin-encoders-1.2.0/plugins/lame/bglame.h Examining data/gmerlin-encoders-1.2.0/plugins/lame/xing.c Examining data/gmerlin-encoders-1.2.0/plugins/lame/xing.h Examining data/gmerlin-encoders-1.2.0/plugins/lame/bglame.c Examining data/gmerlin-encoders-1.2.0/plugins/ogg/flac.c Examining data/gmerlin-encoders-1.2.0/plugins/ogg/e_speex.c Examining data/gmerlin-encoders-1.2.0/plugins/ogg/speex.c Examining data/gmerlin-encoders-1.2.0/plugins/ogg/ogg_common.h Examining data/gmerlin-encoders-1.2.0/plugins/ogg/e_theora.c Examining data/gmerlin-encoders-1.2.0/plugins/ogg/e_flacogg.c Examining data/gmerlin-encoders-1.2.0/plugins/ogg/b_ogg.c Examining data/gmerlin-encoders-1.2.0/plugins/ogg/ogg_common.c Examining data/gmerlin-encoders-1.2.0/plugins/ogg/vorbis.c Examining data/gmerlin-encoders-1.2.0/plugins/ogg/theora.c Examining data/gmerlin-encoders-1.2.0/plugins/ogg/e_vorbis.c Examining data/gmerlin-encoders-1.2.0/plugins/flac/e_flac.c Examining data/gmerlin-encoders-1.2.0/plugins/yuv4mpeg/e_yuv4mpeg.c Examining data/gmerlin-encoders-1.2.0/plugins/yuv4mpeg/mpv_common.c Examining data/gmerlin-encoders-1.2.0/plugins/yuv4mpeg/mpv_common.h Examining data/gmerlin-encoders-1.2.0/plugins/yuv4mpeg/y4m_common.h Examining data/gmerlin-encoders-1.2.0/plugins/yuv4mpeg/e_mpegaudio.c Examining data/gmerlin-encoders-1.2.0/plugins/yuv4mpeg/y4m_common.c Examining data/gmerlin-encoders-1.2.0/plugins/yuv4mpeg/e_mpegvideo.c Examining data/gmerlin-encoders-1.2.0/plugins/yuv4mpeg/mpa_common.c Examining data/gmerlin-encoders-1.2.0/plugins/yuv4mpeg/mpa_common.h Examining data/gmerlin-encoders-1.2.0/plugins/yuv4mpeg/e_mpeg.c Examining data/gmerlin-encoders-1.2.0/plugins/ffmpeg/e_ffmpeg.c Examining data/gmerlin-encoders-1.2.0/plugins/ffmpeg/e_ffmpeg_audio.c Examining data/gmerlin-encoders-1.2.0/plugins/ffmpeg/e_ffmpeg_video.c Examining data/gmerlin-encoders-1.2.0/plugins/ffmpeg/ffmpeg_common.h Examining data/gmerlin-encoders-1.2.0/plugins/ffmpeg/params.h Examining data/gmerlin-encoders-1.2.0/plugins/ffmpeg/codecs.c Examining data/gmerlin-encoders-1.2.0/plugins/ffmpeg/ffmpeg_common.c Examining data/gmerlin-encoders-1.2.0/include/bgflac.h Examining data/gmerlin-encoders-1.2.0/include/bgshout.h Examining data/gmerlin-encoders-1.2.0/include/gmerlin_encoders.h Examining data/gmerlin-encoders-1.2.0/lib/bgflac.c Examining data/gmerlin-encoders-1.2.0/lib/bgshout.c Examining data/gmerlin-encoders-1.2.0/lib/id3v1.c Examining data/gmerlin-encoders-1.2.0/lib/id3v2.c FINAL RESULTS: data/gmerlin-encoders-1.2.0/lib/bgflac.c:68: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(dst[i], src->channels.s_32[i], data/gmerlin-encoders-1.2.0/lib/bgflac.c:240:29: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). flac->bits_per_sample = atoi(val->val_str); data/gmerlin-encoders-1.2.0/lib/id3v1.c:32: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. static const char *id3_genres[GENRE_MAX] = data/gmerlin-encoders-1.2.0/lib/id3v1.c:100: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 data[128]; data/gmerlin-encoders-1.2.0/lib/id3v1.c:125: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(dst, tmp_string, out_len); data/gmerlin-encoders-1.2.0/lib/id3v1.c:158: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(&ret->data[YEAR_POS], tmp_string, 4); data/gmerlin-encoders-1.2.0/plugins/faac/e_faac.c:292:27: [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). faac->id3v2_charset = atoi(v->val_str); data/gmerlin-encoders-1.2.0/plugins/faac/e_faac.c:309: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). faac->output = fopen(faac->filename, "wb"); data/gmerlin-encoders-1.2.0/plugins/ffmpeg/codecs.c:756:16: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). ctx->var = atoi(val->val_str) * scale; \ data/gmerlin-encoders-1.2.0/plugins/ffmpeg/ffmpeg_common.c:712:24: [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). st->stats_file = fopen(st->stats_filename, "w"); data/gmerlin-encoders-1.2.0/plugins/ffmpeg/ffmpeg_common.c:717:24: [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). st->stats_file = fopen(st->stats_filename, "r"); data/gmerlin-encoders-1.2.0/plugins/ffmpeg/ffmpeg_common.c:1559: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(st->stream->codec->extradata, data/gmerlin-encoders-1.2.0/plugins/flac/e_flac.c:164: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). flac->out = fopen(flac->filename, "wb"); data/gmerlin-encoders-1.2.0/plugins/flac/e_flac.c:567: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(&metadata->data.stream_info, &flac->si, sizeof(flac->si)); data/gmerlin-encoders-1.2.0/plugins/flac/e_flac.c:692: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(flac->si.md5sum, flac->ci->global_header + 42 - 16, 16); data/gmerlin-encoders-1.2.0/plugins/lame/e_lame.c:146:27: [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). lame->id3v2_charset = atoi(v->val_str); data/gmerlin-encoders-1.2.0/plugins/lame/e_lame.c:168: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). lame->output = fopen(lame->filename, "wb+"); data/gmerlin-encoders-1.2.0/plugins/lame/xing.c:225: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. static const char xing_sig[4] = "Xing"; data/gmerlin-encoders-1.2.0/plugins/lame/xing.c:243: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(ptr, xing_sig, 4); ptr += 4; data/gmerlin-encoders-1.2.0/plugins/ogg/flac.c:91: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(flacogg->header + flacogg->header_size, buffer, bytes); data/gmerlin-encoders-1.2.0/plugins/ogg/flac.c:127: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(flacogg->frame, buffer, bytes); data/gmerlin-encoders-1.2.0/plugins/ogg/flac.c:172: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(flacogg->frame, buffer, bytes); data/gmerlin-encoders-1.2.0/plugins/ogg/flac.c:204: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(ret->header, header_bytes, 9); data/gmerlin-encoders-1.2.0/plugins/ogg/ogg_common.c:102:35: [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(!(e->write_callback_data = fopen(e->filename, "w"))) data/gmerlin-encoders-1.2.0/plugins/ogg/speex.c:106: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(p+4, vendor_string, vendor_length); data/gmerlin-encoders-1.2.0/plugins/ogg/speex.c:126:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if(tag) memcpy(p+*length+4, tag, tag_len); /* comment */ data/gmerlin-encoders-1.2.0/plugins/ogg/speex.c:127: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(p+*length+4+tag_len, val, val_len); /* comment */ data/gmerlin-encoders-1.2.0/plugins/ogg/theora.c:317: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(p, s, string_len); \ data/gmerlin-encoders-1.2.0/plugins/ogg/theora.c:339: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(ptr, comment_header, 7); data/gmerlin-encoders-1.2.0/plugins/ogg/theora.c:405: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(theora->tc.vendor, ptr + 11, vendor_len); data/gmerlin-encoders-1.2.0/plugins/ogg/theora.c:596:26: [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). theora->stats_file = fopen(stats_file, "wb"); data/gmerlin-encoders-1.2.0/plugins/ogg/theora.c:618:26: [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). theora->stats_file = fopen(stats_file, "rb"); data/gmerlin-encoders-1.2.0/plugins/ogg/vorbis.c:214: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(p, s, string_len); \ data/gmerlin-encoders-1.2.0/plugins/ogg/vorbis.c:236: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(ptr, comment_header, 7); data/gmerlin-encoders-1.2.0/plugins/ogg/vorbis.c:298: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(vorbis->enc_vc.vendor, ptr + 11, vendor_len); data/gmerlin-encoders-1.2.0/plugins/yuv4mpeg/e_yuv4mpeg.c:72: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). e->com.fd = open(e->filename, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR); data/gmerlin-encoders-1.2.0/plugins/yuv4mpeg/mpa_common.c:303: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). com->out = fopen(filename, "wb"); data/gmerlin-encoders-1.2.0/plugins/yuv4mpeg/mpv_common.c:365: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). com->out = fopen(filename, "wb"); data/gmerlin-encoders-1.2.0/utils/cpuinfo.c:82: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 idstr[13]; data/gmerlin-encoders-1.2.0/utils/cpuinfo.c:89: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 processor_name[49]; data/gmerlin-encoders-1.2.0/lib/bgflac.c:342:20: [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). entry.length = strlen((char*)entry.entry); \ data/gmerlin-encoders-1.2.0/lib/bgflac.c:354: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). entry.length = strlen((char*)entry.entry); \ data/gmerlin-encoders-1.2.0/lib/bgflac.c:367:20: [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). entry.length = strlen((char*)(entry.entry)); \ data/gmerlin-encoders-1.2.0/lib/id3v1.c:156:8: [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(strlen(tmp_string) == 4) data/gmerlin-encoders-1.2.0/lib/id3v2.c:227:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(str)+1; data/gmerlin-encoders-1.2.0/lib/id3v2.c:278:13: [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(frame->str)+1; data/gmerlin-encoders-1.2.0/plugins/ffmpeg/ffmpeg_common.c:235:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(priv->ctx->title, metadata->title, data/gmerlin-encoders-1.2.0/plugins/ffmpeg/ffmpeg_common.c:239:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(priv->ctx->author, metadata->author, data/gmerlin-encoders-1.2.0/plugins/ffmpeg/ffmpeg_common.c:243:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(priv->ctx->album, metadata->album, data/gmerlin-encoders-1.2.0/plugins/ffmpeg/ffmpeg_common.c:247:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(priv->ctx->copyright, metadata->copyright, data/gmerlin-encoders-1.2.0/plugins/ffmpeg/ffmpeg_common.c:251:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(priv->ctx->comment, metadata->comment, data/gmerlin-encoders-1.2.0/plugins/ffmpeg/ffmpeg_common.c:255:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(priv->ctx->genre, metadata->genre, data/gmerlin-encoders-1.2.0/plugins/ffmpeg/ffmpeg_common.c:1145: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). pkt.size = strlen(text)+1; data/gmerlin-encoders-1.2.0/plugins/ogg/speex.c:99: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). int vendor_length=strlen(vendor_string); data/gmerlin-encoders-1.2.0/plugins/ogg/speex.c:117:20: [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 tag_len=(tag?strlen(tag):0); data/gmerlin-encoders-1.2.0/plugins/ogg/speex.c:118:15: [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 val_len=strlen(val); data/gmerlin-encoders-1.2.0/plugins/ogg/theora.c:315:41: [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). #define WRITE_STRING(s, p) string_len = strlen(s); \ data/gmerlin-encoders-1.2.0/plugins/ogg/theora.c:328: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). int len = 7 + 4 + 4 + strlen(comment->vendor); data/gmerlin-encoders-1.2.0/plugins/ogg/theora.c:332: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). len += 4 + strlen(comment->user_comments[i]); data/gmerlin-encoders-1.2.0/plugins/ogg/vorbis.c:212:41: [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). #define WRITE_STRING(s, p) string_len = strlen(s); \ data/gmerlin-encoders-1.2.0/plugins/ogg/vorbis.c:225:29: [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 = 7 + 4 + 4 + 1 + strlen(comment->vendor); data/gmerlin-encoders-1.2.0/plugins/ogg/vorbis.c:229: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). len += 4 + strlen(comment->user_comments[i]); data/gmerlin-encoders-1.2.0/plugins/yuv4mpeg/e_mpeg.c:350: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). end = start + strlen(start); data/gmerlin-encoders-1.2.0/plugins/yuv4mpeg/e_mpeg.c:365: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). end = start + strlen(start); data/gmerlin-encoders-1.2.0/utils/cpuinfo.c:215:4: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(100000); ANALYSIS SUMMARY: Hits = 65 Lines analyzed = 15485 in approximately 0.35 seconds (43844 lines/second) Physical Source Lines of Code (SLOC) = 11611 Hits@level = [0] 19 [1] 25 [2] 40 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 84 [1+] 65 [2+] 40 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 7.23452 [1+] 5.59814 [2+] 3.44501 [3+] 0 [4+] 0 [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.