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/sane-frontends-1.0.14/include/sane/sanei.h Examining data/sane-frontends-1.0.14/include/sane/sanei_codec_ascii.h Examining data/sane-frontends-1.0.14/include/sane/sanei_codec_bin.h Examining data/sane-frontends-1.0.14/include/sane/sanei_debug.h Examining data/sane-frontends-1.0.14/include/sane/sanei_wire.h Examining data/sane-frontends-1.0.14/include/getopt.h Examining data/sane-frontends-1.0.14/include/lalloca.h Examining data/sane-frontends-1.0.14/lib/alloca.c Examining data/sane-frontends-1.0.14/lib/getenv.c Examining data/sane-frontends-1.0.14/lib/getopt.c Examining data/sane-frontends-1.0.14/lib/getopt1.c Examining data/sane-frontends-1.0.14/lib/isfdtype.c Examining data/sane-frontends-1.0.14/lib/snprintf.c Examining data/sane-frontends-1.0.14/lib/strdup.c Examining data/sane-frontends-1.0.14/lib/strndup.c Examining data/sane-frontends-1.0.14/lib/strsep.c Examining data/sane-frontends-1.0.14/lib/usleep.c Examining data/sane-frontends-1.0.14/lib/vsyslog.c Examining data/sane-frontends-1.0.14/sanei/sanei_codec_ascii.c Examining data/sane-frontends-1.0.14/sanei/sanei_codec_bin.c Examining data/sane-frontends-1.0.14/sanei/sanei_init_debug.c Examining data/sane-frontends-1.0.14/sanei/sanei_load_values.c Examining data/sane-frontends-1.0.14/sanei/sanei_save_values.c Examining data/sane-frontends-1.0.14/sanei/sanei_thread.c Examining data/sane-frontends-1.0.14/sanei/sanei_wire.c Examining data/sane-frontends-1.0.14/src/gtkglue.h Examining data/sane-frontends-1.0.14/src/preferences.c Examining data/sane-frontends-1.0.14/src/preferences.h Examining data/sane-frontends-1.0.14/src/preview.c Examining data/sane-frontends-1.0.14/src/preview.h Examining data/sane-frontends-1.0.14/src/progress.c Examining data/sane-frontends-1.0.14/src/progress.h Examining data/sane-frontends-1.0.14/src/xscanimage-gimp-1_0-compat.h Examining data/sane-frontends-1.0.14/src/font_6x11.h Examining data/sane-frontends-1.0.14/src/xcam.c Examining data/sane-frontends-1.0.14/src/gtkglue.c Examining data/sane-frontends-1.0.14/src/scanadf.c Examining data/sane-frontends-1.0.14/src/xscanimage.c FINAL RESULTS: data/sane-frontends-1.0.14/include/sane/sanei_debug.h:131:25: [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. __attribute__ ((format (printf, 2, 3))) data/sane-frontends-1.0.14/include/sane/sanei_debug.h:146:74: [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. void DBG_LOCAL (int level, const char *msg, ...) __attribute__ ((format (printf, 2, 3))); data/sane-frontends-1.0.14/lib/snprintf.c:163:5: [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. int vsnprintf(char *str, size_t count, const char *fmt, va_list args) data/sane-frontends-1.0.14/lib/snprintf.c:176:5: [4] (format) snprintf: 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. int snprintf (char *str,size_t count,const char *fmt,...) data/sane-frontends-1.0.14/lib/snprintf.c:178:5: [4] (format) snprintf: 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. int snprintf (va_alist) va_dcl data/sane-frontends-1.0.14/lib/snprintf.c:192:12: [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. (void) vsnprintf ( str, count, fmt, ap); data/sane-frontends-1.0.14/lib/snprintf.c:439:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf( convert, fmtstr, value ); data/sane-frontends-1.0.14/lib/vsyslog.c:13: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, sizeof(buf), format, args); data/sane-frontends-1.0.14/sanei/sanei_init_debug.c:113:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (msg, "[%s] %s", be, fmt); data/sane-frontends-1.0.14/sanei/sanei_init_debug.c:121:11: [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, fmt, ap); data/sane-frontends-1.0.14/src/gtkglue.c:1255:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (msg, "Failed to obtain value of option %s: %s.", data/sane-frontends-1.0.14/src/gtkglue.c:1300:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (buf, "Failed to open device `%s': %s.", data/sane-frontends-1.0.14/src/scanadf.c:1199:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(env[4], "SCAN_FORMAT=%s", data/sane-frontends-1.0.14/src/scanadf.c:1217:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd, "%s '%s'", script, fname); data/sane-frontends-1.0.14/src/scanadf.c:1219:4: [4] (shell) execle: 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. execle(script, script, fname, NULL, environ); data/sane-frontends-1.0.14/src/scanadf.c:1249:7: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(fname, outfmt, start); data/sane-frontends-1.0.14/src/scanadf.c:1379:5: [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. printf (usage, prog_name); data/sane-frontends-1.0.14/src/scanadf.c:1465: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 (full_optstring, BASE_OPTSTRING); data/sane-frontends-1.0.14/src/scanadf.c:1466:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat (full_optstring, larg); data/sane-frontends-1.0.14/src/scanadf.c:1467:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat (full_optstring, targ); data/sane-frontends-1.0.14/src/scanadf.c:1468:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat (full_optstring, xarg); data/sane-frontends-1.0.14/src/scanadf.c:1469:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat (full_optstring, yarg); data/sane-frontends-1.0.14/src/xcam.c:274:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (buf, "%s %s %s", dev->vendor, dev->model, dev->type); data/sane-frontends-1.0.14/src/xcam.c:349: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 (fmttxt, txt); data/sane-frontends-1.0.14/src/xcam.c:350:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat (fmttxt, fmtstring); data/sane-frontends-1.0.14/src/xcam.c:1079:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (buf, "Error during read: %s.", data/sane-frontends-1.0.14/src/xcam.c:1187:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (buf, "Failed to start webcam: %s.", sane_strstatus (status)); data/sane-frontends-1.0.14/src/xcam.c:1197:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (buf, "Failed to get parameters: %s.", sane_strstatus (status)); data/sane-frontends-1.0.14/src/xcam.c:1507: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 (filename, OUTFILENAME); data/sane-frontends-1.0.14/src/xscanimage.c:1469:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (buf, "%s preview options", prog_name); data/sane-frontends-1.0.14/src/xscanimage.c:1735: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 (filename, OUTFILENAME); data/sane-frontends-1.0.14/include/getopt.h:102:12: [3] (buffer) getopt: 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. extern int getopt (int argc, char *const *argv, const char *shortopts); data/sane-frontends-1.0.14/include/getopt.h:104:12: [3] (buffer) getopt: 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. extern int getopt (); data/sane-frontends-1.0.14/include/getopt.h:106:12: [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. extern int getopt_long (int argc, char *const *argv, const char *shortopts, data/sane-frontends-1.0.14/include/getopt.h:118:12: [3] (buffer) getopt: 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. extern int getopt (); data/sane-frontends-1.0.14/include/getopt.h:119:12: [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. extern int getopt_long (); data/sane-frontends-1.0.14/lib/getenv.c:6:1: [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. getenv(const char *name) data/sane-frontends-1.0.14/lib/getopt.c:197:7: [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 *getenv (); data/sane-frontends-1.0.14/lib/getopt.c:328:21: [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. posixly_correct = getenv ("POSIXLY_CORRECT"); data/sane-frontends-1.0.14/lib/getopt.c:355:25: [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. nonoption_flags = getenv (var); data/sane-frontends-1.0.14/lib/getopt.c:748:1: [3] (buffer) getopt: 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. getopt (argc, argv, optstring) data/sane-frontends-1.0.14/lib/getopt.c:778:11: [3] (buffer) getopt: 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 (argc, argv, "abc:d:0123456789"); data/sane-frontends-1.0.14/lib/getopt1.c:51:7: [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 *getenv (); data/sane-frontends-1.0.14/lib/getopt1.c:59:1: [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. getopt_long (argc, argv, options, long_options, opt_index) data/sane-frontends-1.0.14/lib/getopt1.c:115:11: [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, "abc:d:0123456789", data/sane-frontends-1.0.14/sanei/sanei_init_debug.c:85: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. val = getenv (buf); data/sane-frontends-1.0.14/src/scanadf.c:1324:16: [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. while ((ch = getopt_long (argc, argv, "-" BASE_OPTSTRING, basic_options, data/sane-frontends-1.0.14/src/scanadf.c:1474:20: [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. while ((ch = getopt_long (argc, argv, full_optstring, all_options, data/sane-frontends-1.0.14/src/xcam.c:1581:20: [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. while ((ch = getopt_long (argc, argv, "hBV", long_options, 0)) != EOF) data/sane-frontends-1.0.14/src/xscanimage.c:2057:20: [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. while ((ch = getopt_long (argc, argv, "ghV", long_options, 0)) != EOF) data/sane-frontends-1.0.14/src/xscanimage.c:2101:25: [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 ((defdevname = getenv ("SANE_DEFAULT_DEVICE")) != NULL) data/sane-frontends-1.0.14/lib/alloca.c:143: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 align[ALIGN_SIZE]; /* To force sizeof(header). */ data/sane-frontends-1.0.14/lib/getopt.c:353:7: [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 var[100]; data/sane-frontends-1.0.14/lib/getopt.c:354:7: [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 (var, "_%d_GNU_nonoption_argv_flags_", getpid ()); data/sane-frontends-1.0.14/lib/snprintf.c:281:7: [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 b[2]; data/sane-frontends-1.0.14/lib/snprintf.c:360: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 convert[20]; data/sane-frontends-1.0.14/lib/snprintf.c:416: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 convert[128]; data/sane-frontends-1.0.14/lib/snprintf.c:417: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 fmtstr[128]; data/sane-frontends-1.0.14/lib/snprintf.c:431: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( fmtstr+strlen(fmtstr), "%d", len ); data/sane-frontends-1.0.14/lib/snprintf.c:434: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( fmtstr+strlen(fmtstr), ".%d", precision ); data/sane-frontends-1.0.14/lib/snprintf.c:499:10: [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 msgbuf[32]; /* holds "errno=%d". */ data/sane-frontends-1.0.14/lib/snprintf.c:501:10: [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. (void) sprintf (msgbuf, "errno=%d", err); data/sane-frontends-1.0.14/lib/snprintf.c:512: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 buffer[128]; data/sane-frontends-1.0.14/lib/strdup.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 (clone, s, size); data/sane-frontends-1.0.14/lib/vsyslog.c:12: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/sane-frontends-1.0.14/sanei/sanei_codec_ascii.c:283: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[16]; data/sane-frontends-1.0.14/sanei/sanei_codec_ascii.c:305:7: [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 (w->buffer.curr, buf + i + 1, sizeof (buf) - i - 1); data/sane-frontends-1.0.14/sanei/sanei_init_debug.c:71: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 ch, buf[256] = "SANE_DEBUG_"; data/sane-frontends-1.0.14/sanei/sanei_init_debug.c:90:10: [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). *var = atoi (val); data/sane-frontends-1.0.14/src/gtkglue.c:130:7: [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 + len, prog_name, extra); data/sane-frontends-1.0.14/src/gtkglue.c:146:7: [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 + len, prefix, extra); data/sane-frontends-1.0.14/src/gtkglue.c:189:7: [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 + len, postfix, extra); data/sane-frontends-1.0.14/src/gtkglue.c:209: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[256]; data/sane-frontends-1.0.14/src/gtkglue.c:343: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 (filename, filename + cwd_len, len - cwd_len + 1); data/sane-frontends-1.0.14/src/gtkglue.c:357: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[256]; data/sane-frontends-1.0.14/src/gtkglue.c:908: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, str[16], title[256]; data/sane-frontends-1.0.14/src/gtkglue.c:1088:5: [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", opt->constraint.word_list[j + 1]); data/sane-frontends-1.0.14/src/gtkglue.c:1094:8: [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", val); data/sane-frontends-1.0.14/src/gtkglue.c:1160:5: [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, "%g", data/sane-frontends-1.0.14/src/gtkglue.c:1165:8: [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, "%g", SANE_UNFIX (val)); data/sane-frontends-1.0.14/src/gtkglue.c:1253: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 msg[256]; data/sane-frontends-1.0.14/src/gtkglue.c:1295: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[256]; data/sane-frontends-1.0.14/src/gtkglue.c:1352: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 str[64]; data/sane-frontends-1.0.14/src/gtkglue.c:1390:8: [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", word); data/sane-frontends-1.0.14/src/gtkglue.c:1392:8: [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, "%g", SANE_UNFIX (word)); data/sane-frontends-1.0.14/src/preview.c:474:7: [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/sane-frontends-1.0.14/src/preview.c:502:7: [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/sane-frontends-1.0.14/src/preview.c:536: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[256]; data/sane-frontends-1.0.14/src/preview.c:861: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[256]; data/sane-frontends-1.0.14/src/preview.c:1003: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 filename[PATH_MAX]; data/sane-frontends-1.0.14/src/preview.c:1014:8: [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). in = fopen (filename, "r"); data/sane-frontends-1.0.14/src/preview.c:1506: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 filename[PATH_MAX]; data/sane-frontends-1.0.14/src/preview.c:1515: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). out = fopen (filename, "w"); data/sane-frontends-1.0.14/src/scanadf.c:655: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 (all_options + option_count, basic_options, sizeof (basic_options)); data/sane-frontends-1.0.14/src/scanadf.c:927: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). fp = fopen(fname, "wb"); data/sane-frontends-1.0.14/src/scanadf.c:1170: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. static char cmd[PATH_MAX * 2]; data/sane-frontends-1.0.14/src/scanadf.c:1171: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. static char env[6][PATH_MAX * 2]; data/sane-frontends-1.0.14/src/scanadf.c:1187:7: [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(env[0], "SCAN_RES=%d", res); data/sane-frontends-1.0.14/src/scanadf.c:1190:7: [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(env[1], "SCAN_WIDTH=%d", parm.pixels_per_line); data/sane-frontends-1.0.14/src/scanadf.c:1193:7: [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(env[2], "SCAN_HEIGHT=%d", parm.lines); data/sane-frontends-1.0.14/src/scanadf.c:1196:7: [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(env[3], "SCAN_FORMAT_ID=%d", (int) parm.format); data/sane-frontends-1.0.14/src/scanadf.c:1203:7: [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(env[5], "SCAN_DEPTH=%d", parm.depth); data/sane-frontends-1.0.14/src/scanadf.c:1362:23: [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). case 's': startNum = atoi(optarg); break; data/sane-frontends-1.0.14/src/scanadf.c:1363: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). case 'e': endNum = atoi(optarg); break; data/sane-frontends-1.0.14/src/xcam.c:85: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 device_settings_filename[1024] = "device.rc"; data/sane-frontends-1.0.14/src/xcam.c:130: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 picmsg_ps[50]; data/sane-frontends-1.0.14/src/xcam.c:257: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[512]; data/sane-frontends-1.0.14/src/xcam.c:309: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). fd = open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0666); data/sane-frontends-1.0.14/src/xcam.c:312:7: [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/sane-frontends-1.0.14/src/xcam.c:337: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 line[MSG_MAXLEN + 1]; data/sane-frontends-1.0.14/src/xcam.c:340: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 fmtstring[25] = " %Y-%m-%d %H:%M:%S"; data/sane-frontends-1.0.14/src/xcam.c:341: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 fmttxt[46]; data/sane-frontends-1.0.14/src/xcam.c:439: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 filename[PATH_MAX]; data/sane-frontends-1.0.14/src/xcam.c:445: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). fd = open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0666); data/sane-frontends-1.0.14/src/xcam.c:448:7: [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/sane-frontends-1.0.14/src/xcam.c:463: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 filename[PATH_MAX]; data/sane-frontends-1.0.14/src/xcam.c:468: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). fd = open (filename, O_RDONLY); data/sane-frontends-1.0.14/src/xcam.c:483: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[2 * PATH_MAX]; data/sane-frontends-1.0.14/src/xcam.c:489: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). fd = open (filename, O_RDONLY); data/sane-frontends-1.0.14/src/xcam.c:538: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 filename[PATH_MAX]; data/sane-frontends-1.0.14/src/xcam.c:636: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[PATH_MAX]; data/sane-frontends-1.0.14/src/xcam.c:754:45: [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. item = gtk_menu_item_new_with_label ((char *) device[i]->name); data/sane-frontends-1.0.14/src/xcam.c:1078: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. char buf[256]; data/sane-frontends-1.0.14/src/xcam.c:1123:4: [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 (win.picmsg_ps, "xcam "); data/sane-frontends-1.0.14/src/xcam.c:1175: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[256]; data/sane-frontends-1.0.14/src/xcam.c:1273: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[256]; data/sane-frontends-1.0.14/src/xcam.c:1274: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 testfilename[256]; data/sane-frontends-1.0.14/src/xcam.c:1307:17: [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). win.out = fopen (preferences.filename, "w"); data/sane-frontends-1.0.14/src/xcam.c:1378: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[256]; data/sane-frontends-1.0.14/src/xcam.c:1498: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 filename[1024]; data/sane-frontends-1.0.14/src/xscanimage.c:306: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 mpath[1024]; data/sane-frontends-1.0.14/src/xscanimage.c:307: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[1024]; data/sane-frontends-1.0.14/src/xscanimage.c:345:7: [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 (name, "xscanimage-"); data/sane-frontends-1.0.14/src/xscanimage.c:391: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 devname[1024]; data/sane-frontends-1.0.14/src/xscanimage.c:392: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 *args[2]; data/sane-frontends-1.0.14/src/xscanimage.c:548: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 filename[PATH_MAX]; data/sane-frontends-1.0.14/src/xscanimage.c:555: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). fd = open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0666); data/sane-frontends-1.0.14/src/xscanimage.c:558:7: [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/sane-frontends-1.0.14/src/xscanimage.c:573: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 filename[PATH_MAX]; data/sane-frontends-1.0.14/src/xscanimage.c:579: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). fd = open (filename, O_RDONLY); data/sane-frontends-1.0.14/src/xscanimage.c:714: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 tmp_buf[2]; data/sane-frontends-1.0.14/src/xscanimage.c:751:10: [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 buf[32768]; data/sane-frontends-1.0.14/src/xscanimage.c:1046: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[256]; data/sane-frontends-1.0.14/src/xscanimage.c:1279: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[256]; data/sane-frontends-1.0.14/src/xscanimage.c:1280: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 testfilename[256]; data/sane-frontends-1.0.14/src/xscanimage.c:1304:22: [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). scan_win.out = fopen (preferences.filename, "w"); data/sane-frontends-1.0.14/src/xscanimage.c:1427: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/sane-frontends-1.0.14/src/xscanimage.c:1465: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[64]; data/sane-frontends-1.0.14/src/xscanimage.c:1514: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 (buf, "%g", preferences.preview_gamma); data/sane-frontends-1.0.14/src/xscanimage.c:1548: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 filename[PATH_MAX]; data/sane-frontends-1.0.14/src/xscanimage.c:1554: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). fd = open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0666); data/sane-frontends-1.0.14/src/xscanimage.c:1557:7: [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/sane-frontends-1.0.14/src/xscanimage.c:1573: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 filename[PATH_MAX]; data/sane-frontends-1.0.14/src/xscanimage.c:1579: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). fd = open (filename, O_RDONLY); data/sane-frontends-1.0.14/src/xscanimage.c:1726: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 filename[1024]; data/sane-frontends-1.0.14/src/xscanimage.c:2011: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 filename[PATH_MAX]; data/sane-frontends-1.0.14/include/sane/sanei_wire.h:89:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). WireReadFunc read; data/sane-frontends-1.0.14/lib/getopt.c:221:12: [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). extern int strlen (const char *); data/sane-frontends-1.0.14/lib/getopt.c:359:24: [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). nonoption_flags_len = strlen (nonoption_flags); data/sane-frontends-1.0.14/lib/getopt.c:561:32: [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 (nameend - nextchar == strlen (p->name)) data/sane-frontends-1.0.14/lib/getopt.c:585: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). nextchar += strlen (nextchar); data/sane-frontends-1.0.14/lib/getopt.c:615:17: [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). nextchar += strlen (nextchar); data/sane-frontends-1.0.14/lib/getopt.c:631:17: [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). nextchar += strlen (nextchar); data/sane-frontends-1.0.14/lib/getopt.c:636: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). nextchar += strlen (nextchar); data/sane-frontends-1.0.14/lib/snprintf.c:171: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). return(strlen(str)); data/sane-frontends-1.0.14/lib/snprintf.c:194: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). return( strlen( str ) ); data/sane-frontends-1.0.14/lib/snprintf.c:318: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). int padlen, strlen, i, c; /* amount to pad */ data/sane-frontends-1.0.14/lib/snprintf.c:327:29: [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( strlen = 0; (c=value[strlen]); ++ strlen ){ data/sane-frontends-1.0.14/lib/snprintf.c:327: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). for( strlen = 0; (c=value[strlen]); ++ strlen ){ data/sane-frontends-1.0.14/lib/snprintf.c:329: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). ++strlen; data/sane-frontends-1.0.14/lib/snprintf.c:333:17: [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). padlen = len - strlen; data/sane-frontends-1.0.14/lib/snprintf.c:428:2: [1] (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 character. strcpy( fmtstr, "%" ); data/sane-frontends-1.0.14/lib/snprintf.c:429:14: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. if( ljust ) strcat(fmtstr, "-" ); data/sane-frontends-1.0.14/lib/snprintf.c:431: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). sprintf( fmtstr+strlen(fmtstr), "%d", len ); data/sane-frontends-1.0.14/lib/snprintf.c:434: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). sprintf( fmtstr+strlen(fmtstr), ".%d", precision ); data/sane-frontends-1.0.14/lib/snprintf.c:436:6: [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 = strlen( fmtstr ); data/sane-frontends-1.0.14/lib/strdup.c:32: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). size = strlen (s) + 1; data/sane-frontends-1.0.14/lib/strndup.c:34:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (clone, s, n); data/sane-frontends-1.0.14/lib/usleep.c:48:1: [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 (unsigned int useconds) data/sane-frontends-1.0.14/sanei/sanei_codec_bin.c:85: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 (*s) + 1; data/sane-frontends-1.0.14/sanei/sanei_init_debug.c:105: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). msg = (char *)malloc (sizeof(char) * (strlen(be) + strlen(fmt) + 4)); data/sane-frontends-1.0.14/sanei/sanei_init_debug.c:105:55: [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). msg = (char *)malloc (sizeof(char) * (strlen(be) + strlen(fmt) + 4)); data/sane-frontends-1.0.14/sanei/sanei_load_values.c:110:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w.io.read = read; data/sane-frontends-1.0.14/sanei/sanei_load_values.c:184:8: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buf, str, opt->size); data/sane-frontends-1.0.14/sanei/sanei_save_values.c:75:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w.io.read = read; data/sane-frontends-1.0.14/sanei/sanei_thread.c:310:2: [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( 1 ); data/sane-frontends-1.0.14/sanei/sanei_wire.c:125:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nread = (*w->io.read) (fd, w->buffer.end, data/sane-frontends-1.0.14/src/gtkglue.c:121: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/sane-frontends-1.0.14/src/gtkglue.c:125: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). extra = strlen (prog_name); data/sane-frontends-1.0.14/src/gtkglue.c:142: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). extra = strlen (prefix); data/sane-frontends-1.0.14/src/gtkglue.c:186: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). extra = strlen (postfix); data/sane-frontends-1.0.14/src/gtkglue.c:322:2: [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 (100000); data/sane-frontends-1.0.14/src/gtkglue.c:331:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (filename, data/sane-frontends-1.0.14/src/gtkglue.c:336: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). len = strlen (filename); data/sane-frontends-1.0.14/src/gtkglue.c:339:17: [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). cwd_len = strlen (cwd); data/sane-frontends-1.0.14/src/gtkglue.c:686:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buf, text, opt->size); data/sane-frontends-1.0.14/src/gtkglue.c:1011:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (title, opt->title, sizeof (title)); data/sane-frontends-1.0.14/src/preferences.c:139:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w.io.read = read; data/sane-frontends-1.0.14/src/preferences.c:161:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w.io.read = read; data/sane-frontends-1.0.14/src/scanadf.c:750: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). if (strncasecmp (optarg, "yes", strlen (optarg)) == 0) data/sane-frontends-1.0.14/src/scanadf.c:752: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). else if (strncasecmp (optarg, "no", strlen (optarg)) == 0) data/sane-frontends-1.0.14/src/scanadf.c:1455:27: [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). full_optstring = malloc (strlen (BASE_OPTSTRING) data/sane-frontends-1.0.14/src/scanadf.c:1456: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). + strlen (larg) + strlen (targ) data/sane-frontends-1.0.14/src/scanadf.c:1456:24: [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 (larg) + strlen (targ) data/sane-frontends-1.0.14/src/scanadf.c:1457: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). + strlen (xarg) + strlen (yarg) + 1); data/sane-frontends-1.0.14/src/scanadf.c:1457:24: [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 (xarg) + strlen (yarg) + 1); data/sane-frontends-1.0.14/src/scanadf.c:1576: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 (column + strlen (device_list[i]->name) + 1 >= 80) data/sane-frontends-1.0.14/src/scanadf.c:1587:18: [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). column += strlen (device_list[i]->name); data/sane-frontends-1.0.14/src/xcam.c:319:32: [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). write (fd, dialog->dev_name, strlen (dialog->dev_name)); data/sane-frontends-1.0.14/src/xcam.c:346: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 (txt) > (MSG_MAXLEN - 23)) data/sane-frontends-1.0.14/src/xcam.c:347:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (fmttxt, txt, (MSG_MAXLEN - 23)); data/sane-frontends-1.0.14/src/xcam.c:502:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read (fd, buf, sizeof (buf)); data/sane-frontends-1.0.14/src/xcam.c:519: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). lseek (fd, strlen (buf) + 1, SEEK_SET); data/sane-frontends-1.0.14/src/xcam.c:1289:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (testfilename, preferences.filename, sizeof (testfilename)); data/sane-frontends-1.0.14/src/xcam.c:1503:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (filename, preferences.filename, sizeof (filename)); data/sane-frontends-1.0.14/src/xscanimage.c:350:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (mpath, "<Toolbox>/File/Acquire/xscanimage/", sizeof (mpath)); data/sane-frontends-1.0.14/src/xscanimage.c:351: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). len = strlen (mpath); data/sane-frontends-1.0.14/src/xscanimage.c:603:2: [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 (100000); data/sane-frontends-1.0.14/src/xscanimage.c:1286:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (testfilename, preferences.filename, sizeof (testfilename)); data/sane-frontends-1.0.14/src/xscanimage.c:1731:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (filename, preferences.filename, sizeof (filename)); data/sane-frontends-1.0.14/src/xscanimage.c:2036:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (filename, STRINGIFY (PATH_SANE_DATA_DIR) "/sane-style.rc", ANALYSIS SUMMARY: Hits = 221 Lines analyzed = 17850 in approximately 0.47 seconds (37916 lines/second) Physical Source Lines of Code (SLOC) = 13485 Hits@level = [0] 195 [1] 65 [2] 105 [3] 20 [4] 31 [5] 0 Hits@level+ = [0+] 416 [1+] 221 [2+] 156 [3+] 51 [4+] 31 [5+] 0 Hits/KSLOC@level+ = [0+] 30.8491 [1+] 16.3886 [2+] 11.5684 [3+] 3.78198 [4+] 2.29885 [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.