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/gst-libav1.0-1.18.1/ext/libav/gstav.h Examining data/gst-libav1.0-1.18.1/ext/libav/gstavauddec.c Examining data/gst-libav1.0-1.18.1/ext/libav/gstavauddec.h Examining data/gst-libav1.0-1.18.1/ext/libav/gstavaudenc.c Examining data/gst-libav1.0-1.18.1/ext/libav/gstavaudenc.h Examining data/gst-libav1.0-1.18.1/ext/libav/gstavcfg.c Examining data/gst-libav1.0-1.18.1/ext/libav/gstavcfg.h Examining data/gst-libav1.0-1.18.1/ext/libav/gstavcodecmap.c Examining data/gst-libav1.0-1.18.1/ext/libav/gstavcodecmap.h Examining data/gst-libav1.0-1.18.1/ext/libav/gstavdeinterlace.c Examining data/gst-libav1.0-1.18.1/ext/libav/gstavdemux.c Examining data/gst-libav1.0-1.18.1/ext/libav/gstavmux.c Examining data/gst-libav1.0-1.18.1/ext/libav/gstavprotocol.c Examining data/gst-libav1.0-1.18.1/ext/libav/gstavprotocol.h Examining data/gst-libav1.0-1.18.1/ext/libav/gstavutils.c Examining data/gst-libav1.0-1.18.1/ext/libav/gstavutils.h Examining data/gst-libav1.0-1.18.1/ext/libav/gstavviddec.c Examining data/gst-libav1.0-1.18.1/ext/libav/gstavviddec.h Examining data/gst-libav1.0-1.18.1/ext/libav/gstavvidenc.c Examining data/gst-libav1.0-1.18.1/ext/libav/gstavvidenc.h Examining data/gst-libav1.0-1.18.1/ext/libav/gstav.c Examining data/gst-libav1.0-1.18.1/tests/check/elements/avdec_adpcm.c Examining data/gst-libav1.0-1.18.1/tests/check/elements/avdemux_ape.c Examining data/gst-libav1.0-1.18.1/tests/check/generic/libavcodec-locking.c Examining data/gst-libav1.0-1.18.1/tests/check/generic/plugin-test.c FINAL RESULTS: data/gst-libav1.0-1.18.1/ext/libav/gstavcodecmap.c:4336:9: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. sscanf (mimetype, "audio/x-gst-av-%s", ext) == 1) { data/gst-libav1.0-1.18.1/ext/libav/gstavcodecmap.c:4348:9: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. sscanf (mimetype, "video/x-gst-av-%s", ext) == 1) { data/gst-libav1.0-1.18.1/ext/libav/gstavmux.c:659:54: [3] (random) g_random_int: 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. g_snprintf (s_id, sizeof (s_id), "avmux-%08x", g_random_int ()); data/gst-libav1.0-1.18.1/ext/libav/gstavutils.c:471:23: [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. const char *s = getenv ("NUMBER_OF_PROCESSORS"); data/gst-libav1.0-1.18.1/ext/libav/gstavauddec.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 (ffmpegdec->ffmpeg_layout, pos, data/gst-libav1.0-1.18.1/ext/libav/gstavauddec.c:708: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 (ffmpegdec->padded, data, size); data/gst-libav1.0-1.18.1/ext/libav/gstavcodecmap.c:3164: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 (dstp, srcp, 6); data/gst-libav1.0-1.18.1/ext/libav/gstavcodecmap.c:3198: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, src, size); data/gst-libav1.0-1.18.1/ext/libav/gstavcodecmap.c:3264: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 (context->extradata, map.data, map.size); data/gst-libav1.0-1.18.1/ext/libav/gstavcodecmap.c:3332: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. memcpy ((gchar *) context->extradata + 0x62, &flags, 2); data/gst-libav1.0-1.18.1/ext/libav/gstavdeinterlace.c:325: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 args[512]; data/gst-libav1.0-1.18.1/ext/libav/gstavdeinterlace.c:373: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 (deinterlace->filter_frame->data, src->data, sizeof (src->data)); data/gst-libav1.0-1.18.1/ext/libav/gstavdeinterlace.c:374: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 (deinterlace->filter_frame->linesize, src->linesize, data/gst-libav1.0-1.18.1/ext/libav/gstavdemux.c:592: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 (&seeksegment, &demux->segment, sizeof (GstSegment)); data/gst-libav1.0-1.18.1/ext/libav/gstavdemux.c:625: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 (&demux->segment, &seeksegment, sizeof (GstSegment)); data/gst-libav1.0-1.18.1/ext/libav/gstavutils.c:473:13: [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). n = atoi (s); data/gst-libav1.0-1.18.1/ext/libav/gstavviddec.c:1885: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 (ffmpegdec->padded, data, size); data/gst-libav1.0-1.18.1/ext/libav/gstavvidenc.c:547: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 (sd->data, cc_meta->data, cc_meta->size); data/gst-libav1.0-1.18.1/tests/check/generic/libavcodec-locking.c:138:15: [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). timeout = atoi (g_getenv ("CK_DEFAULT_TIMEOUT")); data/gst-libav1.0-1.18.1/ext/libav/gstav.c:104:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). gint len = strlen (fmt); data/gst-libav1.0-1.18.1/ext/libav/gstavcodecmap.c:3437:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). && strlen (variant) == 4) { data/gst-libav1.0-1.18.1/ext/libav/gstavcodecmap.c:4335: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). if (strlen (mimetype) <= 30 && data/gst-libav1.0-1.18.1/ext/libav/gstavcodecmap.c:4347: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). if (strlen (mimetype) <= 30 && data/gst-libav1.0-1.18.1/ext/libav/gstavdemux.c:1081: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). output = g_convert (input, strlen (input), data/gst-libav1.0-1.18.1/ext/libav/gstavmux.c:620:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (ffmpegmux->context->title, s, data/gst-libav1.0-1.18.1/ext/libav/gstavmux.c:624:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (ffmpegmux->context->author, s, data/gst-libav1.0-1.18.1/ext/libav/gstavmux.c:628:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (ffmpegmux->context->copyright, s, data/gst-libav1.0-1.18.1/ext/libav/gstavmux.c:632:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (ffmpegmux->context->comment, s, data/gst-libav1.0-1.18.1/ext/libav/gstavmux.c:636:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (ffmpegmux->context->album, s, data/gst-libav1.0-1.18.1/ext/libav/gstavmux.c:640:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (ffmpegmux->context->genre, s, ANALYSIS SUMMARY: Hits = 30 Lines analyzed = 16331 in approximately 0.38 seconds (42613 lines/second) Physical Source Lines of Code (SLOC) = 12408 Hits@level = [0] 5 [1] 11 [2] 15 [3] 2 [4] 2 [5] 0 Hits@level+ = [0+] 35 [1+] 30 [2+] 19 [3+] 4 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 2.82076 [1+] 2.41779 [2+] 1.53127 [3+] 0.322373 [4+] 0.161186 [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.