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/libudfread-1.1.0/examples/udfcat.c
Examining data/libudfread-1.1.0/examples/udfls.c
Examining data/libudfread-1.1.0/src/blockinput.h
Examining data/libudfread-1.1.0/src/default_blockinput.c
Examining data/libudfread-1.1.0/src/default_blockinput.h
Examining data/libudfread-1.1.0/src/ecma167.c
Examining data/libudfread-1.1.0/src/ecma167.h
Examining data/libudfread-1.1.0/src/udfread-version.c
Examining data/libudfread-1.1.0/src/udfread.c
Examining data/libudfread-1.1.0/src/udfread.h

FINAL RESULTS:

data/libudfread-1.1.0/examples/udfls.c:48:13:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
            sprintf(next_dir, "%s%s/",  path, dirent.d_name);
data/libudfread-1.1.0/src/ecma167.c:33:27:  [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.
#define ecma_error(...)   fprintf(stderr, "ecma: " __VA_ARGS__)
data/libudfread-1.1.0/src/udfread.c:54:49:  [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.
#define udf_error(...)   do {                   fprintf(stderr, "udfread ERROR: " __VA_ARGS__); } while (0)
data/libudfread-1.1.0/src/udfread.c:55:49:  [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.
#define udf_log(...)     do { if (enable_log)   fprintf(stderr, "udfread LOG  : " __VA_ARGS__); } while (0)
data/libudfread-1.1.0/src/udfread.c:56:49:  [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.
#define udf_trace(...)   do { if (enable_trace) fprintf(stderr, "udfread TRACE: " __VA_ARGS__); } while (0)
data/libudfread-1.1.0/src/udfread.c:78:9:  [3] (misc) InitializeCriticalSection:
  Exceptions can be thrown in low-memory situations. Use
  InitializeCriticalSectionAndSpinCount instead.
        InitializeCriticalSection(&cs);
data/libudfread-1.1.0/src/udfread.c:81:5:  [3] (misc) EnterCriticalSection:
  On some versions of Windows, exceptions can be thrown in low-memory
  situations. Use InitializeCriticalSectionAndSpinCount instead.
    EnterCriticalSection(&cs);
data/libudfread-1.1.0/src/udfread.c:736:9:  [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.
    if (getenv("UDFREAD_LOG")) {
data/libudfread-1.1.0/src/udfread.c:739:9:  [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.
    if (getenv("UDFREAD_TRACE")) {
data/libudfread-1.1.0/src/default_blockinput.c:175:13:  [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).
    p->fd = open(path, O_RDONLY | O_BINARY);
data/libudfread-1.1.0/src/default_blockinput.c:177:13:  [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).
    p->fd = open(path, O_RDONLY);
data/libudfread-1.1.0/src/ecma167.c:53: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, p, length);
data/libudfread-1.1.0/src/ecma167.c:67: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(eid->identifier,        p + 1,  23);
data/libudfread-1.1.0/src/ecma167.c:68: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(eid->identifier_suffix, p + 24, 8);
data/libudfread-1.1.0/src/ecma167.c:106: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(pvd->volume_set_identifier, p + 72, 128);
data/libudfread-1.1.0/src/ecma167.c:142: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(lvd->contents_use, p + 248, 16);
data/libudfread-1.1.0/src/ecma167.c:158: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(lvd->partition_map_table, p + 440, map_size);
data/libudfread-1.1.0/src/ecma167.c:193: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(fi->filename, p + 38 + l_iu, fi->filename_len);
data/libudfread-1.1.0/src/ecma167.c:332: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(fe->u.data.content, p + p_ad, l_ad);
data/libudfread-1.1.0/src/udfread.c:121: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(p, s, len + 1);
data/libudfread-1.1.0/src/udfread.c:729: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 volume_set_identifier[128];
data/libudfread-1.1.0/src/udfread.c:1237: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(udf->volume_set_identifier, vds.pvd.volume_set_identifier, 128);
data/libudfread-1.1.0/src/udfread.c:1308: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(buffer, udf->volume_set_identifier, size);
data/libudfread-1.1.0/src/udfread.c:1647: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(buf, p->block + pos_off, chunk_size);
data/libudfread-1.1.0/src/udfread.c:1668: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, p->block, bytes);
data/libudfread-1.1.0/src/udfread.c:1689: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(buf, &p->fe->u.data.content[p->pos], bytes - pad_size);
data/libudfread-1.1.0/examples/udfls.c:43: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).
            next_dir = (char*)malloc(strlen(path) + strlen(dirent.d_name) + 2);
data/libudfread-1.1.0/examples/udfls.c:43:53:  [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).
            next_dir = (char*)malloc(strlen(path) + strlen(dirent.d_name) + 2);
data/libudfread-1.1.0/src/blockinput.h:46:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    int      (*read)  (udfread_block_input *, uint32_t lba, void *buf, uint32_t nblocks, int flags);
data/libudfread-1.1.0/src/default_blockinput.c:91:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        result = read(fd, buf, count);
data/libudfread-1.1.0/src/udfread.c:118: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(s);
data/libudfread-1.1.0/src/udfread.c:230:45:  [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).
    return (!memcmp(value, eid->identifier, strlen(value))) ? 0 : -1;
data/libudfread-1.1.0/src/udfread.c:257:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    result = input->read(input, lba, buf, nblocks, flags);
data/libudfread-1.1.0/src/udfread.c:1213:35:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (!udf || !input || !input->read) {

ANALYSIS SUMMARY:

Hits = 34
Lines analyzed = 3263 in approximately 0.10 seconds (31972 lines/second)
Physical Source Lines of Code (SLOC) = 2038
Hits@level = [0]  16 [1]   8 [2]  17 [3]   4 [4]   5 [5]   0
Hits@level+ = [0+]  50 [1+]  34 [2+]  26 [3+]   9 [4+]   5 [5+]   0
Hits/KSLOC@level+ = [0+] 24.5339 [1+] 16.683 [2+] 12.7576 [3+] 4.41609 [4+] 2.45339 [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.