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/gr-fosphor-3.8~2.2d4fe78/include/gnuradio/fosphor/api.h Examining data/gr-fosphor-3.8~2.2d4fe78/include/gnuradio/fosphor/base_sink_c.h Examining data/gr-fosphor-3.8~2.2d4fe78/include/gnuradio/fosphor/glfw_sink_c.h Examining data/gr-fosphor-3.8~2.2d4fe78/include/gnuradio/fosphor/qt_sink_c.h Examining data/gr-fosphor-3.8~2.2d4fe78/lib/QGLSurface.cc Examining data/gr-fosphor-3.8~2.2d4fe78/lib/QGLSurface.h Examining data/gr-fosphor-3.8~2.2d4fe78/lib/base_sink_c_impl.cc Examining data/gr-fosphor-3.8~2.2d4fe78/lib/base_sink_c_impl.h Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fifo.cc Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fifo.h Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/axis.c Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/axis.h Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/cl.c Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/cl.h Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/cl_compat.c Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/cl_compat.h Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/cl_platform.h Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/fosphor.c Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/fosphor.h Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl.c Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl.h Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl_cmap.c Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl_cmap.h Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl_cmap_gen.c Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl_cmap_gen.h Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl_font.c Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl_font.h Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl_platform.h Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/llist.h Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/main.c Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/private.h Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/resource.c Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/resource.h Examining data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/resource_internal.h Examining data/gr-fosphor-3.8~2.2d4fe78/lib/glfw_sink_c_impl.cc Examining data/gr-fosphor-3.8~2.2d4fe78/lib/glfw_sink_c_impl.h Examining data/gr-fosphor-3.8~2.2d4fe78/lib/qt_sink_c_impl.cc Examining data/gr-fosphor-3.8~2.2d4fe78/lib/qt_sink_c_impl.h FINAL RESULTS: data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/axis.c:124:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fx->abs_fmt, "%%.%dlf%s", y, prefix); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/axis.c:147:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fx->rel_fmt, "%%+.%dlf%s", y, prefix); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/axis.c:168:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(str, fx->rel_fmt, step * fx->rel_step); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/axis.c:173:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(str, fx->abs_fmt, (fx->center + step * fx->step) * fx->abs_scale); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl_font.c:440:6: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. l = vsnprintf(static_buf, sizeof(static_buf), fmt, va1); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl_font.c:447:3: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(buf, l, fmt, va2); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl_font.h:69:51: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. const char *fmt, ...) ATTR_FORMAT(printf, 6, 7); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/resource.c:77:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(p, "%s/%s", env, rc->name); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/resource.c:170:2: [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(n, name); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/cl.c:291:12: [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. env_sel = getenv("FOSPHOR_CL_DEV"); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/resource.c:70:8: [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. env = getenv("RESOURCE_PATH"); data/gr-fosphor-3.8~2.2d4fe78/lib/base_sink_c_impl.cc:449: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(dst, in, sizeof(gr_complex) * l); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/axis.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. const char prefixes[5] = { ' ', 'k', 'M', 'G', 'T' }; data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/axis.c:98: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 prefix[2] = {0, 0}; data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/axis.c:131: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 prefix[2] = {0, 0}; data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/axis.c:156:3: [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(str, "%+d", step); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/axis.h:39: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 abs_fmt[16]; data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/axis.h:41: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 rel_fmt[16]; data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/cl.c:64: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 name[128]; data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/cl.c:65: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 vendor[128]; data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/cl.c:132: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 txt[2048]; data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/cl.c:258: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 vendor[sizeof(feat->vendor)]; data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/cl.c:322: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(feat, &feat_cur, sizeof(struct fosphor_cl_features)); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/cl.c:384: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 name_buf[256]; data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/cl.c:396: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). FILE *fh = fopen(name_buf, "wb"); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/cl_compat.c:176: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(&buf[i], pattern, s); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/cl_compat.c:277: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 buf[128]; data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/fosphor.c:138: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(self->fft_win, win, sizeof(float) * FOSPHOR_FFT_LEN); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl.c:156: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(dst, ptr, size); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl.c:174: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(ptr, src, size); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl.c:630:4: [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/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl_font.c:432: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 static_buf[128]; data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/main.c:387:18: [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). g_as->src_fh = fopen(argv[1], "rb"); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/resource.c:61: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 p[PATH_MAX]; data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/resource.c:65: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). fh = fopen(rc->name, "rb"); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/resource.c:80: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). fh = fopen(p, "rb"); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/resource_internal.h:56: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 extra[0]; /*< \brief Extra data for whatever ... */ data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/axis.c:162:3: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. sprintf(str, "0"); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl.c:74:10: [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(ext_name); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl_font.c:357:40: [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 = malloc(8 * sizeof(float) * 4 * strlen(str)); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl_font.c:388: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). for (i=0; i<4*strlen(str); i++) { data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl_font.c:405:31: [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). glDrawArrays(GL_QUADS, 0, 4*strlen(str)); data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/gl_font.c:412: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). for (i=0; i<4*strlen(str); i++) { data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/resource.c:74:7: [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(env) + strlen(rc->name) + 2) > PATH_MAX) data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/resource.c:74:21: [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(env) + strlen(rc->name) + 2) > PATH_MAX) data/gr-fosphor-3.8~2.2d4fe78/lib/fosphor/resource.c:162:38: [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 = sizeof(struct resource_cache) + strlen(name) + 1; ANALYSIS SUMMARY: Hits = 46 Lines analyzed = 7004 in approximately 0.22 seconds (32221 lines/second) Physical Source Lines of Code (SLOC) = 4221 Hits@level = [0] 29 [1] 9 [2] 26 [3] 2 [4] 9 [5] 0 Hits@level+ = [0+] 75 [1+] 46 [2+] 37 [3+] 11 [4+] 9 [5+] 0 Hits/KSLOC@level+ = [0+] 17.7683 [1+] 10.8979 [2+] 8.7657 [3+] 2.60602 [4+] 2.1322 [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.