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/gtetrinet-0.7.11+git20200916.46e7ade/src/client.c
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/client.h
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/commands.c
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/commands.h
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/config.c
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/dialogs.c
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/dialogs.h
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/fields.c
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/fields.h
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/gtet_config.h
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/gtetrinet.c
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/gtetrinet.h
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/misc.c
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/misc.h
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/partyline.c
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/partyline.h
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/sound.c
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/sound.h
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.h
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetris.c
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetris.h
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/winlist.c
Examining data/gtetrinet-0.7.11+git20200916.46e7ade/src/winlist.h

FINAL RESULTS:

data/gtetrinet-0.7.11+git20200916.46e7ade/src/dialogs.c:690:29:  [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.
    dir = g_build_filename (getenv ("HOME"), ".gtetrinet", "themes", NULL);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/gtetrinet.c:129:5:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    srand (time(NULL));
data/gtetrinet-0.7.11+git20200916.46e7ade/src/client.c:49: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 server[128];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/client.c:157:33:  [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 void server_ip (unsigned char buf[4]);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/client.c:183: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[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/client.c:219: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 ip[4];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/client.c:240: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 errmsg[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/client.c:296: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 hbuf[NI_MAXHOST];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/client.c:298: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 service[10];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/client.c:470:26:  [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.
void server_ip (unsigned char buf[4])
data/gtetrinet-0.7.11+git20200916.46e7ade/src/client.c:478: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 (buf, ((char *) &sin.sin6_addr) + 12, 4);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/client.c:481: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 (buf, &sin4->sin_addr, 4);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/client.h:2: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.
extern char server[128];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/commands.c:234: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 buf[22];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/commands.c:266: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 buf[22];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/commands.c:274: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 buf[22];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/commands.c:326: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 buf[256];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/config.c:41: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 blocksfile[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/config.c:46: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 *soundkeys[S_NUM] = {
data/gtetrinet-0.7.11+git20200916.46e7ade/src/config.c:99: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[1024], *p;
data/gtetrinet-0.7.11+git20200916.46e7ade/src/config.c:168: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[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/dialogs.c:518: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 dir[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/dialogs.c:519: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 name[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/dialogs.c:647: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 author[1024], desc[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/dialogs.c:682: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 str[1024], buf[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/dialogs.c:685: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 *basedir[2];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/fields.c:321: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[11];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/fields.c:442: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 (displayblock, block, 16);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/fields.c:470: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[16] = "";
data/gtetrinet-0.7.11+git20200916.46e7ade/src/fields.c:478: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[16] = "";
data/gtetrinet-0.7.11+git20200916.46e7ade/src/fields.c:486: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[16] = "";
data/gtetrinet-0.7.11+git20200916.46e7ade/src/gtet_config.h:5: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.
extern char blocksfile[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/misc.h:29: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((x), (y), gtet_strcpy_y_len); \
data/gtetrinet-0.7.11+git20200916.46e7ade/src/misc.h:48: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((x) + gtet_strcat_x_len, (y), gtet_strcat_y_len); \
data/gtetrinet-0.7.11+git20200916.46e7ade/src/partyline.c:49: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 plhistory[PLHSIZE][256];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/partyline.c:123: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 buf[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/partyline.c:124: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 timestamp[9];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/partyline.c:155: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 buf0[16], buf1[128], buf2[128];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/sound.c:35: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 soundfiles[S_NUM][1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/sound.c:41: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 *soundsamples[S_NUM] = {NULL};
data/gtetrinet-0.7.11+git20200916.46e7ade/src/sound.h:16: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.
extern char soundfiles[S_NUM][1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:56: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 team[128], nick[128], specpassword[128];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:63: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 playernames[MAX_PLAYERS][128];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:64: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 teamnames[MAX_PLAYERS][128];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:69: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 spectatorlist[128][128];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:72: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 specialblocks[256];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:177: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[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:244: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).
        tmp_pnum = atoi (data);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:302: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).
            pnum = atoi (token);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:330: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).
            pnum = atoi (token);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:359: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).
            pnum = atoi (token);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:388: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).
            pnum = atoi (token);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:407: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).
            pnum = atoi (token);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:524: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).
            pnum = atoi (token);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:536: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).
            pnum = atoi (data);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:546: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).
            pnum = atoi (data);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:570: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 bfreq[128], sfreq[128];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:653:21:  [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).
	    int newstate = atoi(data);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:691: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).
            pnum = atoi (s);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:698:22:  [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.
                p = (char *)fields[pnum];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:725:18:  [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).
            to = atoi (token);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:732: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).
            from = atoi(token);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:747: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).
            pnum = atoi (token);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:752: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).
            playerlevels[pnum] = atoi (token);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:782: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).
                score = atoi (token2);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:789: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 *token, buf[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:804: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 *name, *info, buf[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:825: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 *name, *info, buf[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:871: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 buf[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:907: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[128];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:925: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[1024], buf2[1024], *p;
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:979: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 buf[1024], *p;
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:981: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 diff_buf[15][(FIELDWIDTH + 1)* FIELDHEIGHT * 2] = {{0}};
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:1046: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[1024], buf2[1024], *p;
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:1155: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[512], buf2[256];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:1495: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[11];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:1647: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[256];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:1670: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[32];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:1839: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[64];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:1883: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 buf[256];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:1912: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 pjoins[16][128];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:1913: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 pteams[16][128];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:1915: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 pleaves[16][128];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:1923: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[1024], buf2[1024], team[128];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:2018: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 buf[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:2050: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 *pnames[6], *teams[6], *specs[128];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:2093: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[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:2102: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[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:2113: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[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:2122: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[1024];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.h:4: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.
typedef char FIELD[FIELDHEIGHT][FIELDWIDTH];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.h:9: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.
extern char team[128], nick[128], specpassword[128];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.h:16: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.
extern char specialblocks[256];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetris.c:403: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 ((void *)dest, (void *)src, FIELDHEIGHT*FIELDWIDTH);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetris.h:1: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.
typedef char TETRISBLOCK[4][4];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetris.h:2: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.
typedef char (*P_TETRISBLOCK)[4];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/winlist.c:73: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[16], *item[2];
data/gtetrinet-0.7.11+git20200916.46e7ade/src/client.c:387:13:  [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)) client_inmessage (buf);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/client.c:409: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).
    buf[strlen(str)] = 0xFF;
data/gtetrinet-0.7.11+git20200916.46e7ade/src/client.c:410:48:  [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).
    g_io_channel_write_chars (io_channel, buf, strlen(str)+1, NULL, &error);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/fields.c:547: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).
    if (strlen(s) > 0) {
data/gtetrinet-0.7.11+git20200916.46e7ade/src/misc.c:59:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if (read (fd, &buf[c], 1) == 0) break;
data/gtetrinet-0.7.11+git20200916.46e7ade/src/misc.c:299: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).
  size_t len = strlen(str);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/misc.h:21: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).
  size_t gtet_strcpy_y_len = strlen(y); \
data/gtetrinet-0.7.11+git20200916.46e7ade/src/misc.h:35: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).
  size_t gtet_strcat_x_len = strlen(x); \
data/gtetrinet-0.7.11+git20200916.46e7ade/src/misc.h:36: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).
  size_t gtet_strcat_y_len = strlen(y); \
data/gtetrinet-0.7.11+git20200916.46e7ade/src/partyline.c:202: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).
    if (strlen(text) == 0) return;
data/gtetrinet-0.7.11+git20200916.46e7ade/src/partyline.c:319:37:  [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).
  g_scanner_input_text (scan, line, strlen (line));
data/gtetrinet-0.7.11+git20200916.46e7ade/src/partyline.c:405:51:  [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 (!g_scanner_eof(scan) && (scan->position < strlen(line)))
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:455: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).
                  if (!strncmp ("has joined", &line[strlen (playernames[playernum])+1], 10))
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:457:54:  [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).
                    partyline_joining_channel (&line[strlen (playernames[playernum])+20]);
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:571:13:  [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.
            sscanf (data, "%d %d %d %d %d %d %d %128s %128s %d %d",
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:949: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).
    if (strlen (buf) >= FIELDHEIGHT*FIELDWIDTH+2) {
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:1934:13:  [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[strlen(buf)-2] = 0; /* remove ", " from end of string */
data/gtetrinet-0.7.11+git20200916.46e7ade/src/tetrinet.c:1948:13:  [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[strlen(buf)-2] = 0;

ANALYSIS SUMMARY:

Hits = 115
Lines analyzed = 7386 in approximately 0.22 seconds (34125 lines/second)
Physical Source Lines of Code (SLOC) = 5834
Hits@level = [0]   9 [1]  18 [2]  95 [3]   2 [4]   0 [5]   0
Hits@level+ = [0+] 124 [1+] 115 [2+]  97 [3+]   2 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 21.2547 [1+] 19.712 [2+] 16.6267 [3+] 0.342818 [4+]   0 [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.