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/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/cdecl.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/channelmap.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/context.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/def.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/error.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/ext-device-manager.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/ext-device-restore.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/ext-stream-restore.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/format.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/gccmacro.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/glib-mainloop.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/introspect.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/mainloop-api.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/mainloop-signal.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/mainloop.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/operation.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/proplist.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/pulseaudio.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/rtclock.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/sample.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/scache.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/simple.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/stream.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/subscribe.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/thread-mainloop.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/timeval.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/utf8.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/util.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/version.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/volume.h
Examining data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/xmalloc.h
Examining data/apulse-0.1.12/src/apulse-channel-map.c
Examining data/apulse-0.1.12/src/apulse-common.c
Examining data/apulse-0.1.12/src/apulse-context.c
Examining data/apulse-0.1.12/src/apulse-ext.c
Examining data/apulse-0.1.12/src/apulse-format-info.c
Examining data/apulse-0.1.12/src/apulse-mainloop-glib.c
Examining data/apulse-0.1.12/src/apulse-mainloop.c
Examining data/apulse-0.1.12/src/apulse-misc.c
Examining data/apulse-0.1.12/src/apulse-operation.c
Examining data/apulse-0.1.12/src/apulse-proplist.c
Examining data/apulse-0.1.12/src/apulse-signal.c
Examining data/apulse-0.1.12/src/apulse-simple.c
Examining data/apulse-0.1.12/src/apulse-stream.c
Examining data/apulse-0.1.12/src/apulse-threaded-mainloop.c
Examining data/apulse-0.1.12/src/apulse-volume.c
Examining data/apulse-0.1.12/src/apulse.h
Examining data/apulse-0.1.12/src/ringbuffer.c
Examining data/apulse-0.1.12/src/ringbuffer.h
Examining data/apulse-0.1.12/src/trace.c
Examining data/apulse-0.1.12/src/trace.h
Examining data/apulse-0.1.12/src/util.c
Examining data/apulse-0.1.12/src/util.h
Examining data/apulse-0.1.12/tests/test_ringbuffer.c

FINAL RESULTS:

data/apulse-0.1.12/src/apulse-misc.c:284:20:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
    ssize_t flen = readlink("/proc/self/exe", fullpath, sizeof(fullpath) - 1);
data/apulse-0.1.12/3rdparty/pulseaudio-headers/pulse/gccmacro.h:35:57:  [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 PA_GCC_PRINTF_ATTR(a,b) __attribute__ ((format (printf, a, b)))
data/apulse-0.1.12/src/apulse-common.c:50: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 + written, sizeof(buf) - written, format, args);
data/apulse-0.1.12/src/trace.c:51:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(fp, fmt, args);
data/apulse-0.1.12/src/trace.c:64:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(fp, fmt, args);
data/apulse-0.1.12/src/trace.c:85:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stderr, fmt, args);
data/apulse-0.1.12/src/trace.c:92:9:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        vfprintf(stdout, fmt, args);
data/apulse-0.1.12/src/trace.h:49:56:  [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.
trace_info(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
data/apulse-0.1.12/src/trace.h:52:59:  [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.
trace_warning(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
data/apulse-0.1.12/src/trace.h:55:57:  [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.
trace_error(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
data/apulse-0.1.12/src/apulse-stream.c:242: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.
        device_name = getenv("APULSE_PLAYBACK_DEVICE");
data/apulse-0.1.12/src/apulse-stream.c:246: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.
        device_name = getenv("APULSE_CAPTURE_DEVICE");
data/apulse-0.1.12/src/apulse-channel-map.c:28: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 *channel_name[PA_CHANNEL_POSITION_MAX] = {
data/apulse-0.1.12/src/apulse-common.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 buf[2048];
data/apulse-0.1.12/src/apulse-common.c:67:14:  [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).
    int fd = open(fn, flags, mode);
data/apulse-0.1.12/src/apulse-format-info.c:60: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[PA_CHANNEL_MAP_SNPRINT_MAX];
data/apulse-0.1.12/src/apulse-format-info.c:70: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[20];
data/apulse-0.1.12/src/apulse-format-info.c:80: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[20];
data/apulse-0.1.12/src/apulse-mainloop.c:338: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[200];
data/apulse-0.1.12/src/apulse-misc.c:283: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 fullpath[PATH_MAX];
data/apulse-0.1.12/src/apulse-misc.c:298: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(s, name, name_len);
data/apulse-0.1.12/src/apulse-stream.c:68: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[16 * 1024];
data/apulse-0.1.12/src/apulse-stream.c:855: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).
        ss.rate = atoi(val);
data/apulse-0.1.12/src/apulse-stream.c:859:23:  [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).
        ss.channels = atoi(val);
data/apulse-0.1.12/src/ringbuffer.c:132:9:  [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(rb->wpos, data, len);
data/apulse-0.1.12/src/ringbuffer.c:135:9:  [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(rb->wpos, data, remsz);
data/apulse-0.1.12/src/ringbuffer.c:136:9:  [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(rb->start, (char *)data + remsz, len - remsz);
data/apulse-0.1.12/src/ringbuffer.c:159:9:  [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(data, rb->rpos, len);
data/apulse-0.1.12/src/ringbuffer.c:162:9:  [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(data, rb->rpos, remsz);
data/apulse-0.1.12/src/ringbuffer.c:163:9:  [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 *)data + remsz, rb->start, len - remsz);
data/apulse-0.1.12/src/ringbuffer.c:186:9:  [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(data, rb->rpos, len);
data/apulse-0.1.12/src/ringbuffer.c:188:9:  [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(data, rb->rpos, remsz);
data/apulse-0.1.12/src/ringbuffer.c:189:9:  [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 *)data + remsz, rb->start, len - remsz);
data/apulse-0.1.12/src/util.c:145:17:  [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, &sample, sizeof(sample));
data/apulse-0.1.12/src/util.c:158:17:  [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, &sample, sizeof(sample));
data/apulse-0.1.12/tests/test_ringbuffer.c:10: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[20];
data/apulse-0.1.12/src/apulse-mainloop.c:339:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        while (read(m->wakeup_pipe[0], buf, sizeof(buf)) > 0) {
data/apulse-0.1.12/src/apulse-misc.c:294:23:  [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).
    size_t name_len = strlen(name);
data/apulse-0.1.12/src/apulse-proplist.c:99: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).
    v->len = strlen(value) + 1;

ANALYSIS SUMMARY:

Hits = 39
Lines analyzed = 14878 in approximately 0.44 seconds (34020 lines/second)
Physical Source Lines of Code (SLOC) = 8102
Hits@level = [0]  12 [1]   3 [2]  24 [3]   2 [4]   9 [5]   1
Hits@level+ = [0+]  51 [1+]  39 [2+]  36 [3+]  12 [4+]  10 [5+]   1
Hits/KSLOC@level+ = [0+] 6.29474 [1+] 4.81363 [2+] 4.44335 [3+] 1.48112 [4+] 1.23426 [5+] 0.123426
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.