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/lmbench-3.0-a9+debian.1/src/busy.c Examining data/lmbench-3.0-a9+debian.1/src/bw_file_rd.c Examining data/lmbench-3.0-a9+debian.1/src/bw_mem.c Examining data/lmbench-3.0-a9+debian.1/src/bw_mmap_rd.c Examining data/lmbench-3.0-a9+debian.1/src/bw_pipe.c Examining data/lmbench-3.0-a9+debian.1/src/bw_tcp.c Examining data/lmbench-3.0-a9+debian.1/src/bw_udp.c Examining data/lmbench-3.0-a9+debian.1/src/bw_unix.c Examining data/lmbench-3.0-a9+debian.1/src/cache.c Examining data/lmbench-3.0-a9+debian.1/src/clock.c Examining data/lmbench-3.0-a9+debian.1/src/disk.c Examining data/lmbench-3.0-a9+debian.1/src/enough.c Examining data/lmbench-3.0-a9+debian.1/src/flushdisk.c Examining data/lmbench-3.0-a9+debian.1/src/getopt.c Examining data/lmbench-3.0-a9+debian.1/src/hello.c Examining data/lmbench-3.0-a9+debian.1/src/lat_cmd.c Examining data/lmbench-3.0-a9+debian.1/src/lat_connect.c Examining data/lmbench-3.0-a9+debian.1/src/lat_ctx.c Examining data/lmbench-3.0-a9+debian.1/src/lat_dram_page.c Examining data/lmbench-3.0-a9+debian.1/src/lat_fs.c Examining data/lmbench-3.0-a9+debian.1/src/lat_http.c Examining data/lmbench-3.0-a9+debian.1/src/lat_mem_rd.c Examining data/lmbench-3.0-a9+debian.1/src/lat_mmap.c Examining data/lmbench-3.0-a9+debian.1/src/lat_ops.c Examining data/lmbench-3.0-a9+debian.1/src/lat_pagefault.c Examining data/lmbench-3.0-a9+debian.1/src/lat_pipe.c Examining data/lmbench-3.0-a9+debian.1/src/lat_pmake.c Examining data/lmbench-3.0-a9+debian.1/src/lat_rand.c Examining data/lmbench-3.0-a9+debian.1/src/lat_rpc.c Examining data/lmbench-3.0-a9+debian.1/src/lat_select.c Examining data/lmbench-3.0-a9+debian.1/src/lat_sem.c Examining data/lmbench-3.0-a9+debian.1/src/lat_sig.c Examining data/lmbench-3.0-a9+debian.1/src/lat_syscall.c Examining data/lmbench-3.0-a9+debian.1/src/lat_tcp.c Examining data/lmbench-3.0-a9+debian.1/src/lat_udp.c Examining data/lmbench-3.0-a9+debian.1/src/lat_unix.c Examining data/lmbench-3.0-a9+debian.1/src/lat_usleep.c Examining data/lmbench-3.0-a9+debian.1/src/lib_debug.c Examining data/lmbench-3.0-a9+debian.1/src/lib_debug.h Examining data/lmbench-3.0-a9+debian.1/src/lib_mem.c Examining data/lmbench-3.0-a9+debian.1/src/lib_mem.h Examining data/lmbench-3.0-a9+debian.1/src/lib_sched.c Examining data/lmbench-3.0-a9+debian.1/src/lib_stats.c Examining data/lmbench-3.0-a9+debian.1/src/lib_tcp.h Examining data/lmbench-3.0-a9+debian.1/src/lib_timing.c Examining data/lmbench-3.0-a9+debian.1/src/lib_udp.c Examining data/lmbench-3.0-a9+debian.1/src/lib_udp.h Examining data/lmbench-3.0-a9+debian.1/src/lib_unix.c Examining data/lmbench-3.0-a9+debian.1/src/lib_unix.h Examining data/lmbench-3.0-a9+debian.1/src/line.c Examining data/lmbench-3.0-a9+debian.1/src/lmdd.c Examining data/lmbench-3.0-a9+debian.1/src/loop_o.c Examining data/lmbench-3.0-a9+debian.1/src/memsize.c Examining data/lmbench-3.0-a9+debian.1/src/mhz.c Examining data/lmbench-3.0-a9+debian.1/src/msleep.c Examining data/lmbench-3.0-a9+debian.1/src/names.h Examining data/lmbench-3.0-a9+debian.1/src/par_mem.c Examining data/lmbench-3.0-a9+debian.1/src/par_ops.c Examining data/lmbench-3.0-a9+debian.1/src/seek.c Examining data/lmbench-3.0-a9+debian.1/src/stats.h Examining data/lmbench-3.0-a9+debian.1/src/stream.c Examining data/lmbench-3.0-a9+debian.1/src/timing.h Examining data/lmbench-3.0-a9+debian.1/src/timing_o.c Examining data/lmbench-3.0-a9+debian.1/src/tlb.c Examining data/lmbench-3.0-a9+debian.1/src/version.h Examining data/lmbench-3.0-a9+debian.1/src/lib_tcp.c Examining data/lmbench-3.0-a9+debian.1/src/lmhttp.c Examining data/lmbench-3.0-a9+debian.1/src/bench.h Examining data/lmbench-3.0-a9+debian.1/src/lat_fcntl.c Examining data/lmbench-3.0-a9+debian.1/src/lat_fifo.c Examining data/lmbench-3.0-a9+debian.1/src/lat_proc.c Examining data/lmbench-3.0-a9+debian.1/src/lat_unix_connect.c Examining data/lmbench-3.0-a9+debian.1/src/rhttp.c FINAL RESULTS: data/lmbench-3.0-a9+debian.1/src/bench.h:99:20: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define debug(x) fprintf x data/lmbench-3.0-a9+debian.1/src/bw_file_rd.c:68:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(s, "%s%d", state->filename, (int)getpid()); data/lmbench-3.0-a9+debian.1/src/bw_file_rd.c:74:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(state->filename, s); data/lmbench-3.0-a9+debian.1/src/bw_file_rd.c:169: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(state.filename,av[optind+2]); data/lmbench-3.0-a9+debian.1/src/bw_mmap_rd.c:85: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(state.filename,av[optind+2]); data/lmbench-3.0-a9+debian.1/src/bw_mmap_rd.c:123:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(s, "%s%d", state->filename, (int)getpid()); data/lmbench-3.0-a9+debian.1/src/bw_mmap_rd.c:129:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(state->filename, s); data/lmbench-3.0-a9+debian.1/src/lat_cmd.c:94:4: [4] (shell) execvp: 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. execvp(state->argv[0], state->argv); data/lmbench-3.0-a9+debian.1/src/lat_connect.c:75:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "TCP/IP connection cost to %s", state.server); data/lmbench-3.0-a9+debian.1/src/lat_fifo.c:79:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(state->filename1,F1,getpid()); data/lmbench-3.0-a9+debian.1/src/lat_fifo.c:80:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(state->filename2,F2,getpid()); data/lmbench-3.0-a9+debian.1/src/lat_fs.c:139:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(name, "%s/%ld", basename, i); data/lmbench-3.0-a9+debian.1/src/lat_fs.c:146:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(name, "%s/%ld", basename, i); data/lmbench-3.0-a9+debian.1/src/lat_http.c:28:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "GET /%s HTTP/1.0\r\n\r\n\n", file); data/lmbench-3.0-a9+debian.1/src/lat_http.c:30:3: [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(buf); data/lmbench-3.0-a9+debian.1/src/lat_mmap.c:114:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(s, "%s%d", state->name, (int)getpid()); data/lmbench-3.0-a9+debian.1/src/lat_pagefault.c:88:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "Pagefaults on %s", state.file); data/lmbench-3.0-a9+debian.1/src/lat_pagefault.c:114:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(s, "%s%d", state->file, (int)getpid()); data/lmbench-3.0-a9+debian.1/src/lat_proc.c:114:4: [4] (shell) execlp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execlp("/bin/sh", "sh", "-c", PROG, 0); data/lmbench-3.0-a9+debian.1/src/lat_rpc.c:156:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "RPC/%s latency using %s", proto[0], state.server); data/lmbench-3.0-a9+debian.1/src/lat_rpc.c:164:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "RPC/%s latency using %s", proto[1], state.server); data/lmbench-3.0-a9+debian.1/src/lat_select.c:113:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "lat_select: Could not create temp file %s", state->fname); data/lmbench-3.0-a9+debian.1/src/lat_tcp.c:86:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "TCP latency using %s", state.server); data/lmbench-3.0-a9+debian.1/src/lat_udp.c:109:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "UDP latency using %s", state.server); data/lmbench-3.0-a9+debian.1/src/lat_usleep.c:256:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s%s %lu microseconds", scheduler, mechanism, state.usecs); data/lmbench-3.0-a9+debian.1/src/lib_unix.c:29: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(s.sun_path, path); data/lmbench-3.0-a9+debian.1/src/lib_unix.c:91: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(s.sun_path, path); data/lmbench-3.0-a9+debian.1/src/lmhttp.c:232:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. n = sprintf(hbuf, "HTTP/1.0 200 OK\r\n%s\r\nServer: lmhttp/0.1\r\nContent-Type: %s\r\nLast-Modified: %s\r\n\r\n", data/lmbench-3.0-a9+debian.1/src/lmhttp.c:284:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "cd %s && ls -1a", name); data/lmbench-3.0-a9+debian.1/src/lmhttp.c:285:6: [4] (shell) popen: 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. p = popen(buf, "r"); data/lmbench-3.0-a9+debian.1/src/lmhttp.c:287:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "\ data/lmbench-3.0-a9+debian.1/src/lmhttp.c:293:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "/%s/%s", name, buf); data/lmbench-3.0-a9+debian.1/src/lmhttp.c:380:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. len = sprintf(buf, "%u %u %s %u\n", data/lmbench-3.0-a9+debian.1/src/rhttp.c:85:4: [4] (shell) execvp: 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. execvp(args[0], args); data/lmbench-3.0-a9+debian.1/src/rhttp.c:96:2: [4] (shell) system: 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. system("cat /var/tmp/lmbench/rhttp*; rm /var/tmp/lmbench/rhttp*"); data/lmbench-3.0-a9+debian.1/src/bench.h:155:18: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. #define srand48 srand data/lmbench-3.0-a9+debian.1/src/bench.h:156:9: [3] (random) drand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. #define drand48() ((double)rand() / (double)RAND_MAX) data/lmbench-3.0-a9+debian.1/src/bench.h:158:18: [3] (random) srandom: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. #define srand48 srandom data/lmbench-3.0-a9+debian.1/src/bench.h:159:9: [3] (random) drand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. #define drand48() ((double)random() / (double)RAND_MAX) data/lmbench-3.0-a9+debian.1/src/bench.h:159:28: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. #define drand48() ((double)random() / (double)RAND_MAX) data/lmbench-3.0-a9+debian.1/src/bench.h:277:9: [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. #define getopt mygetopt data/lmbench-3.0-a9+debian.1/src/bench.h:286:5: [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. int getopt(int ac, char **av, char *opts); data/lmbench-3.0-a9+debian.1/src/bw_file_rd.c:144:15: [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. while (( c = getopt(ac, av, "P:W:N:C")) != EOF) { data/lmbench-3.0-a9+debian.1/src/bw_mem.c:72:15: [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. while (( c = getopt(ac, av, "P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/bw_mmap_rd.c:58:15: [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. while (( c = getopt(ac, av, "P:W:N:C")) != EOF) { data/lmbench-3.0-a9+debian.1/src/bw_pipe.c:141:15: [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. while (( c = getopt(ac, av, "m:M:P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/bw_tcp.c:51:15: [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. while (( c = getopt(ac, av, "sS:m:M:P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/bw_udp.c:54:15: [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. while (( c = getopt(ac, av, "sS:m:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/bw_unix.c:144:15: [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. while (( c = getopt(argc,argv,"m:M:P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/cache.c:101:15: [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. while (( c = getopt(ac, av, "L:M:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/getopt.c:33: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(int ac, char **av, char *opts) data/lmbench-3.0-a9+debian.1/src/getopt.c:128:14: [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. while ((c = getopt(ac, av, "fnpsx:y|")) != -1) { data/lmbench-3.0-a9+debian.1/src/lat_cmd.c:35:15: [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. while (( c = getopt(ac, av, "P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_connect.c:43:15: [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. while (( c = getopt(ac, av, "sSP:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_ctx.c:70:15: [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. while (( c = getopt(ac, av, "s:P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_dram_page.c:43:15: [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. while (( c = getopt(ac, av, "aL:T:M:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_fcntl.c:196:15: [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. while (( c = getopt(ac, av, "P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_fifo.c:41:15: [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. while (( c = getopt(ac, av, "P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_fs.c:45:15: [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. while (( c = getopt(ac, av, "s:n:P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_fs.c:189:12: [3] (tmpfile) tempnam: Temporary file race condition (CWE-377). dirname = tempnam(state->tmpdir, dirname_tmpl); data/lmbench-3.0-a9+debian.1/src/lat_http.c:72:15: [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. while (( c = getopt(ac, av, "deS")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_mem_rd.c:40:15: [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. while (( c = getopt(ac, av, "tP:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_mmap.c:30:6: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. int random; data/lmbench-3.0-a9+debian.1/src/lat_mmap.c:52:15: [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. while (( c = getopt(ac, av, "rP:W:N:C")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_mmap.c:150:31: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. register int random = state->random; data/lmbench-3.0-a9+debian.1/src/lat_mmap.c:165:7: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. if (random) { data/lmbench-3.0-a9+debian.1/src/lat_ops.c:405:15: [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. while (( c = getopt(ac, av, "W:N:P:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_pagefault.c:50:15: [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. while (( c = getopt(ac, av, "P:W:N:C")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_pagefault.c:126:2: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(getpid()); data/lmbench-3.0-a9+debian.1/src/lat_pipe.c:37:15: [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. while (( c = getopt(ac, av, "P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_pmake.c:43:15: [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. while (( c = getopt(ac, av, "P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_proc.c:56:15: [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. while (( c = getopt(ac, av, "P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_rand.c:35:15: [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. while (( c = getopt(ac, av, "P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_rand.c:84:8: [3] (random) drand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. v += drand48(); data/lmbench-3.0-a9+debian.1/src/lat_rand.c:94:8: [3] (random) lrand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. v += lrand48(); data/lmbench-3.0-a9+debian.1/src/lat_rand.c:116:8: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. v += random(); data/lmbench-3.0-a9+debian.1/src/lat_rpc.c:105:15: [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. while (( c = getopt(ac, av, "sS:m:p:P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_select.c:49:15: [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. while (( c = getopt(ac, av, "P:W:N:n:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_sem.c:38:15: [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. while (( c = getopt(ac, av, "P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_sig.c:178:15: [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. while (( c = getopt(ac, av, "P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_syscall.c:109:15: [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. while (( c = getopt(ac, av, "P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_tcp.c:45:15: [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. while (( c = getopt(ac, av, "sS:m:P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_udp.c:53:15: [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. while (( c = getopt(ac, av, "sS:m:P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_unix.c:39:15: [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. while (( c = getopt(ac, av, "m:P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_unix_connect.c:59:15: [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. while (( c = getopt(ac, av, "P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lat_usleep.c:180:17: [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. while ((c = getopt(ac, av, "ru:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lib_mem.c:148:2: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(getpid()); data/lmbench-3.0-a9+debian.1/src/lib_mem.c:448:2: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(getpid() ^ (getppid()<<7)); data/lmbench-3.0-a9+debian.1/src/lib_sched.c:49:16: [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* sched = getenv("LMBENCH_SCHED"); data/lmbench-3.0-a9+debian.1/src/lib_timing.c:1326:6: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("LOOP_O")) { data/lmbench-3.0-a9+debian.1/src/lib_timing.c:1327:19: [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. overhead = atof(getenv("LOOP_O")); data/lmbench-3.0-a9+debian.1/src/lib_timing.c:1376:6: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("TIMING_O")) { data/lmbench-3.0-a9+debian.1/src/lib_timing.c:1377:19: [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. overhead = atof(getenv("TIMING_O")); data/lmbench-3.0-a9+debian.1/src/lib_timing.c:1540:6: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("ENOUGH")) { data/lmbench-3.0-a9+debian.1/src/lib_timing.c:1541:16: [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. return (atoi(getenv("ENOUGH"))); data/lmbench-3.0-a9+debian.1/src/line.c:39:15: [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. while (( c = getopt(ac, av, "avM:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/lmdd.c:348:11: [3] (random) drand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. off = drand48() * End; data/lmbench-3.0-a9+debian.1/src/lmdd.c:373:11: [3] (random) drand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. off = drand48() * (size - Bsize); data/lmbench-3.0-a9+debian.1/src/lmhttp.c:68:6: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("DOCROOT")) { data/lmbench-3.0-a9+debian.1/src/lmhttp.c:69:13: [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 (chdir(getenv("DOCROOT")) == -1) { data/lmbench-3.0-a9+debian.1/src/lmhttp.c:70: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. perror(getenv("DOCROOT")); data/lmbench-3.0-a9+debian.1/src/mhz.c:480:15: [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. while (( c = getopt(ac, av, "cd")) != EOF) { data/lmbench-3.0-a9+debian.1/src/par_mem.c:42:15: [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. while (( c = getopt(ac, av, "L:M:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/par_ops.c:387:15: [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. while (( c = getopt(ac, av, "W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/stream.c:64:15: [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. while (( c = getopt(ac, av, "v:M:P:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/tlb.c:50:15: [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. while (( c = getopt(ac, av, "cL:M:W:N:")) != EOF) { data/lmbench-3.0-a9+debian.1/src/bench.h:146:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(s, d, l) memcpy(d, s, l) data/lmbench-3.0-a9+debian.1/src/bench.h:146:24: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(s, d, l) memcpy(d, s, l) data/lmbench-3.0-a9+debian.1/src/bw_file_rd.c:32: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 filename[256]; data/lmbench-3.0-a9+debian.1/src/bw_file_rd.c:62:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[128]; data/lmbench-3.0-a9+debian.1/src/bw_file_rd.c:66: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, "%d", (int)getpid()); data/lmbench-3.0-a9+debian.1/src/bw_file_rd.c:87:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). CHK(ofd = open(state->filename, O_RDONLY)); data/lmbench-3.0-a9+debian.1/src/bw_file_rd.c:99: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/lmbench-3.0-a9+debian.1/src/bw_file_rd.c:137: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 usage[1024]; data/lmbench-3.0-a9+debian.1/src/bw_file_rd.c:139:2: [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(usage,"[-C] [-P <parallelism>] [-W <warmup>] [-N <repetitions>] <size> open2close|io_only <filename>" data/lmbench-3.0-a9+debian.1/src/bw_file_rd.c:147:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_file_rd.c:151:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_file_rd.c:154:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_mem.c:75:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_mem.c:79:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_mem.c:82:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_mem.c:433:3: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy(p,dst,N); data/lmbench-3.0-a9+debian.1/src/bw_mmap_rd.c:32: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 filename[256]; data/lmbench-3.0-a9+debian.1/src/bw_mmap_rd.c:61:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_mmap_rd.c:65:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_mmap_rd.c:68:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_mmap_rd.c:117: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[8192]; data/lmbench-3.0-a9+debian.1/src/bw_mmap_rd.c:121: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, "%d", (int)getpid()); data/lmbench-3.0-a9+debian.1/src/bw_mmap_rd.c:141:18: [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). CHK(state->fd = open(state->filename, 0)); data/lmbench-3.0-a9+debian.1/src/bw_mmap_rd.c:177:15: [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). CHK(fd = open(filename, 0)); data/lmbench-3.0-a9+debian.1/src/bw_pipe.c:150:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_pipe.c:154:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_pipe.c:157:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_tcp.c:73:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_tcp.c:77:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_tcp.c:80:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_tcp.c:125:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[100]; data/lmbench-3.0-a9+debian.1/src/bw_tcp.c:142:2: [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, "%lu", (unsigned long)state->msize); data/lmbench-3.0-a9+debian.1/src/bw_tcp.c:217:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *buf, scratch[100]; data/lmbench-3.0-a9+debian.1/src/bw_udp.c:75:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). state.msize = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_udp.c:78:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_udp.c:81:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_unix.c:153:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_unix.c:157:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_unix.c:160:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/cache.c:104:11: [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). line = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/cache.c:112:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/cache.c:115:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/cache.c:593:2: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy(pages, saved_pages, sizeof(int) * ntotalpages); data/lmbench-3.0-a9+debian.1/src/cache.c:682:4: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy(saved_pages, pages, sizeof(int) * ntotalpages); data/lmbench-3.0-a9+debian.1/src/disk.c:44:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(disk, oflag)) == -1) { data/lmbench-3.0-a9+debian.1/src/disk.c:142:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(disk, oflag)) == -1) { data/lmbench-3.0-a9+debian.1/src/disk.c:226:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int fd = open(disk, 0); data/lmbench-3.0-a9+debian.1/src/disk.c:227:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[512]; data/lmbench-3.0-a9+debian.1/src/flushdisk.c:33: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(av[i], 0); data/lmbench-3.0-a9+debian.1/src/lat_cmd.c:38:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_cmd.c:42:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_cmd.c:45:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_connect.c:40:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/lmbench-3.0-a9+debian.1/src/lat_connect.c:60:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_ctx.c:73:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_ctx.c:77:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_ctx.c:80:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_ctx.c:83:25: [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). state.process_size = atoi(optarg) * 1024; data/lmbench-3.0-a9+debian.1/src/lat_ctx.c:95:13: [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). maxprocs = atoi(av[optind]); data/lmbench-3.0-a9+debian.1/src/lat_ctx.c:97:17: [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). state.procs = atoi(av[i]); data/lmbench-3.0-a9+debian.1/src/lat_ctx.c:112:17: [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). state.procs = atoi(av[i]); data/lmbench-3.0-a9+debian.1/src/lat_dram_page.c:55:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_dram_page.c:58:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_fcntl.c:36: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 filename1[2048]; data/lmbench-3.0-a9+debian.1/src/lat_fcntl.c:37: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 filename2[2048]; data/lmbench-3.0-a9+debian.1/src/lat_fcntl.c:100:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[10000]; data/lmbench-3.0-a9+debian.1/src/lat_fcntl.c:105:2: [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(state->filename1, "/var/tmp/lmbench/lmbench-fcntl%d.1", getpid()); data/lmbench-3.0-a9+debian.1/src/lat_fcntl.c:106:2: [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(state->filename2, "/var/tmp/lmbench/lmbench-fcntl%d.2", getpid()); data/lmbench-3.0-a9+debian.1/src/lat_fcntl.c:113:20: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((state->fd1 = open(state->filename1, O_CREAT|O_RDWR, 0666)) == -1) { data/lmbench-3.0-a9+debian.1/src/lat_fcntl.c:117:20: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((state->fd2 = open(state->filename2, O_CREAT|O_RDWR, 0666)) == -1) { data/lmbench-3.0-a9+debian.1/src/lat_fcntl.c:199:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_fcntl.c:203:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_fcntl.c:206:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_fifo.c:24: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 filename1[256]; data/lmbench-3.0-a9+debian.1/src/lat_fifo.c:25: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 filename2[256]; data/lmbench-3.0-a9+debian.1/src/lat_fifo.c:44:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_fifo.c:48:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_fifo.c:51:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_fifo.c:92:15: [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). state->rd = open(state->filename1, O_RDONLY); data/lmbench-3.0-a9+debian.1/src/lat_fifo.c:93:15: [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). state->wr = open(state->filename2, O_WRONLY); data/lmbench-3.0-a9+debian.1/src/lat_fifo.c:102:15: [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). state->wr = open(state->filename1, O_WRONLY); data/lmbench-3.0-a9+debian.1/src/lat_fifo.c:103:15: [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). state->rd = open(state->filename2, O_RDONLY); data/lmbench-3.0-a9+debian.1/src/lat_fs.c:54:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_fs.c:58:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_fs.c:61:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_fs.c:116:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[128*1024]; /* XXX - track sizes */ data/lmbench-3.0-a9+debian.1/src/lat_fs.c:131:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[L_tmpnam + 8192]; data/lmbench-3.0-a9+debian.1/src/lat_fs.c:158: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 dirname_tmpl[L_tmpnam + 256]; data/lmbench-3.0-a9+debian.1/src/lat_fs.c:188:2: [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(dirname_tmpl, "lat_fs_%d_XXXXXX", getpid()); data/lmbench-3.0-a9+debian.1/src/lat_http.c:69: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 file[1024]; data/lmbench-3.0-a9+debian.1/src/lat_http.c:95: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). if (optind < ac && atoi(av[optind]) != 0) { data/lmbench-3.0-a9+debian.1/src/lat_http.c:96:11: [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). prog = -atoi(av[optind]); data/lmbench-3.0-a9+debian.1/src/lat_mem_rd.c:46:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_mem_rd.c:50:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_mem_rd.c:53:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_mem_rd.c:64:15: [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). len = atoi(av[optind]); data/lmbench-3.0-a9+debian.1/src/lat_mmap.c:55:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_mmap.c:60:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_mmap.c:63:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_mmap.c:104:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[128]; data/lmbench-3.0-a9+debian.1/src/lat_mmap.c:108: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, "%d", (int)getpid()); data/lmbench-3.0-a9+debian.1/src/lat_mmap.c:122:18: [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). CHK(state->fd = open(state->name, O_RDWR)); data/lmbench-3.0-a9+debian.1/src/lat_ops.c:408:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_ops.c:411:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_ops.c:414:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_pagefault.c:45:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2048]; data/lmbench-3.0-a9+debian.1/src/lat_pagefault.c:53:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_pagefault.c:57:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_pagefault.c:60:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_pagefault.c:104:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[128]; data/lmbench-3.0-a9+debian.1/src/lat_pagefault.c:108: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, "%d", (int)getpid()); data/lmbench-3.0-a9+debian.1/src/lat_pagefault.c:122:18: [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). CHK(state->fd = open(state->file, 0)); data/lmbench-3.0-a9+debian.1/src/lat_pipe.c:40:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_pipe.c:44:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_pipe.c:47:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_pmake.c:40:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/lmbench-3.0-a9+debian.1/src/lat_pmake.c:46:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_pmake.c:50:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_pmake.c:53:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_pmake.c:63:15: [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). state.jobs = atoi(av[optind]); data/lmbench-3.0-a9+debian.1/src/lat_proc.c:59:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_proc.c:63:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_proc.c:66:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_proc.c:127: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 *nav[2]; data/lmbench-3.0-a9+debian.1/src/lat_rand.c:38:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_rand.c:42:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_rand.c:45:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_rpc.c:99:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/lmbench-3.0-a9+debian.1/src/lat_rpc.c:124:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). state.msize = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_rpc.c:130:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_rpc.c:135:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_rpc.c:138:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_select.c:26: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 fname[L_tmpnam]; data/lmbench-3.0-a9+debian.1/src/lat_select.c:45:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/lmbench-3.0-a9+debian.1/src/lat_select.c:52:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_select.c:56:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_select.c:59:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_select.c:79: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, "Select on %d tcp fd's", state.num); data/lmbench-3.0-a9+debian.1/src/lat_select.c:89: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, "Select on %d fd's", state.num); data/lmbench-3.0-a9+debian.1/src/lat_select.c:109: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(state->fname, "lat_selectXXXXXX"); data/lmbench-3.0-a9+debian.1/src/lat_select.c:110:16: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). state->fid = mkstemp(state->fname); data/lmbench-3.0-a9+debian.1/src/lat_select.c:112:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[L_tmpnam+128]; data/lmbench-3.0-a9+debian.1/src/lat_select.c:158:9: [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). return open(state->fname, O_RDONLY); data/lmbench-3.0-a9+debian.1/src/lat_sem.c:41:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_sem.c:45:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_sem.c:48:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_sig.c:88:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(state->fname, 0); data/lmbench-3.0-a9+debian.1/src/lat_sig.c:181:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_sig.c:185:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_sig.c:188:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_syscall.c:90: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(pState->file, 0); data/lmbench-3.0-a9+debian.1/src/lat_syscall.c:112:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_syscall.c:116:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_syscall.c:119:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_syscall.c:139:14: [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). state.fd = open("/dev/null", 1); data/lmbench-3.0-a9+debian.1/src/lat_syscall.c:145:14: [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). state.fd = open("/dev/zero", 0); data/lmbench-3.0-a9+debian.1/src/lat_syscall.c:159:14: [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). state.fd = open(state.file, 0); data/lmbench-3.0-a9+debian.1/src/lat_tcp.c:40:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/lmbench-3.0-a9+debian.1/src/lat_tcp.c:59:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). state.msize = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_tcp.c:62:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_tcp.c:67:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_tcp.c:70:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_udp.c:45: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/lmbench-3.0-a9+debian.1/src/lat_udp.c:74:12: [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). msize = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_udp.c:85:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_udp.c:90:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_udp.c:93:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_unix.c:42:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). state.msize = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_unix.c:45:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_unix.c:49:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_unix.c:52:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_unix_connect.c:62:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_unix_connect.c:66:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_unix_connect.c:69:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_usleep.c:171: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[512]; data/lmbench-3.0-a9+debian.1/src/lat_usleep.c:208:17: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_usleep.c:212:15: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lat_usleep.c:215:20: [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). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lib_tcp.c:168:3: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy((void*)h->h_addr, (void *)&s.sin_addr, h->h_length); data/lmbench-3.0-a9+debian.1/src/lib_timing.c:1124: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 p64buf[10][20]; data/lmbench-3.0-a9+debian.1/src/lib_timing.c:1138:17: [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(s, "0x%x%08x", a[1], a[0]); data/lmbench-3.0-a9+debian.1/src/lib_timing.c:1140:17: [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(s, "0x%x", a[0]); data/lmbench-3.0-a9+debian.1/src/lib_timing.c:1145: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(s, "0x%llx", big); data/lmbench-3.0-a9+debian.1/src/lib_timing.c:1164: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(s, "%.4f%c", d, tags[t]); data/lmbench-3.0-a9+debian.1/src/lib_timing.c:1166: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(s, "%.2f%c", d, tags[t]); data/lmbench-3.0-a9+debian.1/src/lib_timing.c:1541:11: [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). return (atoi(getenv("ENOUGH"))); data/lmbench-3.0-a9+debian.1/src/lib_timing.c:1674:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[8192]; data/lmbench-3.0-a9+debian.1/src/lib_timing.c:1677:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((sfd = open(src, O_RDONLY)) < 0) { data/lmbench-3.0-a9+debian.1/src/lib_timing.c:1680:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((dfd = open(dst, O_CREAT|O_TRUNC|O_RDWR, mode)) < 0) { data/lmbench-3.0-a9+debian.1/src/lib_udp.c:82:2: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy((void*)h->h_addr, (void *) &sin.sin_addr, h->h_length); data/lmbench-3.0-a9+debian.1/src/line.c:48:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/line.c:51:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/lmdd.c:289: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. bzero((char *) bufs[i], Bsize); data/lmbench-3.0-a9+debian.1/src/lmdd.c:470: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)[i] = 0; data/lmbench-3.0-a9+debian.1/src/lmdd.c:570: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)[i] = 0; data/lmbench-3.0-a9+debian.1/src/lmdd.c:781:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ret = open(&av[i][len], oflags,0644); data/lmbench-3.0-a9+debian.1/src/lmdd.c:786:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ret = open(&av[i][len], oflags|O_DIRECT); data/lmbench-3.0-a9+debian.1/src/lmdd.c:816:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ret = open(&av[i][len], 0); data/lmbench-3.0-a9+debian.1/src/lmdd.c:821:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ret = open(&av[i][len], O_RDONLY|O_DIRECT); data/lmbench-3.0-a9+debian.1/src/lmdd.c:851:30: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (output == NULL || (fd = open(output, 2)) == -1) { data/lmbench-3.0-a9+debian.1/src/lmhttp.c:26:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *bufs[3]; data/lmbench-3.0-a9+debian.1/src/lmhttp.c:58:24: [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 'f': fflg = atoi(&av[i][2]); data/lmbench-3.0-a9+debian.1/src/lmhttp.c:74:6: [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). if (atoi(av[ac - 1]) != 0) { data/lmbench-3.0-a9+debian.1/src/lmhttp.c:75:11: [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). prog = -atoi(av[ac - 1]); data/lmbench-3.0-a9+debian.1/src/lmhttp.c:87:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). logfile = open(LOGFILE, O_CREAT|O_APPEND|O_WRONLY, 0666); data/lmbench-3.0-a9+debian.1/src/lmhttp.c:126:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[100]; data/lmbench-3.0-a9+debian.1/src/lmhttp.c:191:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char file[100]; data/lmbench-3.0-a9+debian.1/src/lmhttp.c:192: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 hbuf[1024]; data/lmbench-3.0-a9+debian.1/src/lmhttp.c:221:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(name, 0); data/lmbench-3.0-a9+debian.1/src/lmhttp.c:280:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/lmbench-3.0-a9+debian.1/src/lmhttp.c:281: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 path[1024]; data/lmbench-3.0-a9+debian.1/src/lmhttp.c:363: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 logbuf[64<<10]; /* buffer into here */ data/lmbench-3.0-a9+debian.1/src/lmhttp.c:372:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024 + 16]; /* maxpathlen + others */ data/lmbench-3.0-a9+debian.1/src/lmhttp.c:386:2: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy(buf, &logbuf[nbytes], len); data/lmbench-3.0-a9+debian.1/src/mhz.c:414: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 *names[NTESTS]; data/lmbench-3.0-a9+debian.1/src/msleep.c:7:9: [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). usleep(atoi(av[1]) * 1000); data/lmbench-3.0-a9+debian.1/src/msleep.c:15:15: [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). tv.tv_usec = atoi(av[1]) * 1000; data/lmbench-3.0-a9+debian.1/src/par_mem.c:45:17: [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). state.line = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/par_mem.c:53:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/par_mem.c:56:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/par_ops.c:390:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/par_ops.c:393:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/rhttp.c:38: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 *args[1024]; data/lmbench-3.0-a9+debian.1/src/rhttp.c:48:6: [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). if (atoi(av[1]) != 0) { data/lmbench-3.0-a9+debian.1/src/rhttp.c:79:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[30]; data/lmbench-3.0-a9+debian.1/src/rhttp.c:81:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(name, "/var/tmp/lmbench/rhttp%d", i); data/lmbench-3.0-a9+debian.1/src/rhttp.c:101: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[30]; data/lmbench-3.0-a9+debian.1/src/rhttp.c:106: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, "/var/tmp/lmbench/http%d", i); data/lmbench-3.0-a9+debian.1/src/rhttp.c:107: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(buf, 0); data/lmbench-3.0-a9+debian.1/src/seek.c:18:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[512]; data/lmbench-3.0-a9+debian.1/src/seek.c:27:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((disk = open(av[1], 0)) == -1) { data/lmbench-3.0-a9+debian.1/src/stream.c:67:14: [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). version = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/stream.c:72:15: [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). parallel = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/stream.c:79:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/stream.c:82:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/tlb.c:56:17: [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). state.line = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/tlb.c:63:13: [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). warmup = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/tlb.c:66:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). repetitions = atoi(optarg); data/lmbench-3.0-a9+debian.1/src/bw_file_rd.c:45:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, buf, MIN(size, chunk)) <= 0) { data/lmbench-3.0-a9+debian.1/src/bw_file_rd.c:67: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). s = (char*)malloc(strlen(state->filename) + strlen(buf) + 1); data/lmbench-3.0-a9+debian.1/src/bw_file_rd.c:67:47: [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 = (char*)malloc(strlen(state->filename) + strlen(buf) + 1); data/lmbench-3.0-a9+debian.1/src/bw_mmap_rd.c:122: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). s = (char*)malloc(strlen(state->filename) + strlen(buf) + 1); data/lmbench-3.0-a9+debian.1/src/bw_mmap_rd.c:122:47: [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 = (char*)malloc(strlen(state->filename) + strlen(buf) + 1); data/lmbench-3.0-a9+debian.1/src/bw_pipe.c:102:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((n = read(state->readfd, state->buf, state->xfer)) < 0) { data/lmbench-3.0-a9+debian.1/src/bw_tcp.c:143: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 (write(state->sock, buf, strlen(buf) + 1) != strlen(buf) + 1) { data/lmbench-3.0-a9+debian.1/src/bw_tcp.c:143:50: [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 (write(state->sock, buf, strlen(buf) + 1) != strlen(buf) + 1) { data/lmbench-3.0-a9+debian.1/src/bw_tcp.c:158:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((c = read(state->sock, state->buf, state->msize)) <= 0) { data/lmbench-3.0-a9+debian.1/src/bw_tcp.c:223:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(data, scratch, 100) <= 0) { data/lmbench-3.0-a9+debian.1/src/bw_unix.c:102:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((n = read(state->pipes[0], state->buf, state->xfer)) <= 0) { data/lmbench-3.0-a9+debian.1/src/bw_unix.c:118:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(controlfd, &todo, sizeof(todo)); data/lmbench-3.0-a9+debian.1/src/disk.c:90:33: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define IO(a,b,c) (oflag == 0 ? read(a,b,c) : write(a,b,c)) data/lmbench-3.0-a9+debian.1/src/disk.c:123:41: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define IO(a,b,c) error = (oflag == 0 ? read(a,b,c) : write(a,b,c)); \ data/lmbench-3.0-a9+debian.1/src/disk.c:244:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((read(fd, buf, sizeof(buf)) != sizeof(buf))) { data/lmbench-3.0-a9+debian.1/src/disk.c:258:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((read(fd, buf, sizeof(buf)) != sizeof(buf))) { data/lmbench-3.0-a9+debian.1/src/disk.c:272:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((read(fd, buf, sizeof(buf)) != sizeof(buf))) { data/lmbench-3.0-a9+debian.1/src/flushdisk.c:18: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/lmbench-3.0-a9+debian.1/src/lat_connect.c:103:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(newsock, &c, 1) > 0) { data/lmbench-3.0-a9+debian.1/src/lat_ctx.c:190:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(pState->p[i][0], &msg, sizeof(msg)) != sizeof(msg)) { data/lmbench-3.0-a9+debian.1/src/lat_ctx.c:262:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(pState->p[pState->procs-1][0], &msg, sizeof(msg)) != sizeof(msg)) { data/lmbench-3.0-a9+debian.1/src/lat_ctx.c:286:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(rd, &msg, sizeof(msg)) != sizeof(msg)) { data/lmbench-3.0-a9+debian.1/src/lat_ctx.c:338:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(p[procs-1][0], &msg, sizeof(msg)) != sizeof(msg)) { data/lmbench-3.0-a9+debian.1/src/lat_fifo.c:110:38: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (write(state->wr, &c, 1) != 1 || read(state->rd, &c, 1) != 1) { data/lmbench-3.0-a9+debian.1/src/lat_fifo.c:146:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(r, cptr, 1) != 1) { data/lmbench-3.0-a9+debian.1/src/lat_fifo.c:160:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(r, cptr, 1) != 1 || data/lmbench-3.0-a9+debian.1/src/lat_http.c:32: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). write(sock, buf, strlen(buf)); data/lmbench-3.0-a9+debian.1/src/lat_http.c:33:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((n = read(sock, buf, XFERSIZE)) > 0) { data/lmbench-3.0-a9+debian.1/src/lat_mmap.c:109: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). s = (char*)malloc(strlen(state->name) + strlen(buf) + 1); data/lmbench-3.0-a9+debian.1/src/lat_mmap.c:109: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). s = (char*)malloc(strlen(state->name) + strlen(buf) + 1); data/lmbench-3.0-a9+debian.1/src/lat_pagefault.c:109: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). s = (char*)malloc(strlen(state->file) + strlen(buf) + 1); data/lmbench-3.0-a9+debian.1/src/lat_pagefault.c:109: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). s = (char*)malloc(strlen(state->file) + strlen(buf) + 1); data/lmbench-3.0-a9+debian.1/src/lat_pipe.c:105:41: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (write(state->p1[1], &c, 1) != 1 || read(state->p2[0], &c, 1) != 1){ data/lmbench-3.0-a9+debian.1/src/lat_pipe.c:136:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(r, cptr, 1) != 1) { data/lmbench-3.0-a9+debian.1/src/lat_pipe.c:150:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(r, cptr, 1) != 1 || data/lmbench-3.0-a9+debian.1/src/lat_select.c:134:4: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(newsock, &state->fid, 1); data/lmbench-3.0-a9+debian.1/src/lat_syscall.c:48:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(pState->fd, &c, 1) != 1) { data/lmbench-3.0-a9+debian.1/src/lat_tcp.c:129:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(sock, state->buf, state->msize); data/lmbench-3.0-a9+debian.1/src/lat_tcp.c:163:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(sock, &n, sizeof(int)) == sizeof(int)) { data/lmbench-3.0-a9+debian.1/src/lat_tcp.c:171:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). for (n = 0; read(sock, buf, msize) > 0; n++) { data/lmbench-3.0-a9+debian.1/src/lat_unix.c:95:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (read(pState->sv[0], pState->buf, pState->msize) == pState->msize) { data/lmbench-3.0-a9+debian.1/src/lat_unix.c:108:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(pState->sv[1], pState->buf, pState->msize) != pState->msize) { data/lmbench-3.0-a9+debian.1/src/lat_unix_connect.c:95:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(newsock, &c, 1); data/lmbench-3.0-a9+debian.1/src/lat_usleep.c:51: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(state->usecs); data/lmbench-3.0-a9+debian.1/src/lib_sched.c:87: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). } else if (strncasecmp(sched, "CUSTOM ", strlen("CUSTOM ")) == 0) { data/lmbench-3.0-a9+debian.1/src/lib_sched.c:88: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). cpu = custom(sched + strlen("CUSTOM"), childno); data/lmbench-3.0-a9+debian.1/src/lib_sched.c:89:50: [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(sched, "CUSTOM_SPREAD ", strlen("CUSTOM_SPREAD ")) == 0) { data/lmbench-3.0-a9+debian.1/src/lib_sched.c:90: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). cpu = custom(sched + strlen("CUSTOM_SPREAD"), data/lmbench-3.0-a9+debian.1/src/lib_timing.c:382:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytes_read = read(response, signals, parallel * sizeof(char) - i); data/lmbench-3.0-a9+debian.1/src/lib_timing.c:427:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytes_read = read(response, signals, parallel * sizeof(char) - i); data/lmbench-3.0-a9+debian.1/src/lib_timing.c:469:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytes_read = read(response, buf, n); data/lmbench-3.0-a9+debian.1/src/lib_timing.c:693:4: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(state->start_signal, &c, sizeof(char)); data/lmbench-3.0-a9+debian.1/src/lib_timing.c:744:4: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(state->result_signal, (void*)&c, sizeof(char)); data/lmbench-3.0-a9+debian.1/src/lib_timing.c:753:4: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(state->exit_signal, (void*)&c, sizeof(char)); data/lmbench-3.0-a9+debian.1/src/lib_timing.c:1683:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((size = read(sfd, buf, 8192)) > 0) { data/lmbench-3.0-a9+debian.1/src/lmdd.c:162:24: [1] (buffer) mismatch: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. int Fork, misses, mismatch, outpat, inpat, in, timeopen, gotcnt; data/lmbench-3.0-a9+debian.1/src/lmdd.c:402:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). moved = read(in, buf, Bsize); data/lmbench-3.0-a9+debian.1/src/lmdd.c:460:10: [1] (buffer) mismatch: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. if (mismatch != -1 && --misses == 0) { data/lmbench-3.0-a9+debian.1/src/lmdd.c:581:4: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(slp); data/lmbench-3.0-a9+debian.1/src/lmdd.c:728: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); data/lmbench-3.0-a9+debian.1/src/lmdd.c:757: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); data/lmbench-3.0-a9+debian.1/src/lmhttp.c:164: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). int len = strlen(name); data/lmbench-3.0-a9+debian.1/src/lmhttp.c:196:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(sock, buf, XFERSIZE); data/lmbench-3.0-a9+debian.1/src/lmhttp.c:219:12: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). if (lflg) strncpy(file, name, sizeof(file)); data/lmbench-3.0-a9+debian.1/src/lmhttp.c:290: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). write(sock, buf, strlen(buf)); data/lmbench-3.0-a9+debian.1/src/lmhttp.c:292: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). buf[strlen(buf) - 1] = 0; data/lmbench-3.0-a9+debian.1/src/lmhttp.c:296: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). write(sock, path, strlen(path)); data/lmbench-3.0-a9+debian.1/src/lmhttp.c:298:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). write(sock, buf, strlen(buf)); data/lmbench-3.0-a9+debian.1/src/lmhttp.c:324:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((nread = read(fd, buf, XFERSIZE)) > 0) { data/lmbench-3.0-a9+debian.1/src/memsize.c:146:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fid[0], &result, sizeof(int)) != sizeof(int)) data/lmbench-3.0-a9+debian.1/src/msleep.c:7: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(atoi(av[1]) * 1000); data/lmbench-3.0-a9+debian.1/src/rhttp.c:112:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, buf, XFERSIZE); data/lmbench-3.0-a9+debian.1/src/seek.c:40:2: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(disk, buf, sizeof(buf)); data/lmbench-3.0-a9+debian.1/src/seek.c:45:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(disk, buf, sizeof(buf)); data/lmbench-3.0-a9+debian.1/src/seek.c:52:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(disk, buf, sizeof(buf)); ANALYSIS SUMMARY: Hits = 419 Lines analyzed = 16095 in approximately 0.47 seconds (34258 lines/second) Physical Source Lines of Code (SLOC) = 12328 Hits@level = [0] 242 [1] 75 [2] 238 [3] 71 [4] 35 [5] 0 Hits@level+ = [0+] 661 [1+] 419 [2+] 344 [3+] 106 [4+] 35 [5+] 0 Hits/KSLOC@level+ = [0+] 53.6178 [1+] 33.9877 [2+] 27.904 [3+] 8.59831 [4+] 2.83907 [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.