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/pkg-kde-tools-0.15.32/dlrestrictions/dlrestrictions.c
Examining data/pkg-kde-tools-0.15.32/dlrestrictions/dlrestrictions.h
Examining data/pkg-kde-tools-0.15.32/t/dlrestrictions/testdlr.h
Examining data/pkg-kde-tools-0.15.32/t/dlrestrictions/testdlr_deeplib1.c
Examining data/pkg-kde-tools-0.15.32/t/dlrestrictions/testdlr_deeplib2.c
Examining data/pkg-kde-tools-0.15.32/t/dlrestrictions/testdlr_lib1.c
Examining data/pkg-kde-tools-0.15.32/t/dlrestrictions/testdlr_lib2.c
Examining data/pkg-kde-tools-0.15.32/t/dlrestrictions/testdlr_loader.c
Examining data/pkg-kde-tools-0.15.32/t/dlrestrictions/testdlr_plugin.c

FINAL RESULTS:

data/pkg-kde-tools-0.15.32/dlrestrictions/dlrestrictions.c:68: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(stderr, DLR_LIBRARY_NAME "(%d): ", level);
data/pkg-kde-tools-0.15.32/dlrestrictions/dlrestrictions.c:69: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(stderr, format, ap);
data/pkg-kde-tools-0.15.32/dlrestrictions/dlrestrictions.c:87:9:  [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(dlr_error_buf, sizeof(dlr_error_buf), format, ap);
data/pkg-kde-tools-0.15.32/dlrestrictions/dlrestrictions.c:100:5:  [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(str, n, DLR_LIBRARY_NAME " error (%s): " format, context, __VA_ARGS__)
data/pkg-kde-tools-0.15.32/t/dlrestrictions/testdlr_lib1.c:17:9:  [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(PLUGIN_NAME ":dlopen_lib() FAILED\n");
data/pkg-kde-tools-0.15.32/t/dlrestrictions/testdlr_loader.c:32:13:  [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(LOADER_NAME ":load_plugin_no_dlr: FAILED " PLUGIN_FUNC "\n");
data/pkg-kde-tools-0.15.32/t/dlrestrictions/testdlr_loader.c:36:9:  [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(LOADER_NAME ":load_plugin_no_dlr: FAILED dlopen\n");
data/pkg-kde-tools-0.15.32/t/dlrestrictions/testdlr_loader.c:49:13:  [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(LOADER_NAME ":load_plugin_with_dlr: FAILED " PLUGIN_FUNC "\n");
data/pkg-kde-tools-0.15.32/t/dlrestrictions/testdlr_loader.c:53:9:  [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(LOADER_NAME ":load_plugin_with_dlr: FAILED dlr_dlopen_extended\n");
data/pkg-kde-tools-0.15.32/t/dlrestrictions/testdlr_loader.c:68:9:  [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(PLUGIN_NAME ":dlopen_lib() FAILED\n");
data/pkg-kde-tools-0.15.32/dlrestrictions/dlrestrictions.c:56:18:  [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.
        envvar = getenv("DLR_DEBUG");
data/pkg-kde-tools-0.15.32/dlrestrictions/dlrestrictions.c:35:8:  [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 char dlr_error_buf[1024];
data/pkg-kde-tools-0.15.32/dlrestrictions/dlrestrictions.c:60: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).
            debug_level = atoi(envvar);
data/pkg-kde-tools-0.15.32/dlrestrictions/dlrestrictions.c:126: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/pkg-kde-tools-0.15.32/dlrestrictions/dlrestrictions.c:133:9:  [2] (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). Risk is low because the source is a constant string.
        strcpy(buf, "Unable to pretty print DLRestrictions error.");
data/pkg-kde-tools-0.15.32/dlrestrictions/dlrestrictions.c:339: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 exp[MAX_DLR_EXPRESSION_LENGTH+1];
data/pkg-kde-tools-0.15.32/dlrestrictions/dlrestrictions.h:38: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 magic[sizeof(DLR_SYMBOL_MAGIC)];
data/pkg-kde-tools-0.15.32/dlrestrictions/dlrestrictions.c:189:21:  [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).
    lib->soname_l = strlen(map->l_name) - (lib->soname - map->l_name);
data/pkg-kde-tools-0.15.32/dlrestrictions/dlrestrictions.c:371:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(exp, symbol->expression, l);

ANALYSIS SUMMARY:

Hits = 19
Lines analyzed = 861 in approximately 0.10 seconds (8741 lines/second)
Physical Source Lines of Code (SLOC) = 628
Hits@level = [0]  10 [1]   2 [2]   6 [3]   1 [4]  10 [5]   0
Hits@level+ = [0+]  29 [1+]  19 [2+]  17 [3+]  11 [4+]  10 [5+]   0
Hits/KSLOC@level+ = [0+] 46.1783 [1+] 30.2548 [2+] 27.0701 [3+] 17.5159 [4+] 15.9236 [5+]   0
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.