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/callisto-1.1.0/src/eeprom.c
Examining data/callisto-1.1.0/src/util.h
Examining data/callisto-1.1.0/src/server.h
Examining data/callisto-1.1.0/src/fits.h
Examining data/callisto-1.1.0/src/conf.h
Examining data/callisto-1.1.0/src/fits.c
Examining data/callisto-1.1.0/src/conf.c
Examining data/callisto-1.1.0/src/server.c
Examining data/callisto-1.1.0/src/callisto.c
Examining data/callisto-1.1.0/src/util.c
Examining data/callisto-1.1.0/src/callisto.h
Examining data/callisto-1.1.0/src/serial.c
Examining data/callisto-1.1.0/src/eeprom.h
Examining data/callisto-1.1.0/src/log.h
Examining data/callisto-1.1.0/src/serial.h
Examining data/callisto-1.1.0/src/log.c

FINAL RESULTS:

data/callisto-1.1.0/src/callisto.c:359:9:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (access(config.datadir, W_OK)) {
data/callisto-1.1.0/src/callisto.c:367:9:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (access(config.ovsdir, W_OK)) {
data/callisto-1.1.0/src/fits.c:66:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(s, "%04u/%02u/%02u  Radio flux density, e-CALLISTO (%s)",
data/callisto-1.1.0/src/log.c:29:2:  [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, args);
data/callisto-1.1.0/src/callisto.c:167:15:  [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.
        opt = getopt_long(argc, argv, "c:o:O:s:u:LCdDVh46", long_options, NULL);
data/callisto-1.1.0/src/util.c:33:10:  [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.
    tz = getenv("TZ");
data/callisto-1.1.0/src/callisto.c:57: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 message[MAX_MESSAGE] = "";
data/callisto-1.1.0/src/callisto.c:281:17:  [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).
        pidfd = open(pidfile, O_WRONLY|O_CREAT|O_EXCL, 0644);
data/callisto-1.1.0/src/callisto.c:393: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 pidstr[20];
data/callisto-1.1.0/src/callisto.c:596:6:  [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(&old_st, &st, sizeof(st));
data/callisto-1.1.0/src/callisto.c:677: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[MAX_MESSAGE];
data/callisto-1.1.0/src/callisto.c:764: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 cmd[64];
data/callisto-1.1.0/src/callisto.c:772:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(cmd, "GS%u\r", maxcounter);
data/callisto-1.1.0/src/callisto.c:778:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(cmd, "GA%u\r", maxcounter);
data/callisto-1.1.0/src/callisto.c:783:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(cmd, "T%u\rO%03u\rC%u\r",
data/callisto-1.1.0/src/callisto.c:789: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 cmd[64];
data/callisto-1.1.0/src/callisto.c:792:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(cmd, "FS%02u%02u\rL%u\rS1\rGE\r",
data/callisto-1.1.0/src/callisto.c:821: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 fname[PATH_MAX];
data/callisto-1.1.0/src/callisto.c:831: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(fname, "a")) == NULL) {
data/callisto-1.1.0/src/conf.c:20: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.
    static char buffer[MAXLINE];
data/callisto-1.1.0/src/conf.c:101: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(fname, "r")) == NULL) {
data/callisto-1.1.0/src/conf.c:154: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).
	    config.chargepump = !!atoi(value);
data/callisto-1.1.0/src/conf.c:156: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).
	    config.agclevel = atoi(value);
data/callisto-1.1.0/src/conf.c:158: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).
	    config.clocksource = atoi(value);
data/callisto-1.1.0/src/conf.c:160: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).
	    config.filetime = atoi(value);
data/callisto-1.1.0/src/conf.c:163:25:  [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).
	    config.focuscode = atoi(value);
data/callisto-1.1.0/src/conf.c:166:25:  [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).
	    config.autostart = atoi(value);
data/callisto-1.1.0/src/conf.c:168: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).
	    config.net_port = atoi(value);
data/callisto-1.1.0/src/conf.c:170:14:  [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).
	    mmode = atoi(value);
data/callisto-1.1.0/src/conf.c:206: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(fname, "r")) == NULL) {
data/callisto-1.1.0/src/conf.c:220:25:  [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).
	    config.nchannels = atoi(value);
data/callisto-1.1.0/src/conf.c:227:16:  [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).
	    nsweeps = atoi(value);
data/callisto-1.1.0/src/conf.c:286: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(fname, "r")) == NULL) {
data/callisto-1.1.0/src/eeprom.c:37:2:  [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 cmd[32];
data/callisto-1.1.0/src/eeprom.c:54:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(cmd, "FE%u,%03u,%03u,%03u,%03u\r",
data/callisto-1.1.0/src/eeprom.c:69: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 msg[MAX_MESSAGE];
data/callisto-1.1.0/src/eeprom.c:97:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(msg, "FR%i\r", ch+1);
data/callisto-1.1.0/src/fits.c:24: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 s[PATH_MAX];
data/callisto-1.1.0/src/fits.c:35: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 tForm_0[32], tForm_1[32];
data/callisto-1.1.0/src/fits.c: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 errstr[FLEN_STATUS];
data/callisto-1.1.0/src/fits.c:63:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(s, "%04u-%02u-%02u", t.tm_year+1900, t.tm_mon+1, t.tm_mday);
data/callisto-1.1.0/src/fits.c:80:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(s, "%04u/%02u/%02u",
data/callisto-1.1.0/src/fits.c:84:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(s, "%02u:%02u:%02u.%03u", t.tm_hour, t.tm_min, t.tm_sec,
data/callisto-1.1.0/src/fits.c:90:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(s, "%04u/%02u/%02u", et.tm_year+1900, et.tm_mon+1, et.tm_mday);
data/callisto-1.1.0/src/fits.c:93:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(s, "%02u:%02u:%02u", et.tm_hour, et.tm_min, et.tm_sec);
data/callisto-1.1.0/src/fits.c:159:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(s,"%c", config.obs_lat < 0.0 ? 'S' : 'N');
data/callisto-1.1.0/src/fits.c:165:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(s,"%c", config.obs_long < 0.0 ? 'W' : 'E');
data/callisto-1.1.0/src/fits.c:182:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(tForm[0],"%dD8.3", image_w);
data/callisto-1.1.0/src/fits.c:183:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(tForm[1],"%dD8.3", image_h);
data/callisto-1.1.0/src/serial.c:23:22:  [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).
    if ((serial_fd = open(devname, O_RDWR|O_NOCTTY)) < 0) {
data/callisto-1.1.0/src/server.c:26: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[MAXLINE];
data/callisto-1.1.0/src/server.c:225:2:  [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(&addr6->sin6_addr, &in6addr_any, sizeof(in6addr_any));
data/callisto-1.1.0/src/util.c:57:15:  [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).
    if ((fd = open("/dev/null", O_RDWR)) < 0)
data/callisto-1.1.0/src/callisto.c:315:9:  [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).
    l = strlen(ID_RESPONSE);
data/callisto-1.1.0/src/callisto.c:395:30:  [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).
        write(pidfd, pidstr, strlen(pidstr));
data/callisto-1.1.0/src/callisto.c:697:9:  [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).
    l = strlen(VERSION_STR_15);
data/callisto-1.1.0/src/callisto.c:702:9:  [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).
    l = strlen(VERSION_STR_17);
data/callisto-1.1.0/src/callisto.c:713:9:  [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).
    l = strlen(VERSION_STR_18);
data/callisto-1.1.0/src/conf.c:25: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).
	l = strlen(buffer);
data/callisto-1.1.0/src/conf.c:42: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).
	l = strlen(k);
data/callisto-1.1.0/src/serial.c:82:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while ((r = read(serial_fd, c, 1)) != 1) {
data/callisto-1.1.0/src/serial.c:107: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).
    ssize_t w, left = strlen(s);
data/callisto-1.1.0/src/server.c:54:17:  [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).
        int l = strlen(buf);
data/callisto-1.1.0/src/server.c:200:39:  [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).
            e = write(client_fd, msg, strlen(msg));

ANALYSIS SUMMARY:

Hits = 64
Lines analyzed = 2499 in approximately 0.09 seconds (29239 lines/second)
Physical Source Lines of Code (SLOC) = 1951
Hits@level = [0]  69 [1]  11 [2]  47 [3]   2 [4]   4 [5]   0
Hits@level+ = [0+] 133 [1+]  64 [2+]  53 [3+]   6 [4+]   4 [5+]   0
Hits/KSLOC@level+ = [0+] 68.1702 [1+] 32.8037 [2+] 27.1656 [3+] 3.07535 [4+] 2.05023 [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.