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/libvdpau-1.4/include/vdpau/vdpau.h
Examining data/libvdpau-1.4/include/vdpau/vdpau_x11.h
Examining data/libvdpau-1.4/src/mesa_dri2.c
Examining data/libvdpau-1.4/src/mesa_dri2.h
Examining data/libvdpau-1.4/src/util.h
Examining data/libvdpau-1.4/src/vdpau_wrapper.c
Examining data/libvdpau-1.4/test/dlclose.c
Examining data/libvdpau-1.4/trace/vdpau_trace.cpp

FINAL RESULTS:

data/libvdpau-1.4/src/vdpau_wrapper.c:138: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(vdpau_driver_lib, sizeof(vdpau_driver_lib),
data/libvdpau-1.4/src/vdpau_wrapper.c:147:13:  [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.
        if (snprintf(vdpau_driver_lib, sizeof(vdpau_driver_lib),
data/libvdpau-1.4/src/vdpau_wrapper.c:166: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(vdpau_driver_lib, sizeof(vdpau_driver_lib),
data/libvdpau-1.4/trace/vdpau_trace.cpp:4176:17:  [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(_vdp_cap_data.fp, ", %" PRIu64, *current_time);
data/libvdpau-1.4/trace/vdpau_trace.cpp:4200: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(
data/libvdpau-1.4/trace/vdpau_trace.cpp:4258:17:  [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(_vdp_cap_data.fp, ", %" PRIu64, *first_presentation_time);
data/libvdpau-1.4/trace/vdpau_trace.cpp:4310:17:  [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(_vdp_cap_data.fp, ", %" PRIu64, *first_presentation_time);
data/libvdpau-1.4/src/util.h:34: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.
        return getenv(name);
data/libvdpau-1.4/include/vdpau/vdpau.h:3347:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char  refFrameSignBias[4];
data/libvdpau-1.4/include/vdpau/vdpau.h:3363:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char segmentFeatureEnable[8][4];
data/libvdpau-1.4/include/vdpau/vdpau.h:3365:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char mbSegmentTreeProbs[7];
data/libvdpau-1.4/include/vdpau/vdpau.h:3366:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char segmentPredProbs[3];
data/libvdpau-1.4/include/vdpau/vdpau.h:3367:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char reservedSegment16Bits[2];
data/libvdpau-1.4/src/vdpau_wrapper.c:117: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         vdpau_driver_lib[PATH_MAX];
data/libvdpau-1.4/src/vdpau_wrapper.c:185:24:  [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).
    if (vdpau_trace && atoi(vdpau_trace)) {
data/libvdpau-1.4/src/vdpau_wrapper.c:330: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 buffer[1024];
data/libvdpau-1.4/src/vdpau_wrapper.c:333:10:  [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).
    fp = fopen("/proc/self/cmdline", "r");
data/libvdpau-1.4/src/vdpau_wrapper.c:361: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 buffer[1024];
data/libvdpau-1.4/src/vdpau_wrapper.c:363:10:  [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).
    fp = fopen(VDPAU_SYSCONFDIR "/vdpau_wrapper.cfg", "r");
data/libvdpau-1.4/src/vdpau_wrapper.c:380:37:  [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).
            _enable_flash_uv_swap = atoi(param);
data/libvdpau-1.4/src/vdpau_wrapper.c:383: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).
            _disable_flash_pq_bg_color = atoi(param);
data/libvdpau-1.4/trace/vdpau_trace.cpp:4802:35:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            _vdp_cap_data.level = atoi(vdpau_trace);
data/libvdpau-1.4/trace/vdpau_trace.cpp:4809:26:  [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 fd = atoi(&vdpau_trace_file[1]);
data/libvdpau-1.4/trace/vdpau_trace.cpp:4813:36:  [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).
                _vdp_cap_data.fp = fopen(vdpau_trace_file, "wt");
data/libvdpau-1.4/trace/vdpau_trace.cpp:4807:33:  [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 (vdpau_trace_file && strlen(vdpau_trace_file)) {

ANALYSIS SUMMARY:

Hits = 25
Lines analyzed = 10975 in approximately 0.34 seconds (32473 lines/second)
Physical Source Lines of Code (SLOC) = 6094
Hits@level = [0] 258 [1]   1 [2]  16 [3]   1 [4]   7 [5]   0
Hits@level+ = [0+] 283 [1+]  25 [2+]  24 [3+]   8 [4+]   7 [5+]   0
Hits/KSLOC@level+ = [0+] 46.4391 [1+] 4.1024 [2+] 3.9383 [3+] 1.31277 [4+] 1.14867 [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.