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/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/config.h Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/effects.c Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/linux/console_splash.h Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/linux/fb.h Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/list.c Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/mng_splash.h Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/ttf.c Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/ttf.h Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/image.c Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/parse.c Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/cmd.c Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/userui_fbsplash_core.c Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/mng_callbacks.c Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/mng_render.c Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/render.c Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/splash.h Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/suspend_userui.h Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_skeleton.c Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/usplash/userui_usplash_core.c Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui.h Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c Examining data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_text.c FINAL RESULTS: data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:79:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(fn, PATH_DEV "/fb/%d", fb_num); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:83:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(fn, PATH_DEV "/fb%d", fb_num); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:89:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(sys, PATH_SYS "/class/graphics/fb%d/dev", fb_num); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:231:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(dev, PATH_DEV "/fb%d", arg_fb); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:233:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(dev, PATH_DEV "/fb/%d", arg_fb); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:249:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(dev, PATH_DEV "/tty%d", tty); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:251:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(dev, PATH_DEV "/vc/%d", tty); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/mng_splash.h:49: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, s, ap); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/render.c:273:3: [4] (shell) execlp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execlp("sh", "sh", "-c", prg, NULL); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/render.c:313:3: [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(ret, txt); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/render.c:331:4: [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(d, progress_text); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/render.c:340: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(d, p); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/splash.h:42:27: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define printerr(args...) fprintf(stderr, ## args); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/splash.h:43:28: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define printwarn(args...) fprintf(stderr, ## args); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:43:26: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define bail_err(x) do { fprintf(stderr, x": %s\n", strerror(errno)); fflush(stderr); abort(); } while (0) data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:44:25: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define bail(x...) do { fprintf(stderr, ## x); fflush(stderr); abort(); } while (0) data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:196:8: [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. len = vsnprintf(buf, sizeof(buf), msg, args); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:228:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(message, "%s messages %s", descriptions[bit], data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_text.c:177: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, 1024, fmt, va); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/parse.c:257:15: [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. char *data = getenv(list); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:432:7: [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. c = getopt_long(argc, argv, optstring, longopts, &optindex); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/cmd.c:98:3: [2] (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). Risk is low because the source is a constant string. strcpy(vc_cfg.theme, "<none>"); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:73: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 fn[32]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:76: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 sys[128]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:80:7: [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). fb = open(fn, O_WRONLY, 0); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:84:8: [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). fb = open(fn, O_WRONLY, 0); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:91:8: [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). fb = open(fn, O_WRONLY, 0); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:152: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[512]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:163: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[512]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:228: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 dev[32]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:232:11: [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 ((c = open(dev, O_RDWR)) == -1) { data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:234:12: [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 ((c = open(dev, O_RDWR)) == -1) { data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:246: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 dev[32]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:250:11: [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 ((c = open(dev, O_RDWR)) == -1) { data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/common.c:252:12: [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 ((c = open(dev, O_RDWR)) == -1) { data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/effects.c:34: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(to, src + i*y, i); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/image.c:92: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). fp = fopen(filename,"r"); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/image.c:230:11: [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 header[8]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/image.c:231:13: [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 *fp = fopen(filename,"r"); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/image.c:255:16: [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 ((injpeg = fopen(filename,"r")) == NULL) { data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/linux/fb.h:152: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 id[16]; /* identification string eg "TT Builtin" */ data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/mng_callbacks.c:55:33: [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 (mng->data == NULL || !mng->open) data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/mng_callbacks.c:63: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, src_buf, len); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/mng_render.c:27:12: [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(filename, O_RDONLY)) < 0) { data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/mng_splash.h:12:16: [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). int len, ptr, open; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/parse.c:181: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[512]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/parse.c:182: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 buf2[512]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/parse.c:948: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[1024]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/parse.c:952:13: [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 ((cfg = fopen(cfgfile,"r")) == NULL) { data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/render.c:356: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(t, s, j); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/splash.h:220:7: [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). fd = open(dev, O_RDWR); \ data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/ttf.c:94:25: [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. ch = ((const unsigned char *)utf8)[i]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/ttf.c:387: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(dst, src, sizeof(*dst)); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/ttf.c:437: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(dst->buffer+doffset, data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/userui_fbsplash_core.c:32: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 rendermessage[512]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/userui_fbsplash_core.c:56: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((void*)silent_img.data, base_image, base_image_size); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/userui_fbsplash_core.c:113:16: [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). fbsplash_fd = open(SPLASH_DEV, O_WRONLY); /* Don't worry if it fails */ data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/userui_fbsplash_core.c:132: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(base_image, (void*)silent_img.data, base_image_size); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/userui_fbsplash_core.c:201:4: [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(frame_buffer + y * fb_fix.line_length, data/tuxonice-userui-1.1+dfsg1.gc3bdd83/suspend_userui.h:43: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 text[255]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui.h:54: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 software_suspend_version[32]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui.h:147: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 lastheader[512]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:61: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 lastheader[512]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.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 software_suspend_version[32]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:121: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). if ((printk_f = fopen("/proc/sys/kernel/printk", "r+")) == NULL) data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:191: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[256]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:216: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 message[80]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:235: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 message[80]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:250:4: [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(message, "Would suspend to ram but rebooting is enabled."); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:252:4: [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(message, "Suspend to ram on completion."); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:256:4: [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(message, "Would power off but rebooting is enabled."); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:258:4: [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(message, "Power off on completion."); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:421: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(o1, o2, sizeof(*o1)); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:425: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(o1, o2, sizeof(*o1)); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:444: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). suspend_vt = atoi(optarg); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:517:12: [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 *f = fopen("/sys/power/tuxonice/version", "r"); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:521: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(software_suspend_version, "UnknownX", 9); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:527:6: [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). f = fopen("/sys/power/tuxonice/user_interface/enable_escape", "r"); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:567:12: [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("/proc/self/statm", "r"))) data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:619:23: [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). || (console_fd = open("/dev/console", O_RDWR)) == -1; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:685: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 unsigned char ascii_to_raw[sizeof(raw_to_ascii)]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:761:20: [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 ((console_fd = open("/dev/console", O_RDWR)) == -1) data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:793: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(&termios_backup, &t, sizeof(t)); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:852: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. static char local_buf[4096]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:929: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. static char buf1[4096], buf2[4096]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:939:4: [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(&buf1, &buf2, 4096); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:1034: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[128]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_text.c:76: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[200]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_text.c:174: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[1024]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_text.c:336:13: [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). vcsa_fd = open("/dev/vcsa0", O_RDONLY); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/usplash/userui_usplash_core.c:57: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[1024]; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/usplash/userui_usplash_core.c:60:9: [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). f = fopen("/etc/usplash.conf", "r"); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/usplash/userui_usplash_core.c:120: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). userui_usplash_xres = atoi(varvalue); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/usplash/userui_usplash_core.c:122: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). userui_usplash_yres = atoi(varvalue); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/effects.c:68:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(7500); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/mng_render.c:49:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fd, file_data, amt); /* read up to 64KB at a time */ data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/parse.c:258: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(svc); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/parse.c:961: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). len = strlen(buf); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/parse.c:977:34: [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(opts[i].name, t, strlen(opts[i].name))) { data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/parse.c:979: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). t += strlen(opts[i].name); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/render.c:281:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i = read(pfds[0], buf, 1024); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/render.c:298:8: [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(txt); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/render.c:301:28: [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). subst_len = progress_text?strlen(progress_text):0; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/render.c:321:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(d, p, t - p); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/ttf.c:152: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). unicode_len = strlen(text); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/userui_fbsplash_core.c:57:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(rendermessage, lastheader, 512); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/fbsplash/userui_fbsplash_core.c:222:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(lastheader, msg, 512); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:400:11: [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(userui_ops[i]->optstring); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:524: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). software_suspend_version[strlen(software_suspend_version)-1] = '\0'; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:706:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(STDIN_FILENO, &b, 1) <= 0) data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:716:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(STDIN_FILENO, &a, 1) <= 0) data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:1025:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(200*1000); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:1029:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(200*1000); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:1042:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(800*1000); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:1048:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(800*1000); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:1051:4: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(10*1000); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_core.c:1060:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(400*1000); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_text.c:64:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(vcsa_fd, &screen, sizeof(screen)) == -1) data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_text.c:85: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). move_cursor_to(video_num_columns - strlen(buf), video_num_lines); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_text.c:104:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(lastheader, msg, 512); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_text.c:135: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). move_cursor_to((video_num_columns - strlen(lastheader)) / 2, y); data/tuxonice-userui-1.1+dfsg1.gc3bdd83/userui_text.c:234:22: [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 msg_len = msg ? strlen(msg) : 0; data/tuxonice-userui-1.1+dfsg1.gc3bdd83/usplash/userui_usplash_core.c:187:20: [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). draw_text(msg, strlen(msg)); ANALYSIS SUMMARY: Hits = 123 Lines analyzed = 7776 in approximately 0.20 seconds (39570 lines/second) Physical Source Lines of Code (SLOC) = 5788 Hits@level = [0] 90 [1] 29 [2] 73 [3] 2 [4] 19 [5] 0 Hits@level+ = [0+] 213 [1+] 123 [2+] 94 [3+] 21 [4+] 19 [5+] 0 Hits/KSLOC@level+ = [0+] 36.8003 [1+] 21.2509 [2+] 16.2405 [3+] 3.6282 [4+] 3.28265 [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.