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/pax-britannica-1.0.0/extra_loaders.h
Examining data/pax-britannica-1.0.0/particles.c
Examining data/pax-britannica-1.0.0/dokidoki-support/collision.c
Examining data/pax-britannica-1.0.0/dokidoki-support/gl.c
Examining data/pax-britannica-1.0.0/dokidoki-support/glu.c
Examining data/pax-britannica-1.0.0/dokidoki-support/log.c
Examining data/pax-britannica-1.0.0/dokidoki-support/log.h
Examining data/pax-britannica-1.0.0/dokidoki-support/lua_stb_image.c
Examining data/pax-britannica-1.0.0/dokidoki-support/luaglfw.h
Examining data/pax-britannica-1.0.0/dokidoki-support/memarray.c
Examining data/pax-britannica-1.0.0/dokidoki-support/stb_image.c
Examining data/pax-britannica-1.0.0/dokidoki-support/stb_vorbis.c
Examining data/pax-britannica-1.0.0/dokidoki-support/stb_vorbis.h
Examining data/pax-britannica-1.0.0/dokidoki-support/minlua.c
Examining data/pax-britannica-1.0.0/dokidoki-support/luaglfw.c
Examining data/pax-britannica-1.0.0/dokidoki-support/mixer.c

FINAL RESULTS:

