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/libass-0.15.0/test/test.c
Examining data/libass-0.15.0/profile/profile.c
Examining data/libass-0.15.0/compare/compare.c
Examining data/libass-0.15.0/compare/image.c
Examining data/libass-0.15.0/compare/image.h
Examining data/libass-0.15.0/libass/ass_blur.c
Examining data/libass-0.15.0/libass/ass_coretext.h
Examining data/libass-0.15.0/libass/ass_bitmap.c
Examining data/libass-0.15.0/libass/ass_directwrite.c
Examining data/libass-0.15.0/libass/ass_fontselect.c
Examining data/libass-0.15.0/libass/ass_utils.c
Examining data/libass-0.15.0/libass/ass_render.c
Examining data/libass-0.15.0/libass/ass_priv.h
Examining data/libass-0.15.0/libass/ass_render_api.c
Examining data/libass-0.15.0/libass/ass_string.c
Examining data/libass-0.15.0/libass/ass_fontconfig.h
Examining data/libass-0.15.0/libass/ass_rasterizer.h
Examining data/libass-0.15.0/libass/ass_library.c
Examining data/libass-0.15.0/libass/ass_func_template.h
Examining data/libass-0.15.0/libass/ass_drawing.c
Examining data/libass-0.15.0/libass/ass_outline.c
Examining data/libass-0.15.0/libass/ass.c
Examining data/libass-0.15.0/libass/ass_cache.c
Examining data/libass-0.15.0/libass/ass_font.h
Examining data/libass-0.15.0/libass/ass_shaper.h
Examining data/libass-0.15.0/libass/ass_parse.c
Examining data/libass-0.15.0/libass/ass_fontselect.h
Examining data/libass-0.15.0/libass/ass_directwrite.h
Examining data/libass-0.15.0/libass/ass_bitmap.h
Examining data/libass-0.15.0/libass/dwrite_c.h
Examining data/libass-0.15.0/libass/ass_cache_template.h
Examining data/libass-0.15.0/libass/ass_coretext.c
Examining data/libass-0.15.0/libass/ass_strtod.c
Examining data/libass-0.15.0/libass/ass_types.h
Examining data/libass-0.15.0/libass/ass_string.h
Examining data/libass-0.15.0/libass/x86/cpuid.h
Examining data/libass-0.15.0/libass/ass_render.h
Examining data/libass-0.15.0/libass/ass_utils.h
Examining data/libass-0.15.0/libass/ass_outline.h
Examining data/libass-0.15.0/libass/ass.h
Examining data/libass-0.15.0/libass/ass_drawing.h
Examining data/libass-0.15.0/libass/ass_library.h
Examining data/libass-0.15.0/libass/ass_fontconfig.c
Examining data/libass-0.15.0/libass/ass_rasterizer.c
Examining data/libass-0.15.0/libass/ass_compat.h
Examining data/libass-0.15.0/libass/ass_parse.h
Examining data/libass-0.15.0/libass/ass_shaper.c
Examining data/libass-0.15.0/libass/ass_rasterizer_c.c
Examining data/libass-0.15.0/libass/ass_cache.h
Examining data/libass-0.15.0/libass/ass_font.c

FINAL RESULTS:

data/libass-0.15.0/compare/compare.c:457:5:  [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.
    printf(fmt, program);
data/libass-0.15.0/compare/compare.c:466:5:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vprintf(fmt, va);
data/libass-0.15.0/libass/ass_library.c:38: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, va);
data/libass-0.15.0/profile/profile.c:39:5:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vprintf(fmt, va);
data/libass-0.15.0/test/test.c:40:5:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vprintf(fmt, va);
data/libass-0.15.0/compare/compare.c:237: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 path[4096];
data/libass-0.15.0/compare/compare.c:239: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).
    FILE *fp = fopen(path, "rb");
data/libass-0.15.0/compare/compare.c:282: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 path[4096];
data/libass-0.15.0/compare/compare.c:309: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 path[4096];
data/libass-0.15.0/compare/image.c:25: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).
    FILE *fp = fopen(path, "rb");
data/libass-0.15.0/compare/image.c:145: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).
    FILE *fp = fopen(path, "wb");
data/libass-0.15.0/libass/ass.c:285:34:  [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).
#define INTVAL(name) ANYVAL(name,atoi)
data/libass-0.15.0/libass/ass.c:405:31:  [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).
            track->PlayResX = atoi(token);
data/libass-0.15.0/libass/ass.c:407:31:  [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).
            track->PlayResY = atoi(token);
data/libass-0.15.0/libass/ass.c:411:32:  [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).
            track->WrapStyle = atoi(token);
data/libass-0.15.0/libass/ass.c:667: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).
        track->PlayResX = atoi(str + 9);
data/libass-0.15.0/libass/ass.c:670: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).
        track->PlayResY = atoi(str + 9);
data/libass-0.15.0/libass/ass.c:676:28:  [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).
        track->WrapStyle = atoi(str + 10);
data/libass-0.15.0/libass/ass.c:922: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(track->parser_priv->fontdata + track->parser_priv->fontdata_used,
data/libass-0.15.0/libass/ass.c:1016: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(str, data, size);
data/libass-0.15.0/libass/ass.c:1092: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(str, data, size);
data/libass-0.15.0/libass/ass.c:1106:28:  [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).
        event->ReadOrder = atoi(token);
data/libass-0.15.0/libass/ass.c:1111: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).
        event->Layer = atoi(token);
