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/gfxboot-4.5.2-1.1/bin2c.c
Examining data/gfxboot-4.5.2-1.1/themes/openSUSE/talk/sc.c
Examining data/gfxboot-4.5.2-1.1/addblack.c
Examining data/gfxboot-4.5.2-1.1/gfxboot-compile.c
Examining data/gfxboot-4.5.2-1.1/gfxboot-font.c

FINAL RESULTS:

data/gfxboot-4.5.2-1.1/gfxboot-compile.c:1787:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(buf, "%*s", ind, "");
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:1794:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(buf, "%*s", ind, "");
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:1801:3:  [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(buf, s);
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:174:14:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while((i = getopt_long(argc, argv, "c:fhiL:l:Ov", options, NULL)) != -1) {
data/gfxboot-4.5.2-1.1/gfxboot-font.c:189:14:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while((i = getopt_long(argc, argv, "Aa:c:f:H:l:p:st:v", options, NULL)) != -1) {
data/gfxboot-4.5.2-1.1/addblack.c:56:7:  [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).
  f = fopen(name, "r");
data/gfxboot-4.5.2-1.1/addblack.c:117:27:  [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).
  f = strcmp(name, "-") ? fopen(name, "w") : stdout;
data/gfxboot-4.5.2-1.1/addblack.c:143: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(d->data + d->size, buffer, size);
data/gfxboot-4.5.2-1.1/addblack.c:156: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.
  unsigned char black[4] = { 12, 0, 0, 0 };
data/gfxboot-4.5.2-1.1/addblack.c:158: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.
  unsigned char c[1];
data/gfxboot-4.5.2-1.1/bin2c.c:10: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).
    if(!(f = fopen(argv[1], "r"))) {
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:64: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 *type_name[16] = {
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:155:1:  [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 *lib_path[2] = { NULL, "/usr/share/gfxboot" };
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:259:7:  [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).
  f = fopen(name, "r");
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:264:13:  [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).
        f = fopen(s, "r");
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:333:27:  [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).
  f = strcmp(name, "-") ? fopen(name, "w") : stdout;
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:402: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.
  unsigned char buf[4];
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:423: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(d->data + d->size, buffer, size);
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:489:3:  [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[17];
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:596:3:  [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 s2[len + 1];
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:614:10:  [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 buf[16];
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:653:10:  [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 word[1024];
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:778:3:  [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 t[5][100];
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:871:11:  [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->enc + 1 + u0, c->value.p, u1);
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:983:34:  [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).
  if(log_file && *log_file) lf = fopen(log_file, "w");
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:1768:10:  [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 buf[10240] = {};
data/gfxboot-4.5.2-1.1/gfxboot-font.c:165:3:  [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 obuf[4], ibuf[6];
data/gfxboot-4.5.2-1.1/gfxboot-font.c:166:3:  [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 obuf2[4*0x100], ibuf2[0x100];
data/gfxboot-4.5.2-1.1/gfxboot-font.c:176: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.
  unsigned char char_ofs[5];
data/gfxboot-4.5.2-1.1/gfxboot-font.c:224:11:  [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(font->name, font_spec, s - font_spec);
data/gfxboot-4.5.2-1.1/gfxboot-font.c:324:17:  [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).
        if((f = fopen(optarg, "r"))) {
data/gfxboot-4.5.2-1.1/gfxboot-font.c:356:15:  [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(ibuf, ibuf + sizeof ibuf - ibuf_left, ibuf_left);
data/gfxboot-4.5.2-1.1/gfxboot-font.c:615:7:  [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).
  f = fopen(name, "r");
data/gfxboot-4.5.2-1.1/gfxboot-font.c:769: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(d->data + d->size, buffer, size);
data/gfxboot-4.5.2-1.1/gfxboot-font.c:783:27:  [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).
  f = strcmp(name, "-") ? fopen(name, "w") : stdout;
data/gfxboot-4.5.2-1.1/gfxboot-font.c:1113: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(bitmap + i * width, cd->bitmap + dx + (i + dy) * cd->bitmap_width, width);
data/gfxboot-4.5.2-1.1/gfxboot-font.c:1149:10:  [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 buf[16];
data/gfxboot-4.5.2-1.1/gfxboot-font.c:1293: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.
  unsigned char col[MAX_GRAY + 1];
data/gfxboot-4.5.2-1.1/gfxboot-font.c:1379:3:  [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(cd->data, buf, cd->data_len);
data/gfxboot-4.5.2-1.1/gfxboot-font.c:1399:3:  [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(&fh, font_file->data, sizeof fh);
data/gfxboot-4.5.2-1.1/gfxboot-font.c:1434: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(cd->data, font_file->data + ofs, cd->data_len);
data/gfxboot-4.5.2-1.1/themes/openSUSE/talk/sc.c:73:3:  [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(fd_compr.data, &sh, sizeof (snd_header_t));
data/gfxboot-4.5.2-1.1/themes/openSUSE/talk/sc.c:90:7:  [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).
  f = fopen(name, "r");
data/gfxboot-4.5.2-1.1/themes/openSUSE/talk/sc.c:136: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(d->data + d->size, buffer, size);
data/gfxboot-4.5.2-1.1/themes/openSUSE/talk/sc.c:150:27:  [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).
  f = strcmp(name, "-") ? fopen(name, "w") : stdout;
data/gfxboot-4.5.2-1.1/bin2c.c:22:14:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  while((i = fgetc(f)) != EOF) {
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:599:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(s2, s, len);
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:766:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(word, start, n);
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:781:7:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
  n = sscanf(comment, " %99s %99s %99s %99s %99s", t[0], t[1], t[2], t[3], t[4]);
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:865:16:  [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).
          u1 = strlen(c->value.p) + 1;
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:1777:6:  [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).
  if(strlen(buf) + strlen(s) >= sizeof buf - 1) {
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:1777:20:  [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).
  if(strlen(buf) + strlen(s) >= sizeof buf - 1) {
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:1798:5:  [1] (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). Risk is low because the
  source is a constant character.
    strcat(buf, " ");
data/gfxboot-4.5.2-1.1/gfxboot-compile.c:1898: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).
        buf = malloc(strlen((char *) data + i + u + 1) * 4 + 3);
data/gfxboot-4.5.2-1.1/gfxboot-font.c:898:56:  [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).
    if(sscanf(s, "%i - %i%n", &i, &j, &k) == 2 && k == strlen(s)) {

ANALYSIS SUMMARY:

Hits = 55
Lines analyzed = 3953 in approximately 0.22 seconds (18112 lines/second)
Physical Source Lines of Code (SLOC) = 3134
Hits@level = [0] 201 [1]  10 [2]  40 [3]   2 [4]   3 [5]   0
Hits@level+ = [0+] 256 [1+]  55 [2+]  45 [3+]   5 [4+]   3 [5+]   0
Hits/KSLOC@level+ = [0+] 81.6847 [1+] 17.5495 [2+] 14.3586 [3+] 1.59541 [4+] 0.957243 [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.