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/gtk-vnc-1.0.0/examples/gvncviewer.c Examining data/gtk-vnc-1.0.0/src/vncconnectiontest.c Examining data/gtk-vnc-1.0.0/src/vncutil.h Examining data/gtk-vnc-1.0.0/src/vnccairoframebuffer.c Examining data/gtk-vnc-1.0.0/src/vnccolormap.c Examining data/gtk-vnc-1.0.0/src/vnccolormap.h Examining data/gtk-vnc-1.0.0/src/vncaudiopulse.h Examining data/gtk-vnc-1.0.0/src/vnccursor.h Examining data/gtk-vnc-1.0.0/src/continuation.h Examining data/gtk-vnc-1.0.0/src/vncutil.c Examining data/gtk-vnc-1.0.0/src/vnccursor.c Examining data/gtk-vnc-1.0.0/src/vncbaseaudio.h Examining data/gtk-vnc-1.0.0/src/vncgrabsequence.h Examining data/gtk-vnc-1.0.0/src/continuation.c Examining data/gtk-vnc-1.0.0/src/vncconnection.h Examining data/gtk-vnc-1.0.0/src/vncframebuffer.h Examining data/gtk-vnc-1.0.0/src/coroutine_ucontext.c Examining data/gtk-vnc-1.0.0/src/vnccairoframebuffer.h Examining data/gtk-vnc-1.0.0/src/coroutine_gthread.c Examining data/gtk-vnc-1.0.0/src/vncbaseaudio.c Examining data/gtk-vnc-1.0.0/src/dh.c Examining data/gtk-vnc-1.0.0/src/vncaudioformat.c Examining data/gtk-vnc-1.0.0/src/vncconnectionblt.h Examining data/gtk-vnc-1.0.0/src/vncaudioformat.h Examining data/gtk-vnc-1.0.0/src/vncbaseframebuffer.c Examining data/gtk-vnc-1.0.0/src/gvncpulse.h Examining data/gtk-vnc-1.0.0/src/vncconnection.c Examining data/gtk-vnc-1.0.0/src/vncbaseframebuffer.h Examining data/gtk-vnc-1.0.0/src/vncpixelformat.c Examining data/gtk-vnc-1.0.0/src/vncaudiopulse.c Examining data/gtk-vnc-1.0.0/src/gtk-vnc.h Examining data/gtk-vnc-1.0.0/src/vncbaseframebufferblt.h Examining data/gtk-vnc-1.0.0/src/vncdisplaykeymap.c Examining data/gtk-vnc-1.0.0/src/dh.h Examining data/gtk-vnc-1.0.0/src/vncpixelformat.h Examining data/gtk-vnc-1.0.0/src/vncaudio.c Examining data/gtk-vnc-1.0.0/src/vncframebuffer.c Examining data/gtk-vnc-1.0.0/src/coroutine.h Examining data/gtk-vnc-1.0.0/src/vncaudio.h Examining data/gtk-vnc-1.0.0/src/vncdisplay.c Examining data/gtk-vnc-1.0.0/src/vncdisplay.h Examining data/gtk-vnc-1.0.0/src/vncaudiosample.c Examining data/gtk-vnc-1.0.0/src/vncaudiosample.h Examining data/gtk-vnc-1.0.0/src/vncdisplaykeymap.h Examining data/gtk-vnc-1.0.0/src/vncgrabsequence.c Examining data/gtk-vnc-1.0.0/src/gvnc.h Examining data/gtk-vnc-1.0.0/tools/gvnccapture.c Examining data/gtk-vnc-1.0.0/subprojects/keycodemapdb/tests/stdc.c Examining data/gtk-vnc-1.0.0/subprojects/keycodemapdb/tests/stdc++.cc FINAL RESULTS: data/gtk-vnc-1.0.0/src/vncconnectiontest.c:618:9: [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. if (getenv("GTK_VNC_DEBUG")) { data/gtk-vnc-1.0.0/examples/gvncviewer.c:788:49: [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). port = g_strdup_printf("%d", 5900 + atoi(tmp + 1)); data/gtk-vnc-1.0.0/src/vncaudiosample.c:85: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(ret->data, sample->data, sample->length); data/gtk-vnc-1.0.0/src/vncbaseframebuffer.c:786: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(dst, src, width * (priv->localFormat->bits_per_pixel / 8)); data/gtk-vnc-1.0.0/src/vncbaseframebufferblt.h:110: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(dst, dst - priv->rowstride, width * sizeof(*sp)); data/gtk-vnc-1.0.0/src/vncbaseframebufferblt.h:137: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(dst, dst - priv->rowstride, width * sizeof(dst_pixel_t)); data/gtk-vnc-1.0.0/src/vnccolormap.c:84: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(ret->colors, map->colors, data/gtk-vnc-1.0.0/src/vncconnection.c:193: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 read_buffer[4096]; data/gtk-vnc-1.0.0/src/vncconnection.c:197: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 write_buffer[4096]; data/gtk-vnc-1.0.0/src/vncconnection.c:693: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(ptr + offset, data/gtk-vnc-1.0.0/src/vncconnection.c:836: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(priv->read_buffer, data/gtk-vnc-1.0.0/src/vncconnection.c:919: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(ptr + offset, priv->read_buffer + priv->read_offset, tmp); data/gtk-vnc-1.0.0/src/vncconnection.c:1063: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(priv->write_buffer+priv->write_offset, ptr + offset, tmp); data/gtk-vnc-1.0.0/src/vncconnection.c:1602: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(&priv->xmit_buffer[priv->xmit_buffer_size], data/gtk-vnc-1.0.0/src/vncconnection.c:1691: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(&priv->fmt, fmt, sizeof(*fmt)); data/gtk-vnc-1.0.0/src/vncconnection.c:1755: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(&priv->audio_format, fmt, sizeof(*fmt)); data/gtk-vnc-1.0.0/src/vncconnection.c:2613: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(pixel, &val, 4); data/gtk-vnc-1.0.0/src/vncconnection.c:3572: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 reason[1024]; data/gtk-vnc-1.0.0/src/vncconnection.c:3631: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(key, priv->cred_password, keylen); data/gtk-vnc-1.0.0/src/vncconnection.c:3684:14: [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 newkey[8]; data/gtk-vnc-1.0.0/src/vncconnection.c:3787: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(password, priv->cred_password, passwordLen); data/gtk-vnc-1.0.0/src/vncconnection.c:3788: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(username, priv->cred_username, usernameLen); data/gtk-vnc-1.0.0/src/vncconnection.c:3901: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(userpass, priv->cred_username, usernameLen); data/gtk-vnc-1.0.0/src/vncconnection.c:3902: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(userpass+sizeof(userpass)/2, priv->cred_password, passwordLen); data/gtk-vnc-1.0.0/src/vncconnection.c:5325: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 version[13]; data/gtk-vnc-1.0.0/src/vncconnection.c:5572: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). int port = atoi(priv->port); data/gtk-vnc-1.0.0/src/vncgrabsequence.c:60: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(sequence->keysyms, keysyms, sizeof(guint)*nkeysyms); data/gtk-vnc-1.0.0/src/vncgrabsequence.c:121: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(ret->keysyms, sequence->keysyms, data/gtk-vnc-1.0.0/tools/gvnccapture.c:515:32: [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). capture->port = 5900 + atoi(display); data/gtk-vnc-1.0.0/examples/gvncviewer.c:398: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). (strlen(keys) > 0) ? "+" : " ", gdk_keyval_name(keysyms[i])); data/gtk-vnc-1.0.0/examples/gvncviewer.c:768: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). (args[0], strlen(args[0]), data/gtk-vnc-1.0.0/src/vncconnection.c:3628:14: [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). keylen = strlen(priv->cred_password); data/gtk-vnc-1.0.0/src/vncconnection.c:3778: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). passwordLen = strlen(priv->cred_password); data/gtk-vnc-1.0.0/src/vncconnection.c:3779: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). usernameLen = strlen(priv->cred_username); data/gtk-vnc-1.0.0/src/vncconnection.c:3893: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). passwordLen = strlen(priv->cred_password)+1; data/gtk-vnc-1.0.0/src/vncconnection.c:3894: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). usernameLen = strlen(priv->cred_username)+1; data/gtk-vnc-1.0.0/src/vncconnection.c:4016: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). interact[ninteract].len = strlen(priv->cred_username); data/gtk-vnc-1.0.0/src/vncconnection.c:4022: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). interact[ninteract].len = strlen(priv->cred_password); data/gtk-vnc-1.0.0/src/vncconnection.c:4255: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). vnc_connection_write_u32(conn, strlen(mechname)); data/gtk-vnc-1.0.0/src/vncconnection.c:4256:42: [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). vnc_connection_write(conn, mechname, strlen(mechname)); data/gtk-vnc-1.0.0/src/vncdisplay.c:2825:63: [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). vnc_connection_client_cut_text(obj->priv->conn, text, strlen (text)); data/gtk-vnc-1.0.0/src/vncdisplaykeymap.c:97:41: [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). #define STRPREFIX(a,b) (strncmp((a),(b),strlen((b))) == 0) data/gtk-vnc-1.0.0/tools/gvnccapture.c:165:15: [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). len = strlen(res); data/gtk-vnc-1.0.0/tools/gvnccapture.c:192:15: [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). len = strlen(res); ANALYSIS SUMMARY: Hits = 44 Lines analyzed = 17501 in approximately 0.43 seconds (40388 lines/second) Physical Source Lines of Code (SLOC) = 11312 Hits@level = [0] 33 [1] 15 [2] 28 [3] 1 [4] 0 [5] 0 Hits@level+ = [0+] 77 [1+] 44 [2+] 29 [3+] 1 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 6.80693 [1+] 3.88967 [2+] 2.56365 [3+] 0.0884017 [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.