data/pax-britannica-1.0.0/dokidoki-support/minlua.c:57:15:  [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.
    int ret = readlink("/proc/self/exe", buffer, size);
data/pax-britannica-1.0.0/dokidoki-support/log.c:19:5:  [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(path, home);
data/pax-britannica-1.0.0/dokidoki-support/log.c:20: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(path, suffix);
data/pax-britannica-1.0.0/dokidoki-support/log.c:52: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(file, fmt, args);
data/pax-britannica-1.0.0/dokidoki-support/memarray.c:191:10:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
         sprintf(errmsg, "memarray:__call(): memory allocation failure "
data/pax-britannica-1.0.0/dokidoki-support/memarray.c:351:4:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
   sprintf(s,
data/pax-britannica-1.0.0/dokidoki-support/log.c:16:24:  [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 *home = getenv("HOME");
data/pax-britannica-1.0.0/dokidoki-support/log.c:21: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(path, "w");
data/pax-britannica-1.0.0/dokidoki-support/log.c:27: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("dokidoki.log", "w");
data/pax-britannica-1.0.0/dokidoki-support/memarray.c:165:4:  [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 errmsg[128];
data/pax-britannica-1.0.0/dokidoki-support/memarray.c:238:4:  [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/pax-britannica-1.0.0/dokidoki-support/memarray.c:349:4:  [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 s[256];
data/pax-britannica-1.0.0/dokidoki-support/memarray.c:429: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(m->data, str, len);
data/pax-britannica-1.0.0/dokidoki-support/memarray.c:551:10:  [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(m->data, str, len);
data/pax-britannica-1.0.0/dokidoki-support/mixer.c:289: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 chunk_id[5];
data/pax-britannica-1.0.0/dokidoki-support/mixer.c:298: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).
    FILE * file = fopen(filename, "rb");
data/pax-britannica-1.0.0/dokidoki-support/mixer.c:301: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 chunk_id[5];
data/pax-britannica-1.0.0/dokidoki-support/stb_image.c:389:18:  [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.
typedef unsigned char validate_uint32[sizeof(uint32)==4];
data/pax-britannica-1.0.0/dokidoki-support/stb_image.c:460: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).
   FILE *f = fopen(filename, "rb");
data/pax-britannica-1.0.0/dokidoki-support/stb_image.c:526: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).
   FILE *f = fopen(filename, "rb");
data/pax-britannica-1.0.0/dokidoki-support/stb_image.c:578: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).
   FILE *f = fopen(filename, "rb");
data/pax-britannica-1.0.0/dokidoki-support/stb_image.c:725:4:  [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(buffer, s->img_buffer, n);
data/pax-britannica-1.0.0/dokidoki-support/stb_image.c:1832: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).
   FILE *f = fopen(filename, "rb");
data/pax-britannica-1.0.0/dokidoki-support/stb_image.c:2159:4:  [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(a->zout, a->zbuffer, len);
data/pax-britannica-1.0.0/dokidoki-support/stb_image.c:2461:16:  [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(final + (j*yspc[p]+yorig[p])*a->s.img_x*out_n + (i*xspc[p]+xorig[p])*out_n,
data/pax-britannica-1.0.0/dokidoki-support/stb_image.c:2628:16:  [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(z->idata+ioff, s->img_buffer, c.length);
data/pax-britannica-1.0.0/dokidoki-support/stb_image.c:2719: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).
   FILE *f = fopen(filename, "rb");
data/pax-britannica-1.0.0/dokidoki-support/stb_image.c:2759: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).
   FILE *f = fopen(filename, "rb");
data/pax-britannica-1.0.0/dokidoki-support/stb_image.c:3052: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).
   FILE *f = fopen(filename, "rb");
data/pax-britannica-1.0.0/dokidoki-support/stb_image.c:3136:11:  [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 raw_data[4];
data/pax-britannica-1.0.0/dokidoki-support/stb_image.c:3137:11:  [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 trans_data[4];
data/pax-britannica-1.0.0/dokidoki-support/stb_image.c:3338: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).
   FILE *f = fopen(filename, "rb");
data/pax-britannica-1.0.0/dokidoki-support/stb_image.c:3552: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).
   FILE *f = fopen(filename, "rb");
data/pax-britannica-1.0.0/dokidoki-support/stb_image.c:3661:4:  [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[HDR_BUFLEN];
data/pax-britannica-1.0.0/dokidoki-support/stb_image.c:3855: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).
   FILE *f = fopen(filename, "wb");
data/pax-britannica-1.0.0/dokidoki-support/stb_vorbis.c:948:18:  [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 signed char log2_4[16] = { 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4 };
data/pax-britannica-1.0.0/dokidoki-support/stb_vorbis.c:1275: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(data, z->stream, n);
data/pax-britannica-1.0.0/dokidoki-support/stb_vorbis.c:2311:4:  [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(x, buffer, sizeof(*x) * n2);
data/pax-britannica-1.0.0/dokidoki-support/stb_vorbis.c:2335:4:  [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(x, buffer, sizeof(*x) * n2);
data/pax-britannica-1.0.0/dokidoki-support/stb_vorbis.c:2356:4:  [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(x, buffer, sizeof(*x) * n);
data/pax-britannica-1.0.0/dokidoki-support/stb_vorbis.c:2374:4:  [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(temp, buffer, n2 * sizeof(float));
data/pax-britannica-1.0.0/dokidoki-support/stb_vorbis.c:3016:10:  [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(w, u, sizeof(u));
data/pax-britannica-1.0.0/dokidoki-support/stb_vorbis.c:3298:4:  [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(really_zero_channel, zero_channel, sizeof(really_zero_channel[0]) * f->channels);
data/pax-britannica-1.0.0/dokidoki-support/stb_vorbis.c:3707:10:  [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(c->codeword_lengths, lengths, c->entries);
data/pax-britannica-1.0.0/dokidoki-support/stb_vorbis.c:3829: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(c->multiplicands, mults, sizeof(c->multiplicands[0]) * c->lookup_values);
data/pax-britannica-1.0.0/dokidoki-support/stb_vorbis.c:4860: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.
      char header[6];
data/pax-britannica-1.0.0/dokidoki-support/stb_vorbis.c:4992: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).
   FILE *f = fopen(filename, "rb");
data/pax-britannica-1.0.0/dokidoki-support/stb_vorbis.c:5049: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.
   typedef char stb_vorbis_float_size_test[sizeof(float)==4 && sizeof(int) == 4];
data/pax-britannica-1.0.0/dokidoki-support/stb_vorbis.c:5357: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(buffer[i]+n, f->channel_buffers+f->channel_buffer_start, sizeof(float)*k);
data/pax-britannica-1.0.0/dokidoki-support/log.c:17: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).
    size_t len = strlen(suffix) + strlen(home) + 1;
data/pax-britannica-1.0.0/dokidoki-support/log.c:17:35:  [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 len = strlen(suffix) + strlen(home) + 1;
data/pax-britannica-1.0.0/dokidoki-support/mixer.c:265:14:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    int n =  fgetc(file);
data/pax-britannica-1.0.0/dokidoki-support/mixer.c:288:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    size_t read;
data/pax-britannica-1.0.0/dokidoki-support/stb_image.c:660:15:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      int c = fgetc(s->img_file);
data/pax-britannica-1.0.0/dokidoki-support/stb_vorbis.c:1254:12:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   int c = fgetc(z->f);

ANALYSIS SUMMARY:

Hits = 55
Lines analyzed = 17448 in approximately 0.40 seconds (43937 lines/second)
Physical Source Lines of Code (SLOC) = 13701
Hits@level = [0]   4 [1]   6 [2]  42 [3]   1 [4]   5 [5]   1
Hits@level+ = [0+]  59 [1+]  55 [2+]  49 [3+]   7 [4+]   6 [5+]   1
Hits/KSLOC@level+ = [0+] 4.30626 [1+] 4.01431 [2+] 3.57638 [3+] 0.510912 [4+] 0.437924 [5+] 0.0729874
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.