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/libxcb-1.14/src/xcbint.h Examining data/libxcb-1.14/src/xcb.h Examining data/libxcb-1.14/src/xcb_auth.c Examining data/libxcb-1.14/src/xcb_in.c Examining data/libxcb-1.14/src/xcb_list.c Examining data/libxcb-1.14/src/xcb_xid.c Examining data/libxcb-1.14/src/xcbext.h Examining data/libxcb-1.14/src/xcb_conn.c Examining data/libxcb-1.14/src/xcb_windefs.h Examining data/libxcb-1.14/src/xcb_out.c Examining data/libxcb-1.14/src/xcb_util.c Examining data/libxcb-1.14/src/xcb_ext.c Examining data/libxcb-1.14/tests/check_suites.h Examining data/libxcb-1.14/tests/check_public.c Examining data/libxcb-1.14/tests/check_all.c FINAL RESULTS: data/libxcb-1.14/src/xcb_util.c:439:5: [4] (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). strcpy(addr.sun_path, file); data/libxcb-1.14/src/xcb_util.c:470:5: [4] (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). strcpy(addr.sun_path + 1, file); data/libxcb-1.14/src/xcb_util.c:145:16: [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. name = getenv("DISPLAY"); data/libxcb-1.14/src/xcb_auth.c:76: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 *authnames[N_AUTH_PROTOS] = { data/libxcb-1.14/src/xcb_auth.c:98: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(*dst, src, len); data/libxcb-1.14/src/xcb_auth.c:118: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 hostnamebuf[256]; /* big enough for max hostname */ data/libxcb-1.14/src/xcb_auth.c:119: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 dispbuf[40]; /* big enough to hold more than 2^64 base 10 */ data/libxcb-1.14/src/xcb_auth.c:183: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 + *idxp, val, valsize); data/libxcb-1.14/src/xcb_conn.c:128:18: [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 const char pad[3]; data/libxcb-1.14/src/xcb_conn.c:250: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[CMSG_SPACE(XCB_MAX_PASS_FD * sizeof(int))]; data/libxcb-1.14/src/xcb_conn.c:266: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(CMSG_DATA(hdr), c->out.out_fd.fd, c->out.out_fd.nfd * sizeof (int)); data/libxcb-1.14/src/xcb_in.c:124: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(fds, ifds, nfd * sizeof (int)); data/libxcb-1.14/src/xcb_in.c:287:37: [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. if (!read_fds(c, (int *) &((char *) buf)[length], nfd)) data/libxcb-1.14/src/xcb_in.c:567:24: [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. return (int *) (&((char *) reply)[reply_size]); data/libxcb-1.14/src/xcb_in.c:990: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[CMSG_SPACE(XCB_MAX_PASS_FD * sizeof(int))]; data/libxcb-1.14/src/xcb_in.c:1022:21: [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->in.in_fd.fd[c->in.in_fd.nfd], CMSG_DATA(hdr), nfd * sizeof (int)); data/libxcb-1.14/src/xcb_in.c:1070: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, c->in.queue, done); data/libxcb-1.14/src/xcb_out.c:55: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(c->out.queue + c->out.queue_len, vector[0].iov_base, vector[0].iov_len); data/libxcb-1.14/src/xcb_out.c:57:31: [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. vector[0].iov_base = (char *) vector[0].iov_base + vector[0].iov_len; data/libxcb-1.14/src/xcb_out.c:240: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. static const char pad[3]; data/libxcb-1.14/src/xcb_util.c:97: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 path[PATH_MAX]; data/libxcb-1.14/src/xcb_util.c:110:19: [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). _screen = atoi(dot + 1); data/libxcb-1.14/src/xcb_util.c:163:13: [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(*protocol, name, len); data/libxcb-1.14/src/xcb_util.c:196: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(*host, name, len); data/libxcb-1.14/src/xcb_util.c:255: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 tsol_socket[PATH_MAX]; data/libxcb-1.14/src/xcb_util.c:348: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[6]; /* "65535" with the trailing '\0' */ data/libxcb-1.14/src/xcbint.h:101: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 queue[XCB_QUEUE_BUFFER_SIZE]; data/libxcb-1.14/src/xcbint.h:133: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 queue[4096]; data/libxcb-1.14/src/xcb_auth.c:161:19: [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). addrlen = strlen(addr); data/libxcb-1.14/src/xcb_ext.c:79: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). data->value.cookie = xcb_query_extension(c, strlen(ext->name), ext->name); data/libxcb-1.14/src/xcb_util.c:270:36: [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). filelen = actual_filelen = strlen(file); data/libxcb-1.14/src/xcb_util.c:274:19: [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). filelen = strlen(base) + 1 + sizeof(display) * 3 + 1; ANALYSIS SUMMARY: Hits = 32 Lines analyzed = 4899 in approximately 0.19 seconds (25406 lines/second) Physical Source Lines of Code (SLOC) = 3134 Hits@level = [0] 7 [1] 4 [2] 25 [3] 1 [4] 2 [5] 0 Hits@level+ = [0+] 39 [1+] 32 [2+] 28 [3+] 3 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 12.4442 [1+] 10.2106 [2+] 8.93427 [3+] 0.957243 [4+] 0.638162 [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.