data/libass-0.15.0/libass/ass.c:1238: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).
    FILE *fp = fopen(fname, "rb");
data/libass-0.15.0/libass/ass.c:1342: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(newbuf, buf, bufsize);
data/libass-0.15.0/libass/ass_bitmap.c:140: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->buffer, src->buffer, src->stride * src->h);
data/libass-0.15.0/libass/ass_blur.c:65: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(buf, get_line(ptr, offs, size), STRIPE_WIDTH * sizeof(buf[0]));
data/libass-0.15.0/libass/ass_cache.c:70: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(dst, src, sizeof(ASS_FontDesc));
data/libass-0.15.0/libass/ass_cache.c:99: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(dst, src, sizeof(BitmapHashKey));
data/libass-0.15.0/libass/ass_cache.c:152: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(dst, src, sizeof(CompositeHashKey));
data/libass-0.15.0/libass/ass_cache.c:233: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, sizeof(OutlineHashKey));
data/libass-0.15.0/libass/ass_cache.c:282: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, sizeof(GlyphMetricsHashKey));
data/libass-0.15.0/libass/ass_directwrite.c:331: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(buf, fileBuf, length);
data/libass-0.15.0/libass/ass_directwrite.c:446:5:  [2] (buffer) wchar_t:
  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.
    wchar_t char_string[2];
data/libass-0.15.0/libass/ass_directwrite.c:483:5:  [2] (buffer) wchar_t:
  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.
    wchar_t temp_name[NAME_MAX_LENGTH];
data/libass-0.15.0/libass/ass_directwrite.c:534:5:  [2] (buffer) wchar_t:
  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.
    wchar_t temp_name[NAME_MAX_LENGTH];
data/libass-0.15.0/libass/ass_fontconfig.c:102: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 *fullnames[MAX_NAME];
data/libass-0.15.0/libass/ass_fontconfig.c:103: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 *families[MAX_NAME];
data/libass-0.15.0/libass/ass_fontselect.c:153: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(buf, fd[i].data + offset, len);
data/libass-0.15.0/libass/ass_fontselect.c:175: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 fullname[4096];
data/libass-0.15.0/libass/ass_fontselect.c:375: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(selector->font_infos + w, selector->font_infos + i,
data/libass-0.15.0/libass/ass_fontselect.c:762: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 *fullnames[MAX_FULLNAME];
data/libass-0.15.0/libass/ass_fontselect.c:763: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 *families[MAX_FULLNAME];
data/libass-0.15.0/libass/ass_fontselect.c:778:13:  [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[1024];
data/libass-0.15.0/libass/ass_fontselect.c:825: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(info->families, &families, sizeof(char *) * num_family);
data/libass-0.15.0/libass/ass_fontselect.c:832: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(info->fullnames, &fullnames, sizeof(char *) * num_fullname);
data/libass-0.15.0/libass/ass_library.c:124: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(priv->fontdata[idx].data, data, size);
data/libass-0.15.0/libass/ass_outline.c:256: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(outline->segments, source->segments, source->n_segments);
data/libass-0.15.0/libass/ass_outline.c:286: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(outline->segments, source->segments, source->n_segments);
data/libass-0.15.0/libass/ass_outline.c:320: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(outline->segments, source->segments, source->n_segments);
data/libass-0.15.0/libass/ass_parse.c:895:20:  [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).
        v[cnt++] = atoi(++p);
data/libass-0.15.0/libass/ass_render.c:723: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(nbuffer, abuffer, ((ah - 1) * as) + aw);
data/libass-0.15.0/libass/ass_render.c:2343: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(&current_info->c, &info->c, sizeof(info->c));
data/libass-0.15.0/libass/ass_shaper.c:246: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(v, &face->glyph->metrics, sizeof(FT_Glyph_Metrics));
data/libass-0.15.0/libass/ass_shaper.c:631: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(info->next, info, sizeof(GlyphInfo));
data/libass-0.15.0/libass/ass_utils.c:76: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(new, s, len);
data/libass-0.15.0/libass/ass_utils.c:274: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[16];
data/libass-0.15.0/libass/ass_utils.c:276: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(buffer, str, n);
data/libass-0.15.0/test/test.c:63: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(fname, "wb");
data/libass-0.15.0/compare/compare.c:596:22:  [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).
            prefix = strlen(prev);
data/libass-0.15.0/libass/ass.c:355:38:  [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).
                last = event->Text + strlen(event->Text) - 1;
data/libass-0.15.0/libass/ass.c:910:11:  [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);
data/libass-0.15.0/libass/ass_coretext.c:224: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).
        0, (UInt8 *)family, strlen(family), kCFStringEncodingUTF8, false);
data/libass-0.15.0/libass/ass_utils.c:268: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).
    char *end = str + strlen(str);

ANALYSIS SUMMARY:

Hits = 64
Lines analyzed = 20797 in approximately 0.72 seconds (28886 lines/second)
Physical Source Lines of Code (SLOC) = 14887
Hits@level = [0]  73 [1]   5 [2]  54 [3]   0 [4]   5 [5]   0
Hits@level+ = [0+] 137 [1+]  64 [2+]  59 [3+]   5 [4+]   5 [5+]   0
Hits/KSLOC@level+ = [0+] 9.20266 [1+] 4.29905 [2+] 3.96319 [3+] 0.335864 [4+] 0.335864 [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.