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-airscan-0.99.20/airscan-array.c Examining data/sane-airscan-0.99.20/airscan-bmp.c Examining data/sane-airscan-0.99.20/airscan-conf.c Examining data/sane-airscan-0.99.20/airscan-devcaps.c Examining data/sane-airscan-0.99.20/airscan-device.c Examining data/sane-airscan-0.99.20/airscan-devid.c Examining data/sane-airscan-0.99.20/airscan-devops.c Examining data/sane-airscan-0.99.20/airscan-eloop.c Examining data/sane-airscan-0.99.20/airscan-escl.c Examining data/sane-airscan-0.99.20/airscan-filter.c Examining data/sane-airscan-0.99.20/airscan-http.c Examining data/sane-airscan-0.99.20/airscan-id.c Examining data/sane-airscan-0.99.20/airscan-inifile.c Examining data/sane-airscan-0.99.20/airscan-init.c Examining data/sane-airscan-0.99.20/airscan-ip.c Examining data/sane-airscan-0.99.20/airscan-jpeg.c Examining data/sane-airscan-0.99.20/airscan-log.c Examining data/sane-airscan-0.99.20/airscan-math.c Examining data/sane-airscan-0.99.20/airscan-mdns.c Examining data/sane-airscan-0.99.20/airscan-memstr.c Examining data/sane-airscan-0.99.20/airscan-netif.c Examining data/sane-airscan-0.99.20/airscan-os.c Examining data/sane-airscan-0.99.20/airscan-png.c Examining data/sane-airscan-0.99.20/airscan-pollable.c Examining data/sane-airscan-0.99.20/airscan-rand.c Examining data/sane-airscan-0.99.20/airscan-trace.c Examining data/sane-airscan-0.99.20/airscan-uuid.c Examining data/sane-airscan-0.99.20/airscan-wsd.c Examining data/sane-airscan-0.99.20/airscan-wsdd.c Examining data/sane-airscan-0.99.20/airscan-xml.c Examining data/sane-airscan-0.99.20/airscan-zeroconf.c Examining data/sane-airscan-0.99.20/airscan.c Examining data/sane-airscan-0.99.20/airscan.h Examining data/sane-airscan-0.99.20/discover.c Examining data/sane-airscan-0.99.20/fuzzer/query.cc Examining data/sane-airscan-0.99.20/fuzzer/uri.cc Examining data/sane-airscan-0.99.20/fuzzer/xml.cc Examining data/sane-airscan-0.99.20/http_parser.c Examining data/sane-airscan-0.99.20/http_parser.h Examining data/sane-airscan-0.99.20/sane_strstatus.c Examining data/sane-airscan-0.99.20/test-decode.c Examining data/sane-airscan-0.99.20/test-multipart.c Examining data/sane-airscan-0.99.20/test-uri.c Examining data/sane-airscan-0.99.20/test-zeroconf.c Examining data/sane-airscan-0.99.20/test.c FINAL RESULTS: data/sane-airscan-0.99.20/airscan-os.c:78:10: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. rc = readlink("/proc/self/exe", os_progname_buf, sizeof(os_progname_buf)); data/sane-airscan-0.99.20/airscan-conf.c:115: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. vsnprintf(buf, sizeof(buf), format, ap); data/sane-airscan-0.99.20/airscan-devops.c:717:9: [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(value, id_colormode_sane_name(opt->colormode_emul)); data/sane-airscan-0.99.20/airscan-devops.c:721:9: [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(value, id_source_sane_name(opt->src)); data/sane-airscan-0.99.20/airscan-eloop.c:554: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. vsnprintf(buf, sizeof(buf), fmt, ap); data/sane-airscan-0.99.20/airscan-eloop.c:555: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(eloop_estring, buf); data/sane-airscan-0.99.20/airscan-http.c:409:9: [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(s + prefix_len, str); data/sane-airscan-0.99.20/airscan-http.c:1602:9: [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(s + 2, boundary); data/sane-airscan-0.99.20/airscan-http.c:2374:9: [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(old_uri_str, uri->str); data/sane-airscan-0.99.20/airscan-http.c:2882:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "%s/%s", conf.socket_dir, host); data/sane-airscan-0.99.20/airscan-log.c:173:22: [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. required_bytes = vsnprintf(msg + len, sizeof(msg) - len, fmt, ap); data/sane-airscan-0.99.20/airscan-mdns.c:99: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. vsnprintf(message, sizeof(message) - n, fmt, ap); data/sane-airscan-0.99.20/airscan-memstr.c:240:11: [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), format, ap2); data/sane-airscan-0.99.20/airscan-memstr.c:251: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. vsnprintf(s + oldlen, len + 1, format, ap2); data/sane-airscan-0.99.20/airscan-os.c:43:9: [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(os_homedir_buf, s); data/sane-airscan-0.99.20/airscan-os.c:54:9: [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(os_homedir_buf, result->pw_dir); data/sane-airscan-0.99.20/airscan-os.c:128: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(p, path); data/sane-airscan-0.99.20/airscan-trace.c:92: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(path, conf.dbg_trace); data/sane-airscan-0.99.20/airscan-trace.c:99:5: [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(path, trace_program); data/sane-airscan-0.99.20/airscan-trace.c:101:5: [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(path, device_name); data/sane-airscan-0.99.20/airscan-trace.c:200:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(hdr.name, "%8.8d.%s", t->index ++, ext); data/sane-airscan-0.99.20/airscan-trace.c:346:9: [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(t->log, fmt, ap); data/sane-airscan-0.99.20/airscan-wsd.c:882: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(job_id, ctx->location); data/sane-airscan-0.99.20/airscan-wsd.c:1086: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(job_id, ctx->location); data/sane-airscan-0.99.20/airscan-wsdd.c:679:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(wsdd_buf, wsdd_get_metadata_template, u.text, wsdd->address); data/sane-airscan-0.99.20/airscan-wsdd.c:1083:25: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. int n = sprintf(wsdd_buf, wsdd_probe_template, u.text); data/sane-airscan-0.99.20/airscan-wsdd.c:1394:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(uri_buf, "http://%s", straddr.text); data/sane-airscan-0.99.20/airscan-wsdd.c:1396:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(uri_buf, "http://[%s]", straddr.text); data/sane-airscan-0.99.20/airscan-wsdd.c:1402:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(uri_buf, "http://[%s%%25%d]", straddr.text, ifindex); data/sane-airscan-0.99.20/airscan-wsdd.c:1405:5: [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(uri_buf, WSDD_STABLE_ENDPOINT); data/sane-airscan-0.99.20/airscan-wsdd.c:1411:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(wsdd_buf, wsdd_probe_template, u.text); data/sane-airscan-0.99.20/airscan.c:178:9: [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(vbuf, *((SANE_Word*) value) ? "true" : "false"); data/sane-airscan-0.99.20/discover.c:49:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(format, ap); data/sane-airscan-0.99.20/test-decode.c:35:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(format, ap); data/sane-airscan-0.99.20/test-multipart.c:23:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(format, ap); data/sane-airscan-0.99.20/test-uri.c:17:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(fmt, ap); data/sane-airscan-0.99.20/test-zeroconf.c:30:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(format, ap); data/sane-airscan-0.99.20/test-zeroconf.c:600:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(title, "=== %s ===", file); data/sane-airscan-0.99.20/airscan-conf.c:291:11: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. env = getenv(CONFIG_ENV_AIRSCAN_DEBUG); data/sane-airscan-0.99.20/airscan-conf.c:327: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. s = getenv(CONFIG_PATH_ENV); data/sane-airscan-0.99.20/airscan-os.c:37:24: [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. const char *s = getenv("HOME"); data/sane-airscan-0.99.20/airscan-bmp.c:48: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 error[256]; /* Error message buffer */ data/sane-airscan-0.99.20/airscan-bmp.c:81: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(&file_header, data, sizeof(BITMAPFILEHEADER)); data/sane-airscan-0.99.20/airscan-bmp.c:82: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(&bmp->info_header, ((char*) data) + sizeof(BITMAPFILEHEADER), data/sane-airscan-0.99.20/airscan-bmp.c:107:9: [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(bmp->error, "BMP: invalid header size %d", data/sane-airscan-0.99.20/airscan-bmp.c:113:9: [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(bmp->error, "BMP: compression %d not supported", data/sane-airscan-0.99.20/airscan-bmp.c:134:9: [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(bmp->error, "BMP: %d bits per pixel not supported", data/sane-airscan-0.99.20/airscan-bmp.c:243: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(out, row_data, wid); data/sane-airscan-0.99.20/airscan-conf.c:111: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 buf[1024]; data/sane-airscan-0.99.20/airscan-devcaps.c:192:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char xbuf[64], ybuf[64]; data/sane-airscan-0.99.20/airscan-device.c:653:17: [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(new_uri_str, real_uri_str, l); data/sane-airscan-0.99.20/airscan-device.c:1044: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 buf[64]; data/sane-airscan-0.99.20/airscan-device.c:1823:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data, dev->read_line_buf + dev->read_skip_bytes + data/sane-airscan-0.99.20/airscan-eloop.c:28:17: [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 __thread char eloop_estring[256]; data/sane-airscan-0.99.20/airscan-eloop.c:551: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 buf[sizeof(eloop_estring)]; data/sane-airscan-0.99.20/airscan-http.c:158:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, field.str, field.len); data/sane-airscan-0.99.20/airscan-http.c:178: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(s, field.str, field.len); data/sane-airscan-0.99.20/airscan-http.c:361:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(host, field.str, field.len); data/sane-airscan-0.99.20/airscan-http.c:408: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(s, prefix, prefix_len); data/sane-airscan-0.99.20/airscan-http.c:496: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(host, field.str, field.len); data/sane-airscan-0.99.20/airscan-http.c:504: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(port, field.str, field.len); data/sane-airscan-0.99.20/airscan-http.c:606: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(host + 1, field.str, field.len); data/sane-airscan-0.99.20/airscan-http.c:955:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(host, field.str, field.len); data/sane-airscan-0.99.20/airscan-http.c:958: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(host + field.len, "%%25%d", ifindex); data/sane-airscan-0.99.20/airscan-http.c:1008: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(path2, path, len); data/sane-airscan-0.99.20/airscan-http.c:1785: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((char*) data->bytes + data->size, bytes, size); data/sane-airscan-0.99.20/airscan-http.c:2140:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, host, len); data/sane-airscan-0.99.20/airscan-http.c:2605:16: [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 io_buf[HTTP_IOBUF_SIZE]; data/sane-airscan-0.99.20/airscan-http.c:2849:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(host, field.str, field.len); data/sane-airscan-0.99.20/airscan-http.c:2857: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(port, field.str, field.len); data/sane-airscan-0.99.20/airscan-http.c:2917:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[64]; data/sane-airscan-0.99.20/airscan-http.c:2918:9: [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, "%zd", q->request_data->size); data/sane-airscan-0.99.20/airscan-inifile.c:22:10: [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(name, "r"); data/sane-airscan-0.99.20/airscan-ip.c:65:13: [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(straddr.text + strlen(straddr.text), "%%%d", data/sane-airscan-0.99.20/airscan-ip.c:79:9: [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(straddr.text + strlen(straddr.text), ":%d", port); data/sane-airscan-0.99.20/airscan-ip.c:361: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(addrs, set->addrs, sizeof(ip_addr) * len); data/sane-airscan-0.99.20/airscan-jpeg.c:22: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 errbuf[ /* Error buffer */ data/sane-airscan-0.99.20/airscan-jpeg.c:182: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(jpeg->errbuf, "JPEG: ", 6); data/sane-airscan-0.99.20/airscan-log.c:156: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 msg[4096]; data/sane-airscan-0.99.20/airscan-log.c:169:16: [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. len += sprintf(msg, "%.64s: ", log->name); data/sane-airscan-0.99.20/airscan-log.c:209:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char prefix[64]; data/sane-airscan-0.99.20/airscan-math.c:158:9: [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, "%d.%2.2d", (int) integer, (int) round(fraction * 100)); data/sane-airscan-0.99.20/airscan-math.c:160:9: [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, "%d", (int) integer); data/sane-airscan-0.99.20/airscan-mdns.c:88: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 prefix[128], message[1024]; data/sane-airscan-0.99.20/airscan-mdns.c:169:12: [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[64]; data/sane-airscan-0.99.20/airscan-mdns.c:177: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(buf, "AVAHI_RESOLVER_UNKNOWN(%d)", e); data/sane-airscan-0.99.20/airscan-mdns.c:186:12: [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[64]; data/sane-airscan-0.99.20/airscan-mdns.c:197: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(buf, "AVAHI_BROWSER_UNKNOWN(%d)", e); data/sane-airscan-0.99.20/airscan-mdns.c:206:12: [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[64]; data/sane-airscan-0.99.20/airscan-mdns.c:217: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(buf, "AVAHI_BROWSER_UNKNOWN(%d)", s); data/sane-airscan-0.99.20/airscan-mdns.c:371: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 str_addr[128]; data/sane-airscan-0.99.20/airscan-mdns.c:398:20: [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. len += sprintf(str_addr + len, "%%25%d", interface); data/sane-airscan-0.99.20/airscan-memstr.c:235: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 buf[4096]; data/sane-airscan-0.99.20/airscan-os.c:27: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 os_homedir_buf[PATH_MAX]; data/sane-airscan-0.99.20/airscan-os.c:30: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 os_progname_buf[PATH_MAX]; data/sane-airscan-0.99.20/airscan-os.c:39: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 buf[16384]; data/sane-airscan-0.99.20/airscan-png.c:23: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 error[1024]; /* Error message buffer */ data/sane-airscan-0.99.20/airscan-png.c:90: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(data, png->image_data, size); data/sane-airscan-0.99.20/airscan-rand.c:35:15: [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). rand_fp = fopen(RAND_SOURCE, "rb"); data/sane-airscan-0.99.20/airscan-trace.c:28: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 name[100]; data/sane-airscan-0.99.20/airscan-trace.c:29: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 mode[8]; data/sane-airscan-0.99.20/airscan-trace.c:30: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 uid[8]; data/sane-airscan-0.99.20/airscan-trace.c:31: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 gid[8]; data/sane-airscan-0.99.20/airscan-trace.c:32: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 size[12]; data/sane-airscan-0.99.20/airscan-trace.c:33: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 mtime[12]; data/sane-airscan-0.99.20/airscan-trace.c:34: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 checksum[8]; data/sane-airscan-0.99.20/airscan-trace.c:35: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 typeflag[1]; data/sane-airscan-0.99.20/airscan-trace.c:36: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 linkname[100]; data/sane-airscan-0.99.20/airscan-trace.c:37: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 magic[6]; data/sane-airscan-0.99.20/airscan-trace.c:38:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char version[2]; data/sane-airscan-0.99.20/airscan-trace.c:39: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 uname[32]; data/sane-airscan-0.99.20/airscan-trace.c:40: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 gname[32]; data/sane-airscan-0.99.20/airscan-trace.c:41: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 devmajor[8]; data/sane-airscan-0.99.20/airscan-trace.c:42: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 devminor[8]; data/sane-airscan-0.99.20/airscan-trace.c:43: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 prefix[155]; data/sane-airscan-0.99.20/airscan-trace.c:44: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 pad[12]; data/sane-airscan-0.99.20/airscan-trace.c:53: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 const char trace_zero_block[512]; data/sane-airscan-0.99.20/airscan-trace.c:81:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; data/sane-airscan-0.99.20/airscan-trace.c:112:5: [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(path + len, ".log"); data/sane-airscan-0.99.20/airscan-trace.c:113:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). t->log = fopen(path, "w"); data/sane-airscan-0.99.20/airscan-trace.c:115:5: [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(path + len, ".tar"); data/sane-airscan-0.99.20/airscan-trace.c:116:15: [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). t->data = fopen(path, "wb"); data/sane-airscan-0.99.20/airscan-trace.c:203:5: [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(hdr.mode, "644"); data/sane-airscan-0.99.20/airscan-trace.c:206: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(hdr.size, "%lo", (unsigned long) data->size); data/sane-airscan-0.99.20/airscan-trace.c:207: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(hdr.mtime, "%llo", (long long) time(NULL)); data/sane-airscan-0.99.20/airscan-trace.c:209:5: [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(hdr.magic, "ustar"); data/sane-airscan-0.99.20/airscan-trace.c:210: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(hdr.version, "00", 2); data/sane-airscan-0.99.20/airscan-trace.c:219: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(hdr.checksum, "%6.6o", chsum & 0777777); data/sane-airscan-0.99.20/airscan-uuid.c:33: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(u.text, data/sane-airscan-0.99.20/airscan-wsd.c:70: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 fault_code[64]; data/sane-airscan-0.99.20/airscan-wsd.c:966: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 scanner_state[64] = {0}; data/sane-airscan-0.99.20/airscan-wsdd.c:118: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 wsdd_buf[65536]; data/sane-airscan-0.99.20/airscan-wsdd.c:1354: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 ifname[IF_NAMESIZE] = "?"; data/sane-airscan-0.99.20/airscan-wsdd.c:1356: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 uri_buf[1024]; data/sane-airscan-0.99.20/airscan-wsdd.c:1557: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 suffix[32] = ""; data/sane-airscan-0.99.20/airscan-wsdd.c:1561:13: [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(suffix, "%%%d", list->ifindex); data/sane-airscan-0.99.20/airscan-xml.c:679: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 buf[64]; data/sane-airscan-0.99.20/airscan-xml.c:680: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(buf, "%u", value); data/sane-airscan-0.99.20/airscan-zeroconf.c:783: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 ifname[IF_NAMESIZE]; data/sane-airscan-0.99.20/airscan-zeroconf.c:837: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 ifname[IF_NAMESIZE] = "?"; data/sane-airscan-0.99.20/airscan-zeroconf.c:996:9: [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(buf, " none"); data/sane-airscan-0.99.20/airscan-zeroconf.c:1006: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 can[64]; data/sane-airscan-0.99.20/airscan-zeroconf.c:1007: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 use[64]; data/sane-airscan-0.99.20/airscan-zeroconf.c:1188:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, ident, buf_size); data/sane-airscan-0.99.20/airscan.c:157: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 vbuf[128]; data/sane-airscan-0.99.20/airscan.c:158: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 ibuf[128] = ""; data/sane-airscan-0.99.20/airscan.c:182:9: [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(vbuf, "%d", *((SANE_Word*) value)); data/sane-airscan-0.99.20/airscan.c:186:9: [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(vbuf, "%g", SANE_UNFIX(*((SANE_Fixed*) value))); data/sane-airscan-0.99.20/airscan.c:201:9: [2] (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 string. strcat(ibuf, " info: "); data/sane-airscan-0.99.20/airscan.c:204:13: [2] (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 string. strcat(ibuf, "inexact"); data/sane-airscan-0.99.20/airscan.c:207:17: [2] (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 string. strcat(ibuf, ", "); data/sane-airscan-0.99.20/airscan.c:212:13: [2] (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 string. strcat(ibuf, "reload:"); data/sane-airscan-0.99.20/airscan.c:215:17: [2] (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 string. strcat(ibuf, " options"); data/sane-airscan-0.99.20/airscan.c:219:17: [2] (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 string. strcat(ibuf, " params"); data/sane-airscan-0.99.20/airscan.h:349: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(s, s1, len + 1); data/sane-airscan-0.99.20/airscan.h:402: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(s1 + l1, s2, l2); data/sane-airscan-0.99.20/airscan.h:794: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 text[sizeof("urn:uuid:ede05377-460e-4b4a-a5c0-423f9e02e8fa")]; data/sane-airscan-0.99.20/airscan.h:965: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 text[109]; data/sane-airscan-0.99.20/airscan.h:1032: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(&ip_addr.ip.v4, addr, 4); data/sane-airscan-0.99.20/airscan.h:1036: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(&ip_addr.ip, addr, 16); data/sane-airscan-0.99.20/airscan.h:1166: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 text[32]; data/sane-airscan-0.99.20/airscan.h:1178: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 straddr[64]; /* Address string */ data/sane-airscan-0.99.20/http_parser.c:189: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 const char tokens[256] = { data/sane-airscan-0.99.20/sane_strstatus.c:54: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[80]; data/sane-airscan-0.99.20/sane_strstatus.c:106: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 (buf, "Unknown SANE status code %d", status); data/sane-airscan-0.99.20/test-decode.c:72: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). save->fp = fopen(name, "wb"); data/sane-airscan-0.99.20/test-decode.c:168:10: [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(file, "rb"); data/sane-airscan-0.99.20/test-multipart.c:54:10: [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(file, "rb"); data/sane-airscan-0.99.20/test-multipart.c:102:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[64]; data/sane-airscan-0.99.20/test-multipart.c:105:13: [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(name, "%8.8d.part", i); data/sane-airscan-0.99.20/test-multipart.c:108: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). fp = fopen(name, "wb"); data/sane-airscan-0.99.20/test-zeroconf.c:590: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 title[1024]; data/sane-airscan-0.99.20/airscan-array.c:87: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). size_t len = strlen(*a); data/sane-airscan-0.99.20/airscan-device.c:646: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). const char *tail = uri_str + strlen(base_str); data/sane-airscan-0.99.20/airscan-device.c:649:30: [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_t l = strlen(real_uri_str) - strlen(tail); data/sane-airscan-0.99.20/airscan-device.c:649:53: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t l = strlen(real_uri_str) - strlen(tail); data/sane-airscan-0.99.20/airscan-device.c:1345:9: [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((useconds_t) pause_us); data/sane-airscan-0.99.20/airscan-eloop.c:197:9: [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(usec); data/sane-airscan-0.99.20/airscan-http.c:106: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). http_uri_field field = {str, strlen(str)}; data/sane-airscan-0.99.20/airscan-http.c:221: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). char *buf = alloca(strlen(uri->str) + len + 4); data/sane-airscan-0.99.20/airscan-http.c:284:48: [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). http_uri_field_replace_len (uri, num, val, strlen(val)); data/sane-airscan-0.99.20/airscan-http.c:406: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). prefix_len = strlen(prefix); data/sane-airscan-0.99.20/airscan-http.c:407:33: [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). s = alloca(prefix_len + strlen(str) + 1); data/sane-airscan-0.99.20/airscan-http.c:416:43: [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 (http_parser_parse_url(normalized, strlen(normalized), data/sane-airscan-0.99.20/airscan-http.c:475: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). memmove(zone + 1, zone + 3, strlen(zone + 3) + 1); data/sane-airscan-0.99.20/airscan-http.c:644: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). size_t pfx_len = strlen(pfx); data/sane-airscan-0.99.20/airscan-http.c:656: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). size_t plen = strlen(pattern); data/sane-airscan-0.99.20/airscan-http.c:759: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). char *buf = alloca(strlen(base->str) + strlen(path) + 1); data/sane-airscan-0.99.20/airscan-http.c:759:54: [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). char *buf = alloca(strlen(base->str) + strlen(path) + 1); data/sane-airscan-0.99.20/airscan-http.c:1006: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). size_t len = strlen(path); data/sane-airscan-0.99.20/airscan-http.c:1597: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). boundary_len = strlen(boundary) + 2; data/sane-airscan-0.99.20/airscan-http.c:2137:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = end ? (size_t) (end - host) : strlen(host); data/sane-airscan-0.99.20/airscan-http.c:2156:25: [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_t len = body ? strlen(body) : 0; data/sane-airscan-0.99.20/airscan-http.c:2372: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). char *old_uri_str = alloca(strlen(uri->str) + 1); data/sane-airscan-0.99.20/airscan-http.c:2880:26: [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_t pathlen = strlen(conf.socket_dir) + 1 /* for / */ + strlen(host); data/sane-airscan-0.99.20/airscan-http.c:2880:68: [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_t pathlen = strlen(conf.socket_dir) + 1 /* for / */ + strlen(host); data/sane-airscan-0.99.20/airscan-http.c:2893:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(addr->sun_path, path, sizeof(addr->sun_path)-1); data/sane-airscan-0.99.20/airscan-inifile.c:62:13: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = getc(file->fp); data/sane-airscan-0.99.20/airscan-ip.c:65: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). sprintf(straddr.text + strlen(straddr.text), "%%%d", data/sane-airscan-0.99.20/airscan-ip.c:68:9: [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. strcat(straddr.text, "]"); data/sane-airscan-0.99.20/airscan-ip.c:72:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(straddr.text, addr_un->sun_path, sizeof(straddr.text) - 1); data/sane-airscan-0.99.20/airscan-ip.c:79: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). sprintf(straddr.text + strlen(straddr.text), ":%d", port); data/sane-airscan-0.99.20/airscan-ip.c:378: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). str.text[strlen(str.text) - 1] = '\0'; data/sane-airscan-0.99.20/airscan-mdns.c:390:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(str_addr); data/sane-airscan-0.99.20/airscan-mdns.c:412: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). rs_len = (int) strlen(rs); data/sane-airscan-0.99.20/airscan-memstr.c:280: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). size_t l1 = strlen(s); data/sane-airscan-0.99.20/airscan-memstr.c:281: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). size_t l2 = strlen(prefix); data/sane-airscan-0.99.20/airscan-memstr.c:290: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). size_t l1 = strlen(s); data/sane-airscan-0.99.20/airscan-memstr.c:291: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). size_t l2 = strlen(suffix); data/sane-airscan-0.99.20/airscan-memstr.c:302: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). size_t len = strlen(s), skip; data/sane-airscan-0.99.20/airscan-netif.c:164:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(addr->ifname.text, ifa->ifa_name, data/sane-airscan-0.99.20/airscan-netif.c:462:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rc = read(netif_rtnetlink_sock, buf, sizeof(buf)); data/sane-airscan-0.99.20/airscan-os.c:42:30: [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 (s != NULL && s[0] && strlen(s) < sizeof(os_homedir_buf)) { data/sane-airscan-0.99.20/airscan-os.c:53:30: [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 (result->pw_dir[0] && strlen(result->pw_dir) < sizeof(os_homedir_buf)) { data/sane-airscan-0.99.20/airscan-os.c:82:43: [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). memmove(os_progname_buf, s+1, strlen(s+1) + 1); data/sane-airscan-0.99.20/airscan-os.c:120: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). size_t len = strlen(path); data/sane-airscan-0.99.20/airscan-pollable.c:95:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(p->efd, &unused, sizeof(unused)); data/sane-airscan-0.99.20/airscan-trace.c:93: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(path); data/sane-airscan-0.99.20/airscan-trace.c:100:5: [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. strcat(path, "-"); data/sane-airscan-0.99.20/airscan-trace.c:204:5: [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(hdr.uid, "0"); data/sane-airscan-0.99.20/airscan-trace.c:205:5: [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(hdr.gid, "0"); data/sane-airscan-0.99.20/airscan-trace.c:211:5: [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(hdr.devmajor, "1"); data/sane-airscan-0.99.20/airscan-trace.c:212:5: [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(hdr.devminor, "1"); data/sane-airscan-0.99.20/airscan-uuid.c:116:49: [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). rc = gnutls_hash_fast(GNUTLS_DIG_SHA256, s, strlen(s), buf); data/sane-airscan-0.99.20/airscan-wsd.c:166:30: [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_t prefixlen = strlen(xml_rd_node_path(xml)); data/sane-airscan-0.99.20/airscan-wsd.c:276: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). size_t prefixlen = strlen(xml_rd_node_path(xml)); data/sane-airscan-0.99.20/airscan-wsd.c:429:30: [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_t prefixlen = strlen(xml_rd_node_path(xml)); data/sane-airscan-0.99.20/airscan-wsd.c:618:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(wsd->fault_code, fault, sizeof(wsd->fault_code) - 1); data/sane-airscan-0.99.20/airscan-wsd.c:881: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). job_id = alloca(strlen(ctx->location) + 1); data/sane-airscan-0.99.20/airscan-wsd.c:1004:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(scanner_state, val, sizeof(scanner_state) - 1); data/sane-airscan-0.99.20/airscan-wsd.c:1085: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). job_id = alloca(strlen(ctx->location) + 1); data/sane-airscan-0.99.20/airscan-wsdd.c:518:35: [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_t prefixlen = strlen(xml_rd_node_path(xml)); data/sane-airscan-0.99.20/airscan-wsdd.c:696:30: [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_t prefixlen = strlen(xml_rd_node_path(xml)); data/sane-airscan-0.99.20/airscan-zeroconf.c:789:9: [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(ifname, "?"); data/sane-airscan-0.99.20/airscan-zeroconf.c:1059: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). hostlen = strlen(host); data/sane-airscan-0.99.20/airscan-zeroconf.c:1186: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). buf_size = strlen(ident) + 1; data/sane-airscan-0.99.20/airscan.h:347: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). size_t len = strlen(s1); data/sane-airscan-0.99.20/airscan.h:417:35: [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 str_append_mem(s1, s2, strlen(s2)); ANALYSIS SUMMARY: Hits = 238 Lines analyzed = 27444 in approximately 0.61 seconds (44763 lines/second) Physical Source Lines of Code (SLOC) = 17924 Hits@level = [0] 49 [1] 66 [2] 131 [3] 3 [4] 37 [5] 1 Hits@level+ = [0+] 287 [1+] 238 [2+] 172 [3+] 41 [4+] 38 [5+] 1 Hits/KSLOC@level+ = [0+] 16.0121 [1+] 13.2783 [2+] 9.59607 [3+] 2.28744 [4+] 2.12006 [5+] 0.0557911 Dot directories skipped = 2 (--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.