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/sg3-utils-1.45/lib/sg_cmds_basic.c
Examining data/sg3-utils-1.45/lib/sg_pt_common.c
Examining data/sg3-utils-1.45/lib/sg_cmds_mmc.c
Examining data/sg3-utils-1.45/lib/sg_pt_win32.c
Examining data/sg3-utils-1.45/lib/sg_lib.c
Examining data/sg3-utils-1.45/lib/sg_cmds_basic2.c
Examining data/sg3-utils-1.45/lib/sg_pt_solaris.c
Examining data/sg3-utils-1.45/lib/sg_cmds_extra.c
Examining data/sg3-utils-1.45/lib/sg_lib_data.c
Examining data/sg3-utils-1.45/lib/sg_pt_osf1.c
Examining data/sg3-utils-1.45/lib/sg_pt_linux.c
Examining data/sg3-utils-1.45/lib/sg_pt_freebsd.c
Examining data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c
Examining data/sg3-utils-1.45/lib/sg_io_linux.c
Examining data/sg3-utils-1.45/include/sg_pt_nvme.h
Examining data/sg3-utils-1.45/include/sg_lib.h
Examining data/sg3-utils-1.45/include/sg_cmds.h
Examining data/sg3-utils-1.45/include/sg_cmds_basic.h
Examining data/sg3-utils-1.45/include/sg_cmds_mmc.h
Examining data/sg3-utils-1.45/include/sg_cmds_extra.h
Examining data/sg3-utils-1.45/include/sg_pt_linux.h
Examining data/sg3-utils-1.45/include/freebsd_nvme_ioctl.h
Examining data/sg3-utils-1.45/include/sg_lib_data.h
Examining data/sg3-utils-1.45/include/sg_pr2serr.h
Examining data/sg3-utils-1.45/include/sg_linux_inc.h
Examining data/sg3-utils-1.45/include/sg_pt.h
Examining data/sg3-utils-1.45/include/sg_io_linux.h
Examining data/sg3-utils-1.45/include/sg_unaligned.h
Examining data/sg3-utils-1.45/include/sg_pt_win32.h
Examining data/sg3-utils-1.45/src/sg_map26.c
Examining data/sg3-utils-1.45/src/sg_logs.c
Examining data/sg3-utils-1.45/src/sg_sanitize.c
Examining data/sg3-utils-1.45/src/sg_prevent.c
Examining data/sg3-utils-1.45/src/sg_vpd_vendor.c
Examining data/sg3-utils-1.45/src/sginfo.c
Examining data/sg3-utils-1.45/src/sg_get_config.c
Examining data/sg3-utils-1.45/src/sg_unmap.c
Examining data/sg3-utils-1.45/src/sg_reset_wp.c
Examining data/sg3-utils-1.45/src/sg_rep_zones.c
Examining data/sg3-utils-1.45/src/sg_decode_sense.c
Examining data/sg3-utils-1.45/src/sg_stpg.c
Examining data/sg3-utils-1.45/src/sg_test_rwbuf.c
Examining data/sg3-utils-1.45/src/sg_sat_set_features.c
Examining data/sg3-utils-1.45/src/sg_sat_read_gplog.c
Examining data/sg3-utils-1.45/src/sg_read_buffer.c
Examining data/sg3-utils-1.45/src/sg_modes.c
Examining data/sg3-utils-1.45/src/sg_rdac.c
Examining data/sg3-utils-1.45/src/sg_rmsn.c
Examining data/sg3-utils-1.45/src/sg_inq.c
Examining data/sg3-utils-1.45/src/sg_copy_results.c
Examining data/sg3-utils-1.45/src/sg_write_buffer.c
Examining data/sg3-utils-1.45/src/sg_referrals.c
Examining data/sg3-utils-1.45/src/sg_rtpg.c
Examining data/sg3-utils-1.45/src/sg_scan_win32.c
Examining data/sg3-utils-1.45/src/sg_wr_mode.c
Examining data/sg3-utils-1.45/src/sg_format.c
Examining data/sg3-utils-1.45/src/sg_persist.c
Examining data/sg3-utils-1.45/src/sg_ident.c
Examining data/sg3-utils-1.45/src/sg_read_long.c
Examining data/sg3-utils-1.45/src/sg_read.c
Examining data/sg3-utils-1.45/src/sg_readcap.c
Examining data/sg3-utils-1.45/src/sg_luns.c
Examining data/sg3-utils-1.45/src/sg_write_verify.c
Examining data/sg3-utils-1.45/src/sg_bg_ctl.c
Examining data/sg3-utils-1.45/src/sgp_dd.c
Examining data/sg3-utils-1.45/src/sgm_dd.c
Examining data/sg3-utils-1.45/src/sg_reset.c
Examining data/sg3-utils-1.45/src/sg_sat_phy_event.c
Examining data/sg3-utils-1.45/src/sg_verify.c
Examining data/sg3-utils-1.45/src/sg_sat_identify.c
Examining data/sg3-utils-1.45/src/sg_read_block_limits.c
Examining data/sg3-utils-1.45/src/sg_reassign.c
Examining data/sg3-utils-1.45/src/sg_get_lba_status.c
Examining data/sg3-utils-1.45/src/sg_ses_microcode.c
Examining data/sg3-utils-1.45/src/sg_start.c
Examining data/sg3-utils-1.45/src/sg_read_attr.c
Examining data/sg3-utils-1.45/src/sg_sync.c
Examining data/sg3-utils-1.45/src/sg_get_elem_status.c
Examining data/sg3-utils-1.45/src/sg_write_same.c
Examining data/sg3-utils-1.45/src/sg_scan_linux.c
Examining data/sg3-utils-1.45/src/sg_ses.c
Examining data/sg3-utils-1.45/src/sg_vpd.c
Examining data/sg3-utils-1.45/src/sg_raw.c
Examining data/sg3-utils-1.45/src/sg_safte.c
Examining data/sg3-utils-1.45/src/sg_turs.c
Examining data/sg3-utils-1.45/src/sg_inq_data.c
Examining data/sg3-utils-1.45/src/sg_compare_and_write.c
Examining data/sg3-utils-1.45/src/sg_timestamp.c
Examining data/sg3-utils-1.45/src/sg_senddiag.c
Examining data/sg3-utils-1.45/src/sg_stream_ctl.c
Examining data/sg3-utils-1.45/src/sg_opcodes.c
Examining data/sg3-utils-1.45/src/sg_write_long.c
Examining data/sg3-utils-1.45/src/sg_emc_trespass.c
Examining data/sg3-utils-1.45/src/sg_zone.c
Examining data/sg3-utils-1.45/src/sg_requests.c
Examining data/sg3-utils-1.45/src/sg_map.c
Examining data/sg3-utils-1.45/src/sg_rbuf.c
Examining data/sg3-utils-1.45/src/sg_seek.c
Examining data/sg3-utils-1.45/src/sg_dd.c
Examining data/sg3-utils-1.45/src/sg_write_x.c
Examining data/sg3-utils-1.45/src/sg_xcopy.c
Examining data/sg3-utils-1.45/utils/hxascdmp.c
Examining data/sg3-utils-1.45/archive/llseek.h
Examining data/sg3-utils-1.45/archive/llseek.c
Examining data/sg3-utils-1.45/archive/align_b4_memalign.c
Examining data/sg3-utils-1.45/testing/sg_chk_asc.c
Examining data/sg3-utils-1.45/testing/sgh_dd.cpp
Examining data/sg3-utils-1.45/testing/sg_iovec_tst.c
Examining data/sg3-utils-1.45/testing/sg_tst_async.cpp
Examining data/sg3-utils-1.45/testing/sg_tst_context.cpp
Examining data/sg3-utils-1.45/testing/sg_sense_test.c
Examining data/sg3-utils-1.45/testing/sg_tst_excl.cpp
Examining data/sg3-utils-1.45/testing/bsg_queue_tst.c
Examining data/sg3-utils-1.45/testing/sg_tst_excl3.cpp
Examining data/sg3-utils-1.45/testing/tst_sg_lib.c
Examining data/sg3-utils-1.45/testing/sg_tst_excl2.cpp
Examining data/sg3-utils-1.45/testing/sg_tst_bidi.c
Examining data/sg3-utils-1.45/testing/sgs_dd.c
Examining data/sg3-utils-1.45/testing/sg_queue_tst.c
Examining data/sg3-utils-1.45/testing/uapi_sg.h
Examining data/sg3-utils-1.45/testing/sg_tst_ioctl.c
Examining data/sg3-utils-1.45/testing/sg_tst_nvme.c
Examining data/sg3-utils-1.45/examples/sg_simple16.c
Examining data/sg3-utils-1.45/examples/sg__sat_set_features.c
Examining data/sg3-utils-1.45/examples/sg__sat_phy_event.c
Examining data/sg3-utils-1.45/examples/sg_simple5.c
Examining data/sg3-utils-1.45/examples/sg_simple4.c
Examining data/sg3-utils-1.45/examples/sg_sat_chk_power.c
Examining data/sg3-utils-1.45/examples/sgq_dd.c
Examining data/sg3-utils-1.45/examples/sg_excl.c
Examining data/sg3-utils-1.45/examples/sg_sat_smart_rd_data.c
Examining data/sg3-utils-1.45/examples/sg_simple3.c
Examining data/sg3-utils-1.45/examples/sg_simple2.c
Examining data/sg3-utils-1.45/examples/sg_simple1.c
Examining data/sg3-utils-1.45/examples/sg__sat_identify.c
Examining data/sg3-utils-1.45/examples/scsi_inquiry.c
Examining data/sg3-utils-1.45/getopt_long/getopt_long.c
Examining data/sg3-utils-1.45/getopt_long/getopt.h

FINAL RESULTS:

data/sg3-utils-1.45/lib/sg_pt_freebsd.c:201:9:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
    s = readlink(device_name,  b, sizeof(b));
data/sg3-utils-1.45/examples/sg_excl.c:83:9:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
        snprintf(ebuff, EBUFF_SZ, ME "error opening file: %s", file_name);
data/sg3-utils-1.45/examples/sg_excl.c:89:9:  [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(ME "%s doesn't seem to be an new sg device\n",
data/sg3-utils-1.45/examples/sg_excl.c:96:9:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
        snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/examples/sg_excl.c:101:9:  [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(ME "second open of %s in violation of O_EXCL\n", file_name);
data/sg3-utils-1.45/getopt_long/getopt_long.c:253:4:  [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.
			fprintf(stderr, illoptchar, optchar);
data/sg3-utils-1.45/getopt_long/getopt_long.c:265:5:  [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.
				fprintf(stderr, recargchar, optchar);
data/sg3-utils-1.45/getopt_long/getopt_long.c:288:6:  [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.
					fprintf(stderr, recargchar, optchar);
data/sg3-utils-1.45/getopt_long/getopt_long.c:364:6:  [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.
					fprintf(stderr, ambig, (int)current_argv_len,
data/sg3-utils-1.45/getopt_long/getopt_long.c:374:6:  [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.
					fprintf(stderr, noarg, (int)current_argv_len,
data/sg3-utils-1.45/getopt_long/getopt_long.c:406:6:  [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.
					fprintf(stderr, recargstring, current_argv);
data/sg3-utils-1.45/getopt_long/getopt_long.c:420:5:  [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.
				fprintf(stderr, illoptstring, current_argv);
data/sg3-utils-1.45/include/sg_pr2serr.h:48:33:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        __attribute__ ((format (printf, 1, 2)));
data/sg3-utils-1.45/include/sg_pr2serr.h:51:33:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        __attribute__ ((format (printf, 1, 2)));
data/sg3-utils-1.45/include/sg_pr2serr.h:54:42:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
                 __attribute__ ((format (printf, 3, 4)));
data/sg3-utils-1.45/lib/sg_lib.c:73:9:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    n = vfprintf(sg_warnings_strm ? sg_warnings_strm : stderr, fmt, args);
data/sg3-utils-1.45/lib/sg_lib.c:95:9:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    n = vsnprintf(cp, cp_max_len, fmt, args);
data/sg3-utils-1.45/lib/sg_lib.c:2802:17:  [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.
                fprintf(fp, formatstr, buff);
data/sg3-utils-1.45/lib/sg_lib.c:2836:13:  [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.
            fprintf(fp, formatstr, buff);
data/sg3-utils-1.45/lib/sg_lib.c:3328:15:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
        res = sscanf(b, "%" SCNx64 , &unum);
data/sg3-utils-1.45/lib/sg_lib.c:3704:9:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    n = vfprintf(stderr, fmt, args);
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:212:12:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
        if(sscanf(b, NVME_CTRLR_PREFIX "%u%c", &nv_ctrlid, &tmp) == 1) {
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:215:20:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
        } else if (sscanf(b, NVME_CTRLR_PREFIX "%d" NVME_NS_PREFIX "%d%c",
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:243:9:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
        snprintf(fdc_p->devname, DEV_IDLEN, NVME_CTRLR_PREFIX"%d",
data/sg3-utils-1.45/lib/sg_pt_win32.c:401:9:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
        strcpy(shp->dname, device_name);
data/sg3-utils-1.45/src/sg_dd.c:1292:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sg_dd.c:1332:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sg_dd.c:1344:21:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                    snprintf(ebuff, EBUFF_SZ, ME "couldn't skip to "
data/sg3-utils-1.45/src/sg_dd.c:1369:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(ebuff, EBUFF_SZ, ME "flock(LOCK_EX | LOCK_NB) on %s "
data/sg3-utils-1.45/src/sg_dd.c:1420:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sg_dd.c:1460:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sg_dd.c:1474:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sg_dd.c:1488:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sg_dd.c:1501:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(ebuff, EBUFF_SZ, ME "flock(LOCK_EX | LOCK_NB) on %s "
data/sg3-utils-1.45/src/sg_dd.c:1856:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sg_dd.c:2071:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ, ME "reading, skip=%" PRId64 " ",
data/sg3-utils-1.45/src/sg_dd.c:2100:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ, ME "writing to of2, seek=%" PRId64
data/sg3-utils-1.45/src/sg_dd.c:2227:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ, ME "writing, seek=%" PRId64 " ",
data/sg3-utils-1.45/src/sg_dd.c:2296:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ, ME "writing(sparse after error), "
data/sg3-utils-1.45/src/sg_decode_sense.c:215:21:  [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(concat_buff, op->no_space_str);
data/sg3-utils-1.45/src/sg_decode_sense.c:225:17:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
                strcat(concat_buff, avp);
data/sg3-utils-1.45/src/sg_get_config.c:150:13:  [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(buff, pdp->desc);
data/sg3-utils-1.45/src/sg_get_config.c:230:13:  [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(buff, feature_desc_arr[k].desc);
data/sg3-utils-1.45/src/sg_logs.c:1224:21:  [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(b, ccp);
data/sg3-utils-1.45/src/sg_logs.c:1360:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(b, blen, "0x%" PRIx64, num);
data/sg3-utils-1.45/src/sg_logs.c:1362:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(b, blen, "%" PRIu64, num);
data/sg3-utils-1.45/src/sg_logs.c:2217:17:  [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("  Total data sets written: %" PRIu64, ull);
data/sg3-utils-1.45/src/sg_logs.c:2237:17:  [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("  Total data sets read: %" PRIu64, ull);
data/sg3-utils-1.45/src/sg_logs.c:2463:13:  [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("  Read compression ratio x100: %" PRIu64 , n);
data/sg3-utils-1.45/src/sg_logs.c:2466:13:  [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("  Write compression ratio x100: %" PRIu64 , n);
data/sg3-utils-1.45/src/sg_logs.c:2469:13:  [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("  Megabytes transferred to server: %" PRIu64 , n);
data/sg3-utils-1.45/src/sg_logs.c:2472:13:  [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("  Bytes transferred to server: %" PRIu64 , n);
data/sg3-utils-1.45/src/sg_logs.c:2475:13:  [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("  Megabytes read from tape: %" PRIu64 , n);
data/sg3-utils-1.45/src/sg_logs.c:2478:13:  [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("  Bytes read from tape: %" PRIu64 , n);
data/sg3-utils-1.45/src/sg_logs.c:2481:13:  [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("  Megabytes transferred from server: %" PRIu64 , n);
data/sg3-utils-1.45/src/sg_logs.c:2484:13:  [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("  Bytes transferred from server: %" PRIu64 , n);
data/sg3-utils-1.45/src/sg_logs.c:2487:13:  [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("  Megabytes written to tape: %" PRIu64 , n);
data/sg3-utils-1.45/src/sg_logs.c:2490:13:  [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("  Bytes written to tape: %" PRIu64 , n);
data/sg3-utils-1.45/src/sg_logs.c:2493:13:  [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("  Data compression enabled: 0x%" PRIx64, n);
data/sg3-utils-1.45/src/sg_logs.c:6773:9:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
        strcpy(b, op->pg_arg);
data/sg3-utils-1.45/src/sg_luns.c:507:21:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
                k = sscanf(cp + 3, " %" SCNx64, &ull);
data/sg3-utils-1.45/src/sg_luns.c:509:21:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
                k = sscanf(cp + 1, " %" SCNu64, &ull);
data/sg3-utils-1.45/src/sg_map.c:162:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy(fname, leadin ? leadin : "/dev/sg");
data/sg3-utils-1.45/src/sg_map.c:165:9:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
        strcat(fname, buff);
data/sg3-utils-1.45/src/sg_map.c:186:9:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
        strcat(fname, buff);
data/sg3-utils-1.45/src/sg_map.c:354:13:  [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(do_extra ? "  -2 -2 -2 -2  -2" : "  busy");
data/sg3-utils-1.45/src/sg_map.c:357:13:  [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(do_extra ? "  -1 -1 -1 -1  -1" : "  not present");
data/sg3-utils-1.45/src/sg_map.c:360:13:  [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(do_extra ? "  -3 -3 -3 -3  -3" : "  some error");
data/sg3-utils-1.45/src/sg_map26.c:136:33:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        __attribute__ ((format (printf, 1, 2)));
data/sg3-utils-1.45/src/sg_map26.c:149:9:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    n = vfprintf(stderr, fmt, args);
data/sg3-utils-1.45/src/sg_map26.c:467:17:  [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(from_sg.name, s->d_name);
data/sg3-utils-1.45/src/sg_map26.c:475:25:  [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(from_sg.name, s->d_name);
data/sg3-utils-1.45/src/sg_map26.c:482:17:  [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(from_sg.name, s->d_name);
data/sg3-utils-1.45/src/sg_map26.c:558:9:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
        strcpy(buff, dir_name);
data/sg3-utils-1.45/src/sg_map26.c:560:9:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
        strcat(buff, base_name);
data/sg3-utils-1.45/src/sg_map26.c:579:9:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
        strcpy(buff, dir_name);
data/sg3-utils-1.45/src/sg_map26.c:581:9:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
        strcat(buff, old_name);
data/sg3-utils-1.45/src/sg_map26.c:590:9:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
        strcpy(buff, dir_name);
data/sg3-utils-1.45/src/sg_map26.c:592:9:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
        strcat(buff, to_sg.name);
data/sg3-utils-1.45/src/sg_map26.c:615:17:  [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(buff, dir_name);
data/sg3-utils-1.45/src/sg_map26.c:618:25:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
                        strcat(buff, base_name);
data/sg3-utils-1.45/src/sg_map26.c:621:17:  [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(buff, base_name);
data/sg3-utils-1.45/src/sg_map26.c:1150:17:  [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(device_dir, device_name);
data/sg3-utils-1.45/src/sg_map26.c:1193:17:  [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(device_dir, def_dev_dir);
data/sg3-utils-1.45/src/sg_map26.c:1201:17:  [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(device_dir, def_dev_dir);
data/sg3-utils-1.45/src/sg_read.c:641:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sg_read.c:684:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(ebuff,  EBUFF_SZ,
data/sg3-utils-1.45/src/sg_read.c:697:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff,  EBUFF_SZ,
data/sg3-utils-1.45/src/sg_read.c:816:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ, ME "reading, skip=%" PRId64 " ",
data/sg3-utils-1.45/src/sg_read_attr.c:486:17:  [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("%" PRIx64, sg_get_unaligned_be(len - 5, alp + 5));
data/sg3-utils-1.45/src/sg_read_attr.c:502:17:  [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("%" PRIx64, sg_get_unaligned_be(len - 5, alp + 5));
data/sg3-utils-1.45/src/sg_read_long.c:288:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sg_read_long.c:300:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(ebuff, EBUFF_SZ, ME "couldn't write to %s", out_fname);
data/sg3-utils-1.45/src/sg_reset.c:73:33:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        __attribute__ ((format (printf, 1, 2)));
data/sg3-utils-1.45/src/sg_reset.c:86:9:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    n = vfprintf(stderr, fmt, args);
data/sg3-utils-1.45/src/sg_reset.c:228:13:  [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(ME "starting device reset\n");
data/sg3-utils-1.45/src/sg_reset.c:233:13:  [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(ME "starting target reset\n");
data/sg3-utils-1.45/src/sg_reset.c:238:13:  [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(ME "starting bus reset\n");
data/sg3-utils-1.45/src/sg_reset.c:243:13:  [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(ME "starting host reset\n");
data/sg3-utils-1.45/src/sg_reset.c:295:13:  [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(ME "did nothing, device is normal mode\n");
data/sg3-utils-1.45/src/sg_reset.c:297:13:  [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(ME "completed device %sreset\n", (no_escalate ?
data/sg3-utils-1.45/src/sg_reset.c:300:13:  [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(ME "completed target %sreset\n", (no_escalate ?
data/sg3-utils-1.45/src/sg_reset.c:303:13:  [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(ME "completed bus %sreset\n", (no_escalate ?
data/sg3-utils-1.45/src/sg_reset.c:306:13:  [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(ME "completed host reset\n");
data/sg3-utils-1.45/src/sg_sanitize.c:681:21:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                    snprintf(ebuff, EBUFF_SZ, ME "could not open %s for "
data/sg3-utils-1.45/src/sg_sanitize.c:692:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ, ME "couldn't read from %s",
data/sg3-utils-1.45/src/sg_scan_linux.c:149:9:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
        strcat(fname, buff);
data/sg3-utils-1.45/src/sg_scan_linux.c:155:13:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
            strcat(fname, buff);
data/sg3-utils-1.45/src/sg_scan_linux.c:165:13:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
            strcat(fname, buff);
data/sg3-utils-1.45/src/sg_scan_linux.c:203:9:  [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(ME "Out of memory\n");
data/sg3-utils-1.45/src/sg_scan_linux.c:277:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(ebuff, EBUFF_SZ, ME "Error closing %s ", fname);
data/sg3-utils-1.45/src/sg_scan_linux.c:317:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ, ME "Error opening %s ", file_namep);
data/sg3-utils-1.45/src/sg_scan_linux.c:328:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(ebuff, EBUFF_SZ, ME "device %s failed on scsi+ata "
data/sg3-utils-1.45/src/sg_scan_linux.c:336:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(ebuff, EBUFF_SZ, ME "device %s failed on scsi "
data/sg3-utils-1.45/src/sg_scan_linux.c:358:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ, ME "device %s failed "
data/sg3-utils-1.45/src/sg_scan_linux.c:424:13:  [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(ME "SCSI_IOCTL_SEND_COMMAND ioctl error=0x%x\n", err);
data/sg3-utils-1.45/src/sg_ses.c:1185:17:  [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(op->cgs_cl_arr[op->num_cgs].cgs_str, optarg);
data/sg3-utils-1.45/src/sg_ses.c:1225:17:  [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(op->cgs_cl_arr[op->num_cgs].cgs_str, optarg);
data/sg3-utils-1.45/src/sg_ses.c:1330:17:  [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(op->cgs_cl_arr[op->num_cgs].cgs_str, optarg);
data/sg3-utils-1.45/src/sg_ses.c:1738:17:  [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(b, etp->desc);
data/sg3-utils-1.45/src/sg_ses_microcode.c:731:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sg_ses_microcode.c:779:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff,  EBUFF_SZ, ME "couldn't skip to "
data/sg3-utils-1.45/src/sg_ses_microcode.c:788:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(ebuff, EBUFF_SZ, ME "couldn't read from %s",
data/sg3-utils-1.45/src/sg_verify.c:368:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sg_write_buffer.c:429:21:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                    snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sg_write_buffer.c:438:25:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                        snprintf(ebuff,  EBUFF_SZ, ME "couldn't skip to "
data/sg3-utils-1.45/src/sg_write_buffer.c:454:21:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                    snprintf(ebuff, EBUFF_SZ, ME "couldn't read from STDIN");
data/sg3-utils-1.45/src/sg_write_buffer.c:486:21:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                    snprintf(ebuff, EBUFF_SZ, ME "couldn't read from %s",
data/sg3-utils-1.45/src/sg_write_long.c:260:21:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                    snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sg_write_long.c:269:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ, ME "couldn't read from %s",
data/sg3-utils-1.45/src/sg_write_same.c:611:21:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                    snprintf(ebuff, EBUFF_SZ, ME "could not open %.400s for "
data/sg3-utils-1.45/src/sg_write_same.c:621:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ, ME "couldn't read from %.400s",
data/sg3-utils-1.45/src/sg_xcopy.c:338:9:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
        snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sg_xcopy.c:1225:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sg_xcopy.c:1238:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(ebuff, EBUFF_SZ, ME "flock(LOCK_EX | LOCK_NB) on %.500s "
data/sg3-utils-1.45/src/sg_xcopy.c:1271:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sg_xcopy.c:1284:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(ebuff, EBUFF_SZ, ME "flock(LOCK_EX | LOCK_NB) on %.500s "
data/sg3-utils-1.45/src/sginfo.c:649:9:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
        snprintf(reason, REASON_SZ,
data/sg3-utils-1.45/src/sginfo.c:655:9:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
        snprintf(reason, REASON_SZ,
data/sg3-utils-1.45/src/sginfo.c:1797:21:  [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("%15" PRId64 , getnbyte_ll(df, 8));
data/sg3-utils-1.45/src/sginfo.c:3382:13:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
            strcat(fname, buff);
data/sg3-utils-1.45/src/sgm_dd.c:983:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sgm_dd.c:1014:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sgm_dd.c:1029:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sgm_dd.c:1040:21:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                    snprintf(ebuff, EBUFF_SZ, ME "couldn't skip to "
data/sg3-utils-1.45/src/sgm_dd.c:1072:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ, ME "could not open %s for "
data/sg3-utils-1.45/src/sgm_dd.c:1102:21:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                    snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sgm_dd.c:1124:21:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                    snprintf(ebuff, EBUFF_SZ,
data/sg3-utils-1.45/src/sgm_dd.c:1133:21:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                    snprintf(ebuff, EBUFF_SZ, ME "could not open %s "
data/sg3-utils-1.45/src/sgm_dd.c:1145:21:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                    snprintf(ebuff, EBUFF_SZ, ME "couldn't seek to "
data/sg3-utils-1.45/src/sgm_dd.c:1336:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ, ME "reading, skip=%" PRId64 " ",
data/sg3-utils-1.45/src/sgm_dd.c:1391:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ, ME "writing, seek=%" PRId64 " ",
data/sg3-utils-1.45/src/sgp_dd.c:1244:17:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                snprintf(ebuff, EBUFF_SZ, "%s blk=%" PRId64,
data/sg3-utils-1.45/testing/sg_iovec_tst.c:239:9:  [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(ME "not a sg device, or driver prior to 3.x\n");
data/sg3-utils-1.45/testing/sg_tst_async.cpp:402:33:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        __attribute__ ((format (printf, 1, 2)));
data/sg3-utils-1.45/testing/sg_tst_async.cpp:404:33:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        __attribute__ ((format (printf, 2, 3)));
data/sg3-utils-1.45/testing/sg_tst_async.cpp:419:9:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    n = vfprintf(stderr, fmt, args);
data/sg3-utils-1.45/testing/sg_tst_async.cpp:432:5:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    vsnprintf(b, sizeof(b), fmt, args);
data/sg3-utils-1.45/testing/sg_tst_async.cpp:1513:25:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
                        snprintf(ebuff, sizeof(ebuff), "%s: lba=0x%" PRIx64 ,
data/sg3-utils-1.45/testing/sg_tst_context.cpp:170:9:  [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.
        fprintf(stderr, cp, b);
data/sg3-utils-1.45/testing/sgh_dd.cpp:416:33:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        __attribute__ ((format (printf, 1, 2)));
data/sg3-utils-1.45/testing/sgh_dd.cpp:419:33:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        __attribute__ ((format (printf, 2, 3)));
data/sg3-utils-1.45/testing/sgh_dd.cpp:437:9:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    n = vfprintf(stderr, fmt, args);
data/sg3-utils-1.45/testing/sgh_dd.cpp:452:5:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    vsnprintf(b, sizeof(b), fmt, args);
data/sg3-utils-1.45/testing/sgh_dd.cpp:3144:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(ebuff, EBUFF_SZ, "%s blk=%" PRId64, cp, blk);
data/sg3-utils-1.45/testing/sgh_dd.cpp:3213:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(ebuff, EBUFF_SZ, "%s rq_id=%d, blk=%" PRId64, cp,
data/sg3-utils-1.45/utils/hxascdmp.c:121:15:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
        res = sscanf(b + 2, "%" SCNx64 , &unum);
data/sg3-utils-1.45/utils/hxascdmp.c:124:15:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
        res = sscanf(b, "%" SCNx64 , &unum);
data/sg3-utils-1.45/examples/sg__sat_phy_event.c:177:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "hHirRvV",
data/sg3-utils-1.45/examples/sg__sat_set_features.c:126:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "c:Cf:hL:vV", long_options,
data/sg3-utils-1.45/getopt_long/getopt.h:81:5:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
int getopt_long(int, char * const *, const char *,
data/sg3-utils-1.45/getopt_long/getopt_long.c:66:14:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
__weak_alias(getopt_long,_getopt_long)
data/sg3-utils-1.45/getopt_long/getopt_long.c:73:29:  [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.
#define IS_POSIXLY_CORRECT (getenv("POSIXLY_CORRECT") != NULL)
data/sg3-utils-1.45/getopt_long/getopt_long.c:306:1:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
getopt_long(int nargc, char * const *nargv, const char *options,
data/sg3-utils-1.45/lib/sg_lib.c:116:10:  [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.
    cp = getenv("SG3_UTILS_DSENSE");
data/sg3-utils-1.45/lib/sg_pt_linux.c:561: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.
            getenv("SG3_UTILS_LINUX_NANO")) {
data/sg3-utils-1.45/lib/sg_pt_linux.c:582:23:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
                   && getenv("SG3_UTILS_LINUX_NANO")) {
data/sg3-utils-1.45/src/sg_bg_ctl.c:156:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "c:ht:vV", long_options, &option_index);
data/sg3-utils-1.45/src/sg_compare_and_write.c:192:21:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
                c = getopt_long(argc, argv, "C:dD:fFg:hi:l:n:qt:vVw:x:",
data/sg3-utils-1.45/src/sg_copy_results.c:330:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "fhHl:prRsvVx:", long_options,
data/sg3-utils-1.45/src/sg_decode_sense.c:132:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "b:ce:f:hHns:vVw:", long_options, NULL);
data/sg3-utils-1.45/src/sg_format.c:1229:21:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
                c = getopt_long(argc, argv,
data/sg3-utils-1.45/src/sg_get_config.c:974:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "bchHilqr:Rs:vV", long_options,
data/sg3-utils-1.45/src/sg_get_elem_status.c:257:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "bf:hHi:m:rRs:St:TvV", long_options,
data/sg3-utils-1.45/src/sg_get_lba_status.c:196:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "be:hi:Hl:m:rRs:St:TvV", long_options,
data/sg3-utils-1.45/src/sg_ident.c:140:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "AChi:rSvV", long_options,
data/sg3-utils-1.45/src/sg_inq.c:464:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "aB:cdeEfhHiI:l:Lm:NoOp:rsuvVx",
data/sg3-utils-1.45/src/sg_inq.c:467:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "B:cdeEfhHiI:l:Lm:op:rsuvVx",
data/sg3-utils-1.45/src/sg_inq.c:472:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "B:cdeEfhHiI:l:Lm:NoOp:rsuvVx",
data/sg3-utils-1.45/src/sg_inq.c:475:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "B:cdeEfhHiI:l:Lm:op:rsuvVx",
data/sg3-utils-1.45/src/sg_inq.c:799:10:  [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.
    cp = getenv("SG3_UTILS_OLD_OPTS");
data/sg3-utils-1.45/src/sg_logs.c:914:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "aAbc:D:ef:hHi:lLm:M:nNOp:P:qQrRsStTvV"
data/sg3-utils-1.45/src/sg_logs.c:1323:10:  [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.
    cp = getenv("SG3_UTILS_OLD_OPTS");
data/sg3-utils-1.45/src/sg_luns.c:396:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "dhHlLm:qrRs:t:vV", long_options,
data/sg3-utils-1.45/src/sg_luns.c:399:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "dhHLm:qrRs:t:vV", long_options,
data/sg3-utils-1.45/src/sg_map26.c:1063:21:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
                c = getopt_long(argc, argv, "d:hg:r:svV", long_options,
data/sg3-utils-1.45/src/sg_modes.c:444:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "6aAc:dDefhHlLm:NOp:rRsvV", long_options,
data/sg3-utils-1.45/src/sg_modes.c:759:10:  [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.
    cp = getenv("SG3_UTILS_OLD_OPTS");
data/sg3-utils-1.45/src/sg_opcodes.c:318:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "acehHmMnNo:Op:qrRs:tuvV", long_options,
data/sg3-utils-1.45/src/sg_opcodes.c:577:10:  [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.
    cp = getenv("SG3_UTILS_OLD_OPTS");
data/sg3-utils-1.45/src/sg_persist.c:972:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv,
data/sg3-utils-1.45/src/sg_persist.c:1286:14:  [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.
        cp = getenv(SG_PERSIST_IN_RDONLY);
data/sg3-utils-1.45/src/sg_prevent.c:83:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "ahp:vV", long_options,
data/sg3-utils-1.45/src/sg_raw.c:161:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "bc:ehi:k:no:r:Rs:t:vVw", long_options,
data/sg3-utils-1.45/src/sg_rbuf.c:162:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "b:dehmNOqs:tvV", long_options,
data/sg3-utils-1.45/src/sg_rbuf.c:339:10:  [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.
    cp = getenv("SG3_UTILS_OLD_OPTS");
data/sg3-utils-1.45/src/sg_read_attr.c:754:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "ceE:f:F:hHi:l:m:p:qrRs:vV",
data/sg3-utils-1.45/src/sg_read_block_limits.c:102:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "hHrRvV", long_options,
data/sg3-utils-1.45/src/sg_read_buffer.c:435:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "hHi:I:l:Lm:o:rRS:vV", long_options,
data/sg3-utils-1.45/src/sg_read_long.c:153:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "chl:o:prSvVx:", long_options,
data/sg3-utils-1.45/src/sg_readcap.c:166:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "16bhHlL:NOprRvVz", long_options,
data/sg3-utils-1.45/src/sg_readcap.c:361:10:  [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.
    cp = getenv("SG3_UTILS_OLD_OPTS");
data/sg3-utils-1.45/src/sg_reassign.c:247:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "a:de:ghHl:pvV", long_options,
data/sg3-utils-1.45/src/sg_referrals.c:197:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "hHl:m:rRsvV", long_options,
data/sg3-utils-1.45/src/sg_rep_zones.c:320:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "hHm:n:o:prRs:vVw", long_options,
data/sg3-utils-1.45/src/sg_requests.c:161:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "dehHm:n:prstvV", long_options,
data/sg3-utils-1.45/src/sg_reset.c:140:10:  [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.
    cp = getenv("SG3_UTILS_OLD_OPTS");
data/sg3-utils-1.45/src/sg_reset.c:142:14:  [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.
        cp = getenv("SG_RESET_OLD_OPTS");
data/sg3-utils-1.45/src/sg_reset.c:147:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "bdhHNtvVz", long_options,
data/sg3-utils-1.45/src/sg_reset_wp.c:154:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "aC:hRvVz:", long_options,
data/sg3-utils-1.45/src/sg_rmsn.c:83:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "hrRvV", long_options,
data/sg3-utils-1.45/src/sg_rtpg.c:167:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "dehHrRvV", long_options,
data/sg3-utils-1.45/src/sg_safte.c:544:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "cdfhHirsuvV?", long_options,
data/sg3-utils-1.45/src/sg_sanitize.c:467:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "ABc:CdDeFhi:IOp:Qt:T:vVwzZ",
data/sg3-utils-1.45/src/sg_sat_identify.c:416:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "cehHil:prRvV", long_options,
data/sg3-utils-1.45/src/sg_sat_phy_event.c:390:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "cehHil:rRvV",
data/sg3-utils-1.45/src/sg_sat_read_gplog.c:351:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "c:CdhHl:L:p:rvV", long_options,
data/sg3-utils-1.45/src/sg_sat_set_features.c:324:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "c:Cef:hl:L:rvV", long_options,
data/sg3-utils-1.45/src/sg_scan_win32.c:674:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "bhHl:svV", long_options,
data/sg3-utils-1.45/src/sg_seek.c:176:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "c:g:hil:n:prs:tTvVw:", long_options,
data/sg3-utils-1.45/src/sg_senddiag.c:177:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "dehHlm:NOpP:r:s:tT:uvV", long_options,
data/sg3-utils-1.45/src/sg_senddiag.c:403:10:  [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.
    cp = getenv("SG3_UTILS_OLD_OPTS");
data/sg3-utils-1.45/src/sg_ses.c:1145:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "A:b:cC:d:D:eE:fG:hHiI:jln:N:m:Mp:qrRs"
data/sg3-utils-1.45/src/sg_ses_microcode.c:512:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "b:dehi:I:l:m:No:s:S:t:vV", long_options,
data/sg3-utils-1.45/src/sg_start.c:182:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "ef:hilLm:nNOp:rsSvV", long_options,
data/sg3-utils-1.45/src/sg_start.c:471:10:  [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.
    cp = getenv("SG3_UTILS_OLD_OPTS");
data/sg3-utils-1.45/src/sg_stpg.c:445:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "ahHloOrsS:t:uvV", long_options,
data/sg3-utils-1.45/src/sg_stream_ctl.c:269:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "bcC:ghi:m:orvV", long_options,
data/sg3-utils-1.45/src/sg_sync.c:173:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "c:g:hil:sSt:vV", long_options,
data/sg3-utils-1.45/src/sg_test_rwbuf.c:203:9:  [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 (time (0));
data/sg3-utils-1.45/src/sg_test_rwbuf.c:407:21:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
                c = getopt_long(argc, argv, "hqr:s:t:w:vV",
data/sg3-utils-1.45/src/sg_timestamp.c:343:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "ehHm:NorRs:SvV", long_options,
data/sg3-utils-1.45/src/sg_turs.c:155:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "hln:NOptvV", long_options,
data/sg3-utils-1.45/src/sg_turs.c:298:10:  [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.
    cp = getenv("SG3_UTILS_OLD_OPTS");
data/sg3-utils-1.45/src/sg_unmap.c:396:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "aA:dfg:hI:Hl:n:t:vV", long_options,
data/sg3-utils-1.45/src/sg_verify.c:171:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "0b:B:c:dE:fg:hi:l:n:P:qrSvV",
data/sg3-utils-1.45/src/sg_vpd.c:3605:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "aeEfhHiI:lm:M:p:qrvV", long_options,
data/sg3-utils-1.45/src/sg_wr_mode.c:353:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "6c:dfhl:m:p:RsvV", long_options,
data/sg3-utils-1.45/src/sg_write_buffer.c:226:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "b:dhi:I:l:m:o:rs:S:t:vV", long_options,
data/sg3-utils-1.45/src/sg_write_long.c:130:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "chi:l:pSvVwx:", long_options,
data/sg3-utils-1.45/src/sg_write_same.c:344:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "afg:hi:l:Ln:NPRSt:TUvVw:x:",
data/sg3-utils-1.45/src/sg_write_verify.c:307:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "b:dg:hi:I:l:n:RSt:w:vV", long_options,
data/sg3-utils-1.45/src/sg_write_x.c:1508:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, opt_long_ctl_str, long_options, &opt_ind);
data/sg3-utils-1.45/src/sg_xcopy.c:1563: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.
            csp = getenv(XCOPY_TO_SRC);
data/sg3-utils-1.45/src/sg_xcopy.c:1564: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.
            cdp = getenv(XCOPY_TO_DST);
data/sg3-utils-1.45/src/sg_zone.c:191:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "acC:fhoRSvVz:", long_options,
data/sg3-utils-1.45/src/sginfo.c:3749: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 ((k = getopt(argc, argv, "6aAcCdDeEfgGiIlmMnNPrRsSTvVXzF:t:u:")) !=
data/sg3-utils-1.45/testing/sg_chk_asc.c:81:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "ho:vV", long_options,
data/sg3-utils-1.45/testing/sg_sense_test.c:109:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "hl:svV", long_options,
data/sg3-utils-1.45/testing/sg_tst_async.cpp:1789:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv,
data/sg3-utils-1.45/testing/sg_tst_async.cpp:2046:27:  [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 (! op->cmd_time && getenv("SG3_UTILS_LINUX_NANO")) {
data/sg3-utils-1.45/testing/sg_tst_nvme.c:612:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "cdhlm:n:s:t:vV", long_options,
data/sg3-utils-1.45/testing/sgh_dd.cpp:4066:44:  [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.
    clp->unit_nanosec = (do_time > 1) || !!getenv("SG3_UTILS_LINUX_NANO");
data/sg3-utils-1.45/testing/sgs_dd.c:1034:26:  [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.
    sgs_nanosec_unit = !!getenv("SG3_UTILS_LINUX_NANO");
data/sg3-utils-1.45/testing/tst_sg_lib.c:237:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "b:ehHl:n:psuvV", long_options,
data/sg3-utils-1.45/examples/scsi_inquiry.c:38:18:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        unsigned char data[1];  /* was 0 but that's not ISO C!! */
data/sg3-utils-1.45/examples/scsi_inquiry.c:56:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char inq_cdb [INQUIRY_CMDLEN] = {INQUIRY_CMD, 0, 0, 0,
data/sg3-utils-1.45/examples/scsi_inquiry.c:88: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).
    s_fd = open(file_name, oflags | O_RDWR);
data/sg3-utils-1.45/examples/scsi_inquiry.c:91: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).
            s_fd = open(file_name, oflags | O_RDONLY);
data/sg3-utils-1.45/examples/scsi_inquiry.c:112:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(buffp, inq_cdb, INQUIRY_CMDLEN);
data/sg3-utils-1.45/examples/sg__sat_identify.c:90: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/examples/sg__sat_identify.c:134: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).
    if ((sg_fd = open(file_name, O_RDWR)) < 0) {
data/sg3-utils-1.45/examples/sg__sat_phy_event.c:154: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/examples/sg__sat_phy_event.c:229: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).
    if ((sg_fd = open(device_name, O_RDWR)) < 0) {
data/sg3-utils-1.45/examples/sg__sat_set_features.c:107: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 device_name[256];
data/sg3-utils-1.45/examples/sg__sat_set_features.c:108: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/examples/sg__sat_set_features.c:193: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).
    if ((sg_fd = open(device_name, O_RDWR)) < 0) {
data/sg3-utils-1.45/examples/sg_excl.c:56: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/examples/sg_excl.c:82: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).
    if ((sg_fd = open(file_name, O_RDWR | O_EXCL | O_NONBLOCK)) < 0) {
data/sg3-utils-1.45/examples/sg_excl.c:95:19:  [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 ((sg_fd2 = open(file_name, O_RDWR | O_EXCL)) < 0) {
data/sg3-utils-1.45/examples/sg_sat_chk_power.c:108: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/examples/sg_sat_chk_power.c:147: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).
    if ((sg_fd = open(file_name, O_RDWR)) < 0) {
data/sg3-utils-1.45/examples/sg_sat_smart_rd_data.c:70:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char ebuff[EBUFF_SZ];
data/sg3-utils-1.45/examples/sg_sat_smart_rd_data.c:110: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).
    if ((sg_fd = open(file_name, O_RDWR)) < 0) {
data/sg3-utils-1.45/examples/sg_simple1.c:52:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char inq_cdb [INQ_CMD_LEN] =
data/sg3-utils-1.45/examples/sg_simple1.c:54:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char tur_cdb [TUR_CMD_LEN] =
data/sg3-utils-1.45/examples/sg_simple1.c:56:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char inqBuff[INQ_REPLY_LEN];
data/sg3-utils-1.45/examples/sg_simple1.c:59: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/examples/sg_simple1.c:60:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char sense_buffer[32];
data/sg3-utils-1.45/examples/sg_simple1.c:85: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).
    if ((sg_fd = open(file_name, O_RDONLY)) < 0) {
data/sg3-utils-1.45/examples/sg_simple16.c:41:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char ebuff[EBUFF_SZ];
data/sg3-utils-1.45/examples/sg_simple16.c:64: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).
    if ((sg_fd = open(file_name, O_RDWR)) < 0) {
data/sg3-utils-1.45/examples/sg_simple2.c:49:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char inq_cdb[INQ_CMD_LEN] =
data/sg3-utils-1.45/examples/sg_simple2.c:51:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char tur_cdb[TUR_CMD_LEN] =
data/sg3-utils-1.45/examples/sg_simple2.c:53:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char inqBuff[INQ_REPLY_LEN];
data/sg3-utils-1.45/examples/sg_simple2.c:56: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/examples/sg_simple2.c:57:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char sense_buffer[32];
data/sg3-utils-1.45/examples/sg_simple2.c:82: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).
    if ((sg_fd = open(file_name, O_RDONLY)) < 0) {
data/sg3-utils-1.45/examples/sg_simple3.c:51:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char inq_cdb[INQ_CMD_LEN] = {0x12, 0, 0, 0,
data/sg3-utils-1.45/examples/sg_simple3.c:54:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char tur_cdb[TUR_CMD_LEN] = {0x00, 0, 0, 0, 0, 0};
data/sg3-utils-1.45/examples/sg_simple3.c:56:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char inqBaseBuff[INQ_REPLY_BASE_LEN];
data/sg3-utils-1.45/examples/sg_simple3.c:57:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char inqVidBuff[INQ_REPLY_VID_LEN];
data/sg3-utils-1.45/examples/sg_simple3.c:58: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 inqPidBuff[INQ_REPLY_PID_LEN];
data/sg3-utils-1.45/examples/sg_simple3.c:59: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 inqPRevBuff[INQ_REPLY_PREV_LEN];
data/sg3-utils-1.45/examples/sg_simple3.c:62: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/examples/sg_simple3.c:63:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char sense_buffer[32];
data/sg3-utils-1.45/examples/sg_simple3.c:88: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).
    if ((sg_fd = open(file_name, O_RDONLY)) < 0) {
data/sg3-utils-1.45/examples/sg_simple4.c:50:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char inq_cdb[INQ_CMD_LEN] =
data/sg3-utils-1.45/examples/sg_simple4.c:52:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char tur_cdb[TUR_CMD_LEN] =
data/sg3-utils-1.45/examples/sg_simple4.c:58: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/examples/sg_simple4.c:59:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char sense_buffer[32];
data/sg3-utils-1.45/examples/sg_simple4.c:84: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).
    if ((sg_fd = open(file_name, O_RDWR)) < 0) {
data/sg3-utils-1.45/examples/sg_simple5.c:42:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char b[512];
data/sg3-utils-1.45/examples/sgq_dd.c:544:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(&rep->io_hdr, &io_hdr, sizeof(sg_io_hdr_t));
data/sg3-utils-1.45/examples/sgq_dd.c:558:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char ebuff[EBUFF_SZ];
data/sg3-utils-1.45/examples/sgq_dd.c:617: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/examples/sgq_dd.c:641:34:  [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 ((rep->infd = open(inf, O_RDWR)) < 0) {
data/sg3-utils-1.45/examples/sgq_dd.c:663:35:  [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 ((rep->outfd = open(outf, O_RDWR)) < 0) {
data/sg3-utils-1.45/examples/sgq_dd.c:743:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[STR_SZ];
data/sg3-utils-1.45/examples/sgq_dd.c:746: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 inf[INOUTF_SZ];
data/sg3-utils-1.45/examples/sgq_dd.c:747: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 outf[INOUTF_SZ];
data/sg3-utils-1.45/examples/sgq_dd.c:756: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/examples/sgq_dd.c:903:31:  [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 ((rcoll.infd = open(inf, O_RDWR)) < 0) {
data/sg3-utils-1.45/examples/sgq_dd.c:911:31:  [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 ((rcoll.infd = open(inf, O_RDONLY)) < 0) {
data/sg3-utils-1.45/examples/sgq_dd.c:934:32:  [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 ((rcoll.outfd = open(outf, O_RDWR)) < 0) {
data/sg3-utils-1.45/examples/sgq_dd.c:943:36:  [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 ((rcoll.outfd = open(outf, O_WRONLY | O_CREAT, 0666)) < 0) {
data/sg3-utils-1.45/examples/sgq_dd.c:951:36:  [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 ((rcoll.outfd = open(outf, O_WRONLY)) < 0) {
data/sg3-utils-1.45/examples/sgq_dd.c:1217:19:  [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(proc_allow_dio, O_RDONLY)) >= 0) {
data/sg3-utils-1.45/getopt_long/getopt_long.c:157:6:  [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 **) nargv)[pos] = nargv[cstart];
data/sg3-utils-1.45/getopt_long/getopt_long.c:159:6:  [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 **)nargv)[cstart] = swap;
data/sg3-utils-1.45/include/sg_cmds_basic.h:256: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 vendor[9];             /* T10 field is 8 bytes, NUL char appended */
data/sg3-utils-1.45/include/sg_cmds_basic.h:257: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 product[17];
data/sg3-utils-1.45/include/sg_cmds_basic.h:258: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 revision[5];
data/sg3-utils-1.45/include/sg_unaligned.h:74:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 2);
data/sg3-utils-1.45/include/sg_unaligned.h:82:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 4);
data/sg3-utils-1.45/include/sg_unaligned.h:90:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 8);
data/sg3-utils-1.45/include/sg_unaligned.h:98:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &u, 2);
data/sg3-utils-1.45/include/sg_unaligned.h:105:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &u, 4);
data/sg3-utils-1.45/include/sg_unaligned.h:112:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &u, 8);
data/sg3-utils-1.45/include/sg_unaligned.h:119:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 2);
data/sg3-utils-1.45/include/sg_unaligned.h:127:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 4);
data/sg3-utils-1.45/include/sg_unaligned.h:135:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 8);
data/sg3-utils-1.45/include/sg_unaligned.h:141:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &val, 2);
data/sg3-utils-1.45/include/sg_unaligned.h:146:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &val, 4);
data/sg3-utils-1.45/include/sg_unaligned.h:151:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &val, 8);
data/sg3-utils-1.45/include/sg_unaligned.h:166:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 2);
data/sg3-utils-1.45/include/sg_unaligned.h:174:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 4);
data/sg3-utils-1.45/include/sg_unaligned.h:182:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 8);
data/sg3-utils-1.45/include/sg_unaligned.h:190:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &u, 2);
data/sg3-utils-1.45/include/sg_unaligned.h:197:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &u, 4);
data/sg3-utils-1.45/include/sg_unaligned.h:204:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &u, 8);
data/sg3-utils-1.45/include/sg_unaligned.h:211:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 2);
data/sg3-utils-1.45/include/sg_unaligned.h:219:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 4);
data/sg3-utils-1.45/include/sg_unaligned.h:227:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 8);
data/sg3-utils-1.45/include/sg_unaligned.h:233:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &val, 2);
data/sg3-utils-1.45/include/sg_unaligned.h:238:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &val, 4);
data/sg3-utils-1.45/include/sg_unaligned.h:243:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &val, 8);
data/sg3-utils-1.45/lib/sg_cmds_basic.c:116: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 b[512];
data/sg3-utils-1.45/lib/sg_cmds_basic.c:198: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 b[1024];
data/sg3-utils-1.45/lib/sg_cmds_basic.c:392:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_basic.c:540:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(inq_data->vendor, inq_resp + 8, 8);
data/sg3-utils-1.45/lib/sg_cmds_basic.c:541:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(inq_data->product, inq_resp + 16, 16);
data/sg3-utils-1.45/lib/sg_cmds_basic.c:542:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(inq_data->revision, inq_resp + 32, 4);
data/sg3-utils-1.45/lib/sg_cmds_basic.c:582:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(inq_data->vendor, inq_resp + 8, 8);
data/sg3-utils-1.45/lib/sg_cmds_basic.c:583:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(inq_data->product, inq_resp + 16, 16);
data/sg3-utils-1.45/lib/sg_cmds_basic.c:584:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(inq_data->revision, inq_resp + 32, 4);
data/sg3-utils-1.45/lib/sg_cmds_basic.c:607:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_basic.c:706:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_basic.c:783:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_basic2.c:112:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_basic2.c:164:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_basic2.c:214:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_basic2.c:268:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_basic2.c:363:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_basic2.c:448:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_basic2.c:516:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_basic2.c:664: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/lib/sg_cmds_basic2.c:762:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(pcontrol_arr[k], buff + offset, xfer_len);
data/sg3-utils-1.45/lib/sg_cmds_basic2.c:813:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_basic2.c:893:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_basic2.c:976:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_basic2.c:1026:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:139:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:215:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:285:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:345:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:401:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:478:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:553:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:659:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:719:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:782:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:844:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:935:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:992:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:1048:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:1113:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:1192:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:1282:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:1373:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:1453:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:1531:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:1609:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:1697: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 b[256];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:1705:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(apt_cdb + 1, cdbp + 1,  10);
data/sg3-utils-1.45/lib/sg_cmds_extra.c:1711:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(apt_cdb + 1, cdbp + 1,  14);
data/sg3-utils-1.45/lib/sg_cmds_extra.c:1720:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(apt_cdb + 10, cdbp + 10,  32 - 10);
data/sg3-utils-1.45/lib/sg_cmds_extra.c:1740:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char d[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:1799:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(sensep, sp, k);
data/sg3-utils-1.45/lib/sg_cmds_extra.c:1807:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(ata_return_dp, bp, k);
data/sg3-utils-1.45/lib/sg_cmds_extra.c:1855:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:1917:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:1994:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:2067:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:2117:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:2173: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 b[64];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:2184:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char d[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:2239:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:2290: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 cname[80];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:2316:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_cmds_extra.c:2417:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/lib/sg_lib.c:222: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 buff[CMD_NAME_LEN];
data/sg3-utils-1.45/lib/sg_lib.c:275: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 buff[128];
data/sg3-utils-1.45/lib/sg_lib.c:876: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 e[64];
data/sg3-utils-1.45/lib/sg_lib.c:1339: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 c[40];
data/sg3-utils-1.45/lib/sg_lib.c:1396: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 z[64];
data/sg3-utils-1.45/lib/sg_lib.c:1581:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char c[480];
data/sg3-utils-1.45/lib/sg_lib.c:1668:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char d[80];
data/sg3-utils-1.45/lib/sg_lib.c:1745: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 ebuff[64];
data/sg3-utils-1.45/lib/sg_lib.c:1746: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 b[256];
data/sg3-utils-1.45/lib/sg_lib.c:1938:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char z[64];
data/sg3-utils-1.45/lib/sg_lib.c:2034: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 b[256];
data/sg3-utils-1.45/lib/sg_lib.c:2284: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 b[80];
data/sg3-utils-1.45/lib/sg_lib.c:2729: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 safe_errbuf[64] = {'u', 'n', 'k', 'n', 'o', 'w', 'n', ' ',
data/sg3-utils-1.45/lib/sg_lib.c:2774: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 buff[82];
data/sg3-utils-1.45/lib/sg_lib.c:2883: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 buff[DSHS_LINE_BLEN + 2];
data/sg3-utils-1.45/lib/sg_lib.c:2884: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 a[DSHS_BPL + 1];
data/sg3-utils-1.45/lib/sg_lib.c:2912:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(buff, leadin, bpstart);
data/sg3-utils-1.45/lib/sg_lib.c:2935:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(buff, leadin, bpstart);
data/sg3-utils-1.45/lib/sg_lib.c:3034: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 buff[82];
data/sg3-utils-1.45/lib/sg_lib.c:3134: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 lb[16];
data/sg3-utils-1.45/lib/sg_lib.c:3152:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(lb, buf, len);
data/sg3-utils-1.45/lib/sg_lib.c:3297: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 lb[32];
data/sg3-utils-1.45/lib/sg_lib.c:3315:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(lb, buf, len);
data/sg3-utils-1.45/lib/sg_lib.c:3473: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 line[512];
data/sg3-utils-1.45/lib/sg_lib.c:3474: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 carry_over[4];
data/sg3-utils-1.45/lib/sg_lib.c:3486: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).
            fd = open(fname, O_RDONLY);
data/sg3-utils-1.45/lib/sg_lib.c:3533:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fp = fopen(fname, "r");
data/sg3-utils-1.45/lib/sg_lib_data.c:1479: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.
const char * sg_lib_pdt_strs[32] = {    /* should have 2**5 elements */
data/sg3-utils-1.45/lib/sg_pt_common.c:117: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 b[4];
data/sg3-utils-1.45/lib/sg_pt_common.c:133:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(dop + 8, nvme_scsi_vendor_str, 8); /* N.B. this is "NVMe    " */
data/sg3-utils-1.45/lib/sg_pt_common.c:134:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(dop + 16, nvme_id_ctl_p + 24, 40);  /* MN */
data/sg3-utils-1.45/lib/sg_pt_common.c:146:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(dop + n, nvme_id_ctl_p + 4, 20); /* SN */
data/sg3-utils-1.45/lib/sg_pt_common.c:173:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(dop + n + 4, nvme_id_ns_p + 104, 16);
data/sg3-utils-1.45/lib/sg_pt_common.c:180:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(dop + n + 4, "eui.", 4);
data/sg3-utils-1.45/lib/sg_pt_common.c:183:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(dop + n + 8 + (2 * k), b, 2);
data/sg3-utils-1.45/lib/sg_pt_common.c:192:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(dop + n + 4, nvme_id_ns_p + 120, 8);
data/sg3-utils-1.45/lib/sg_pt_common.c:199:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(dop + n + 4, "eui.", 4);
data/sg3-utils-1.45/lib/sg_pt_common.c:202:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(dop + n + 8 + (2 * k), b, 2);
data/sg3-utils-1.45/lib/sg_pt_common.c:215:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(p, disconnect_pg, sizeof(disconnect_pg));
data/sg3-utils-1.45/lib/sg_pt_common.c:233:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(p, ctrl_m_pg, sizeof(ctrl_m_pg));
data/sg3-utils-1.45/lib/sg_pt_common.c:235:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p + 2, ch_ctrl_m_pg, sizeof(ch_ctrl_m_pg));
data/sg3-utils-1.45/lib/sg_pt_common.c:237:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, d_ctrl_m_pg, sizeof(d_ctrl_m_pg));
data/sg3-utils-1.45/lib/sg_pt_common.c:259:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(p, ctrl_ext_m_pg, sizeof(ctrl_ext_m_pg));
data/sg3-utils-1.45/lib/sg_pt_common.c:261:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p + 4, ch_ctrl_ext_m_pg, sizeof(ch_ctrl_ext_m_pg));
data/sg3-utils-1.45/lib/sg_pt_common.c:263:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, d_ctrl_ext_m_pg, sizeof(d_ctrl_ext_m_pg));
data/sg3-utils-1.45/lib/sg_pt_common.c:277:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(p, iec_m_pg, sizeof(iec_m_pg));
data/sg3-utils-1.45/lib/sg_pt_common.c:279:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p + 2, ch_iec_m_pg, sizeof(ch_iec_m_pg));
data/sg3-utils-1.45/lib/sg_pt_common.c:281:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, d_iec_m_pg, sizeof(d_iec_m_pg));
data/sg3-utils-1.45/lib/sg_pt_common.c:297:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(p, vs_ua_m_pg, sizeof(vs_ua_m_pg));
data/sg3-utils-1.45/lib/sg_pt_common.c:299:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p + 2, ch_vs_ua_m_pg, sizeof(ch_vs_ua_m_pg));
data/sg3-utils-1.45/lib/sg_pt_common.c:301:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, d_vs_ua_m_pg, sizeof(d_vs_ua_m_pg));
data/sg3-utils-1.45/lib/sg_pt_common.c:439:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(dip, arr, len);
data/sg3-utils-1.45/lib/sg_pt_common.c:480:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(arr, dop, rlen);
data/sg3-utils-1.45/lib/sg_pt_common.c:510:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(ctrl_m_pg + 2, arr + off + 2,
data/sg3-utils-1.45/lib/sg_pt_common.c:520:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(iec_m_pg + 2, arr + off + 2,
data/sg3-utils-1.45/lib/sg_pt_common.c:528:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(vs_ua_m_pg + 2, arr + off + 2,
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:169: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 b[PATH_MAX];
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:170: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  full_path[64];
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:245: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).
        dev_fd = open(fdc_p->devname, oflags);
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:717:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(ccb->csio.cdb_io.cdb_bytes, ptp->cdb, ptp->cdb_len);
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:746:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(ptp->sense, &(ccb->csio.sense_data), len);
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:1150:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(sbp + sl + 4, sks, 3);
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:1152:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(sbp + 15, sks, 3);
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:1169: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 b[80];
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:1196:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char nam[64];
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:1357:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(inq_dout + 4, fdc_p->nvme_id_ctlp + 4, 20);    /* SN */
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:1434:21:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                    memcpy((uint8_t *)ptp->dxferp, inq_dout,
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:1437:25:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                        memcpy((uint8_t *)ptp->dxferp + 16,
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:1440:21:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                    memcpy((uint8_t *)ptp->dxferp, inq_dout, n);
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:1452:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(inq_dout + 8, nvme_scsi_vendor_str, 8);  /* NVMe not Intel */
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:1453:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(inq_dout + 16, fdc_p->nvme_id_ctlp + 24, 16);/* Prod <-- MN */
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:1454:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(inq_dout + 32, fdc_p->nvme_id_ctlp + 64, 4); /* Rev <-- FR */
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:1459:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy((uint8_t *)ptp->dxferp, inq_dout, n);
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:1528:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy((uint8_t *)ptp->dxferp, rl_doutp, n);
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:1649:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy((uint8_t *)ptp->dxferp, rs_dout, n);
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:2054:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy((uint8_t *)ptp->dxferp, arr, len);
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:2086:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy((uint8_t *)ptp->dxferp, arr, len);
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:2178:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char b[64];
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:2198:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(npc_up, (const uint8_t *)ptp->cdb, n);
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:2237:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(ptp->sense, fdc_p->cq_dw0_3, k);
data/sg3-utils-1.45/lib/sg_pt_linux.c:133: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 a[128];
data/sg3-utils-1.45/lib/sg_pt_linux.c:134: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 b[128];
data/sg3-utils-1.45/lib/sg_pt_linux.c:137:23:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if (NULL == (fp = fopen(proc_devices, "r"))) {
data/sg3-utils-1.45/lib/sg_pt_linux.c:346:10:  [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(device_name, flags);
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:142: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 buff[8];
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:155:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(b, nvme_block_devname, tlen);
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:255:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(sbp + sl + 4, sks, 3);
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:257:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(sbp + 15, sks, 3);
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:281: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 nam[64];
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:341:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char b[80];
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:511:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(inq_dout + 4, ptp->nvme_id_ctlp + 4, 20);    /* SN */
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:580:21:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                    memcpy(dp, inq_dout, (n < 16 ? n : 16));
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:582:25:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                        memcpy(dp + 16, ptp->nvme_id_ctlp, n - 16);
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:584:21:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                    memcpy(dp, inq_dout, n);
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:596:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(inq_dout + 8, nvme_scsi_vendor_str, 8);  /* NVMe not Intel */
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:597:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(inq_dout + 16, ptp->nvme_id_ctlp + 24, 16); /* Prod <-- MN */
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:598:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(inq_dout + 32, ptp->nvme_id_ctlp + 64, 4);  /* Rev <-- FR */
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:604:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy((uint8_t *)(sg_uintptr_t)ptp->io_hdr.din_xferp,
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:670:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy((uint8_t *)(sg_uintptr_t)ptp->io_hdr.din_xferp, rl_doutp,
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:776:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy((uint8_t *)(sg_uintptr_t)ptp->io_hdr.din_xferp, rs_dout, n);
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:1125:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy((uint8_t *)(sg_uintptr_t)ptp->io_hdr.din_xferp, arr, len);
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:1158:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy((uint8_t *)(sg_uintptr_t)ptp->io_hdr.din_xferp, arr, len);
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:1234:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(bp, resp, n);
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:1318:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char b[64];
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:1337:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(&cmd, (const uint8_t *)(sg_uintptr_t)ptp->io_hdr.request, n);
data/sg3-utils-1.45/lib/sg_pt_osf1.c:93:17:  [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).
        camfd = open(cam_dev, O_RDWR, 0);
data/sg3-utils-1.45/lib/sg_pt_osf1.c:118:10:  [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(device_name, O_RDONLY|O_NONBLOCK);
data/sg3-utils-1.45/lib/sg_pt_osf1.c:410:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(ccb.cam_cdb_io.cam_cdb_bytes, ptp->cdb, ptp->cdb_len);
data/sg3-utils-1.45/lib/sg_pt_solaris.c:77:10:  [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(device_name, oflags);
data/sg3-utils-1.45/lib/sg_pt_win32.c:115: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 raw[256];
data/sg3-utils-1.45/lib/sg_pt_win32.c:120: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 raw[1060];
data/sg3-utils-1.45/lib/sg_pt_win32.c:132: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 adapter[32];   /* for example: '\\.\scsi3' */
data/sg3-utils-1.45/lib/sg_pt_win32.c:139: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 dname[20];
data/sg3-utils-1.45/lib/sg_pt_win32.c:372: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 buff[8];
data/sg3-utils-1.45/lib/sg_pt_win32.c:403:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(shp->dname, device_name, k - 1);
data/sg3-utils-1.45/lib/sg_pt_win32.c:405:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(shp->dname, device_name + (len - k), k - 1);
data/sg3-utils-1.45/lib/sg_pt_win32.c:471:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char b[128];
data/sg3-utils-1.45/lib/sg_pt_win32.c:521: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 b[128];
data/sg3-utils-1.45/lib/sg_pt_win32.c:589: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 b[256];
data/sg3-utils-1.45/lib/sg_pt_win32.c:878:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(psp->nvme_cmd, cdb, cdb_len);
data/sg3-utils-1.45/lib/sg_pt_win32.c:886:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(psp->swb_d.spt.Cdb, cdb, cdb_len);
data/sg3-utils-1.45/lib/sg_pt_win32.c:895:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(psp->swb_i.spt.Cdb, cdb, cdb_len);
data/sg3-utils-1.45/lib/sg_pt_win32.c:1059:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char b[128];
data/sg3-utils-1.45/lib/sg_pt_win32.c:1072:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(psp->sensep, psp->swb_d.ucSenseBuf, psp->sense_len);
data/sg3-utils-1.45/lib/sg_pt_win32.c:1116:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(epsp, psp, sizeof(struct sg_pt_win32_scsi));
data/sg3-utils-1.45/lib/sg_pt_win32.c:1149:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(psp->swb_i.ucDataBuf, psp->dxferp, psp->dxfer_len);
data/sg3-utils-1.45/lib/sg_pt_win32.c:1161:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char b[128];
data/sg3-utils-1.45/lib/sg_pt_win32.c:1171:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(psp->dxferp, psp->swb_i.ucDataBuf, psp->dxfer_len);
data/sg3-utils-1.45/lib/sg_pt_win32.c:1176:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(psp->sensep, psp->swb_i.ucSenseBuf, psp->sense_len);
data/sg3-utils-1.45/lib/sg_pt_win32.c:1552:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(sbp + sl + 4, sks, 3);
data/sg3-utils-1.45/lib/sg_pt_win32.c:1554:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(sbp + 15, sks, 3);
data/sg3-utils-1.45/lib/sg_pt_win32.c:1624:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char b[128];
data/sg3-utils-1.45/lib/sg_pt_win32.c:1636:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(dp, bp, dlen);
data/sg3-utils-1.45/lib/sg_pt_win32.c:1712:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char b[128];
data/sg3-utils-1.45/lib/sg_pt_win32.c:1723:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(dp, bp, dlen);
data/sg3-utils-1.45/lib/sg_pt_win32.c:1791:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char b[128];
data/sg3-utils-1.45/lib/sg_pt_win32.c:1802:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(dp, bp, dlen);
data/sg3-utils-1.45/lib/sg_pt_win32.c:1876:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(protoCmdp->Command, cmdp, cmd_len);
data/sg3-utils-1.45/lib/sg_pt_win32.c:1879:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(bp, dp, dlen);
data/sg3-utils-1.45/lib/sg_pt_win32.c:1890:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char b[128];
data/sg3-utils-1.45/lib/sg_pt_win32.c:1906:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(dp, bp, dlen);
data/sg3-utils-1.45/lib/sg_pt_win32.c:2078:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(pthru->DataBuffer, dp, dlen);    /* dout-out buffer */
data/sg3-utils-1.45/lib/sg_pt_win32.c:2081:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(pthru->SrbIoCtrl.Signature, NVME_SIG_STR, sizeof(NVME_SIG_STR)-1);
data/sg3-utils-1.45/lib/sg_pt_win32.c:2087:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(pthru->NVMeCmd, cmdp, cmd_len);
data/sg3-utils-1.45/lib/sg_pt_win32.c:2106:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char b[128];
data/sg3-utils-1.45/lib/sg_pt_win32.c:2116:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/lib/sg_pt_win32.c:2151:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(dp, pthru->DataBuffer, dlen);    /* data-in buffer */
data/sg3-utils-1.45/lib/sg_pt_win32.c:2316:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(inq_dout + 4, psp->nvme_id_ctlp + 4, 20);    /* SN */
data/sg3-utils-1.45/lib/sg_pt_win32.c:2392:21:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                    memcpy(psp->dxferp, inq_dout, (n < 16 ? n : 16));
data/sg3-utils-1.45/lib/sg_pt_win32.c:2394:25:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                        memcpy(psp->dxferp + 16,
data/sg3-utils-1.45/lib/sg_pt_win32.c:2397:21:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                    memcpy(psp->dxferp, inq_dout, n);
data/sg3-utils-1.45/lib/sg_pt_win32.c:2409:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(inq_dout + 8, nvme_scsi_vendor_str, 8);  /* NVMe not Intel */
data/sg3-utils-1.45/lib/sg_pt_win32.c:2410:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(inq_dout + 16, psp->nvme_id_ctlp + 24, 16); /* Prod <-- MN */
data/sg3-utils-1.45/lib/sg_pt_win32.c:2411:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(inq_dout + 32, psp->nvme_id_ctlp + 64, 4);  /* Rev <-- FR */
data/sg3-utils-1.45/lib/sg_pt_win32.c:2417:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(psp->dxferp, inq_dout, n);
data/sg3-utils-1.45/lib/sg_pt_win32.c:2482:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(psp->dxferp, rl_doutp, n);
data/sg3-utils-1.45/lib/sg_pt_win32.c:2590:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(psp->dxferp, rs_dout, n);
data/sg3-utils-1.45/lib/sg_pt_win32.c:2956:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(psp->dxferp, arr, len);
data/sg3-utils-1.45/lib/sg_pt_win32.c:2990:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(psp->dxferp, arr, len);
data/sg3-utils-1.45/lib/sg_pt_win32.c:3064:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char b[64];
data/sg3-utils-1.45/src/sg_bg_ctl.c:104:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sg_bg_ctl.c:246:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char b[80];
data/sg3-utils-1.45/src/sg_compare_and_write.c:373:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char b[128];
data/sg3-utils-1.45/src/sg_compare_and_write.c:437:22:  [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(fn, O_RDONLY);
data/sg3-utils-1.45/src/sg_compare_and_write.c:585:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char b[80];
data/sg3-utils-1.45/src/sg_copy_results.c:56: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 desc[124];
data/sg3-utils-1.45/src/sg_copy_results.c:113: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 senseBuff[1024];
data/sg3-utils-1.45/src/sg_copy_results.c:324: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 file_name[256];
data/sg3-utils-1.45/src/sg_copy_results.c:460:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_dd.c:264: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 a[128];
data/sg3-utils-1.45/src/sg_dd.c:265: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 b[128];
data/sg3-utils-1.45/src/sg_dd.c:267:23:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if (NULL == (fp = fopen(proc_devices, "r"))) {
data/sg3-utils-1.45/src/sg_dd.c:971:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(bp, buffp, bs);
data/sg3-utils-1.45/src/sg_dd.c:1151: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 buff[256];
data/sg3-utils-1.45/src/sg_dd.c:1206: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 buff[256];
data/sg3-utils-1.45/src/sg_dd.c:1264: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_dd.c:1289:21:  [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 ((infd = open(inf, fl | flags)) < 0) {
data/sg3-utils-1.45/src/sg_dd.c:1291:25:  [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 ((infd = open(inf, fl | flags)) < 0) {
data/sg3-utils-1.45/src/sg_dd.c:1330:16:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        infd = open(inf, flags);
data/sg3-utils-1.45/src/sg_dd.c:1397: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_dd.c:1419:22:  [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 ((outfd = open(outf, flags)) < 0) {
data/sg3-utils-1.45/src/sg_dd.c:1459:26:  [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 ((outfd = open(outf, flags, 0666)) < 0) {
data/sg3-utils-1.45/src/sg_dd.c:1473:26:  [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 ((outfd = open(outf, flags)) < 0) {
data/sg3-utils-1.45/src/sg_dd.c:1568: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 inf[INOUTF_SZ];
data/sg3-utils-1.45/src/sg_dd.c:1569: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 outf[INOUTF_SZ];
data/sg3-utils-1.45/src/sg_dd.c:1570: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 out2f[INOUTF_SZ];
data/sg3-utils-1.45/src/sg_dd.c:1571:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[STR_SZ];
data/sg3-utils-1.45/src/sg_dd.c:1572: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_dd.c:1653:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(inf, buf, INOUTF_SZ - 1);
data/sg3-utils-1.45/src/sg_dd.c:1671:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(outf, buf, INOUTF_SZ - 1);
data/sg3-utils-1.45/src/sg_dd.c:1679:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(out2f, buf, INOUTF_SZ - 1);
data/sg3-utils-1.45/src/sg_dd.c:1854:23:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        if ((out2fd = open(out2f, O_WRONLY | O_CREAT, 0666)) < 0) {
data/sg3-utils-1.45/src/sg_dd.c:2343:19:  [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(proc_allow_dio, O_RDONLY)) >= 0) {
data/sg3-utils-1.45/src/sg_decode_sense.c:75: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 concat_buff[1024];
data/sg3-utils-1.45/src/sg_decode_sense.c:252: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 b[128];
data/sg3-utils-1.45/src/sg_decode_sense.c:256:18:  [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.
            n += sprintf(b + n, "0x%02x,", op->sense[k]);
data/sg3-utils-1.45/src/sg_decode_sense.c:292: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 b[2048];
data/sg3-utils-1.45/src/sg_decode_sense.c:329:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char d[128];
data/sg3-utils-1.45/src/sg_decode_sense.c:378:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fp = fopen(op->fname, "r");
data/sg3-utils-1.45/src/sg_decode_sense.c:403:23:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
            if ((fp = fopen(op->wfname, "w"))) {
data/sg3-utils-1.45/src/sg_emc_trespass.c:64:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_emc_trespass.c:164: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).
        fd = open(file_name, O_RDWR | O_NONBLOCK);
data/sg3-utils-1.45/src/sg_format.c:289:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char b[128];
data/sg3-utils-1.45/src/sg_format.c:345:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char b[128];
data/sg3-utils-1.45/src/sg_format.c:395:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_format.c:555:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_format.c:665:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_format.c:785:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(u_sns, bp + off + 4, sns_dlen);
data/sg3-utils-1.45/src/sg_format.c:840:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char a[MAX_VPD_RESP_LEN];
data/sg3-utils-1.45/src/sg_format.c:841:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char pdt_name[64];
data/sg3-utils-1.45/src/sg_format.c:858:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(sinq_resp, b, (n < max_rlen) ? n : max_rlen);
data/sg3-utils-1.45/src/sg_format.c:962:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_format.c:1051:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_format.c:1502:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_get_config.c:251: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 buff[128];
data/sg3-utils-1.45/src/sg_get_config.c:892: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 buff[128];
data/sg3-utils-1.45/src/sg_get_config.c:966:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buff[64];
data/sg3-utils-1.45/src/sg_get_config.c:1125:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_get_elem_status.c:158:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sg_get_elem_status.c:565:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_get_lba_status.c:554:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_ident.c:130: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 b[80];
data/sg3-utils-1.45/src/sg_inq.c:146: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 xtra_buff[MX_ALLOC_LEN + 1];
data/sg3-utils-1.45/src/sg_inq.c:147:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char usn_buff[MX_ALLOC_LEN + 1];
data/sg3-utils-1.45/src/sg_inq.c:955:13:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
            sprintf(&out[j], "\\x%02x", in[i]);
data/sg3-utils-1.45/src/sg_inq.c:1300:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char b[1024];
data/sg3-utils-1.45/src/sg_inq.c:1335: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 b[64];
data/sg3-utils-1.45/src/sg_inq.c:2035: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 b[80];
data/sg3-utils-1.45/src/sg_inq.c:2046:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(b, buff + 8, 8);
data/sg3-utils-1.45/src/sg_inq.c:2049:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(b, buff + 16, 16);
data/sg3-utils-1.45/src/sg_inq.c:2052:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(b, buff + 32, 4);
data/sg3-utils-1.45/src/sg_inq.c:2128: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 b[64];
data/sg3-utils-1.45/src/sg_inq.c:2766: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 buff[48];
data/sg3-utils-1.45/src/sg_inq.c:2848:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(xtra_buff, &rp[8], 8);
data/sg3-utils-1.45/src/sg_inq.c:2867:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(xtra_buff, &rp[16], 16);
data/sg3-utils-1.45/src/sg_inq.c:2883:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(xtra_buff, &rp[32], 4);
data/sg3-utils-1.45/src/sg_inq.c:2894:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(xtra_buff, &rp[36], act_len < 56 ? act_len - 36 :
data/sg3-utils-1.45/src/sg_inq.c:2909:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(xtra_buff, &rp[96], act_len - 96);
data/sg3-utils-1.45/src/sg_inq.c:3085: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 buff[48];
data/sg3-utils-1.45/src/sg_inq.c:3148:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_inq.c:3170: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 op_name[128];
data/sg3-utils-1.45/src/sg_inq.c:3294: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 b[128];
data/sg3-utils-1.45/src/sg_inq.c:3392:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char obuff[DEF_ALLOC_LEN];
data/sg3-utils-1.45/src/sg_inq.c:3399:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(obuff, rp + 4, len);
data/sg3-utils-1.45/src/sg_inq.c:3671:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_inq.c:4518:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(data, buff + HDIO_DRIVE_CMD_OFFSET, ATA_IDENTIFY_BUFF_SZ);
data/sg3-utils-1.45/src/sg_inq.c:4566:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(data, buff + HDIO_DRIVE_CMD_OFFSET, ATA_IDENTIFY_BUFF_SZ);
data/sg3-utils-1.45/src/sg_inq.c:4575: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 model[64];
data/sg3-utils-1.45/src/sg_inq.c:4576: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 serial[64];
data/sg3-utils-1.45/src/sg_inq.c:4577: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 firm[64];
data/sg3-utils-1.45/src/sg_inq.c:4617:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(&ata_ident, rsp_buff, n);
data/sg3-utils-1.45/src/sg_inq_data.c:28: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.
const char * sg_ansi_version_arr[16] =
data/sg3-utils-1.45/src/sg_logs.c:482: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 t10_vendor_str[10];
data/sg3-utils-1.45/src/sg_logs.c:483: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 t10_product_str[18];
data/sg3-utils-1.45/src/sg_logs.c:690: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 b[80];
data/sg3-utils-1.45/src/sg_logs.c:691: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 bb[80];
data/sg3-utils-1.45/src/sg_logs.c:1217:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char b[80];
data/sg3-utils-1.45/src/sg_logs.c:1473: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 buff[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:1476: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.
    n = sprintf(buff, "du=%d [ds=%d] tsd=%d [etc=%d] ", ((pcb & 0x80) ? 1 : 0),
data/sg3-utils-1.45/src/sg_logs.c:1480:14:  [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.
        n += sprintf(buff + n, "[tmc=%d] ", ((pcb & 0xc) >> 2));
data/sg3-utils-1.45/src/sg_logs.c:1482:10:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    n += sprintf(buff + n, "format+linking=%d  [0x%.2x]", pcb & 3,
data/sg3-utils-1.45/src/sg_logs.c:1486:14:  [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.
        n += sprintf(buff + n, "lbin=%d ", ((pcb & 0x2) >> 1));
data/sg3-utils-1.45/src/sg_logs.c:1487:10:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    n += sprintf(buff + n, "lp=%d  [0x%.2x]", pcb & 0x1, pcb);
data/sg3-utils-1.45/src/sg_logs.c:1490:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(outp, buff, n);
data/sg3-utils-1.45/src/sg_logs.c:1505: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 b[64];
data/sg3-utils-1.45/src/sg_logs.c:1537: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 b[64];
data/sg3-utils-1.45/src/sg_logs.c:1580:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:1704:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:1781:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:1832:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:1918:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:1919: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 b[32];
data/sg3-utils-1.45/src/sg_logs.c:2010:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:2011: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 b[32];
data/sg3-utils-1.45/src/sg_logs.c:2092:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:2174:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:2277:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:2354:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:2418:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:2518:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:2573:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:2618:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:2677:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:2756:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:2757: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 b[80];
data/sg3-utils-1.45/src/sg_logs.c:2822:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:2894:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:3002:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:3055:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:3056: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 b[256];
data/sg3-utils-1.45/src/sg_logs.c:3057: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 bb[32];
data/sg3-utils-1.45/src/sg_logs.c:3402:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static const char * sas_link_rate_arr[16] = {
data/sg3-utils-1.45/src/sg_logs.c:3442:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:3443:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char s[64];
data/sg3-utils-1.45/src/sg_logs.c:3650:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:3935:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:4066:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:4151:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:4238:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:4329:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:4400:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:4477:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:4478: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 b[64];
data/sg3-utils-1.45/src/sg_logs.c:4615:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:4675:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static const char * req_rec_arr[NUM_REQ_REC_ARR_ELEMS] = {
data/sg3-utils-1.45/src/sg_logs.c:4704:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:4766:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:4855:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:4983:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:5184:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:5259:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:5317:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:5379:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:5436:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:5548:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:5727:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:5863:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:5915:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:5916: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 b[80];
data/sg3-utils-1.45/src/sg_logs.c:6001:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:6002: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 b[80];
data/sg3-utils-1.45/src/sg_logs.c:6163:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:6164: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 b[64];
data/sg3-utils-1.45/src/sg_logs.c:6453:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:6502:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:6557:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:6627:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[PCB_STR_LEN];
data/sg3-utils-1.45/src/sg_logs.c:6766: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 b[80];
data/sg3-utils-1.45/src/sg_logs.c:7069:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(t10_vendor_str, inq_out.vendor, 8);
data/sg3-utils-1.45/src/sg_logs.c:7070:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(t10_product_str, inq_out.product, 16);
data/sg3-utils-1.45/src/sg_logs.c:7164:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(parr, rsp_buff + 4, my_len);
data/sg3-utils-1.45/src/sg_luns.c:137: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 l_leadin[128];
data/sg3-utils-1.45/src/sg_luns.c:138: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 b[256];
data/sg3-utils-1.45/src/sg_luns.c:163:13:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
            strcat(l_leadin, "  ");
data/sg3-utils-1.45/src/sg_luns.c:166:13:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
            strcat(l_leadin, "  ");
data/sg3-utils-1.45/src/sg_luns.c:693:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_map.c:61: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 gen_index_arr[PRESENT_ARRAY_SIZE];
data/sg3-utils-1.45/src/sg_map.c:71: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 vendor[8];
data/sg3-utils-1.45/src/sg_map.c:72: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 product[16];
data/sg3-utils-1.45/src/sg_map.c:73: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 revision[4];
data/sg3-utils-1.45/src/sg_map.c:102: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_map.c:158:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buff[64];
data/sg3-utils-1.45/src/sg_map.c:164: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(buff, "%d", k);
data/sg3-utils-1.45/src/sg_map.c:168:9:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
        strcat(fname, "xxxx");
data/sg3-utils-1.45/src/sg_map.c:207: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 fname[64];
data/sg3-utils-1.45/src/sg_map.c:274:17:  [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).
        sg_fd = open(fname, O_RDONLY | O_NONBLOCK);
data/sg3-utils-1.45/src/sg_map.c:305:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char buff[INQUIRY_RESP_INITIAL_LEN];
data/sg3-utils-1.45/src/sg_map.c:309:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(map_arr[k].vendor, &buff[8], 8);
data/sg3-utils-1.45/src/sg_map.c:310:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(map_arr[k].product, &buff[16], 16);
data/sg3-utils-1.45/src/sg_map.c:311:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(map_arr[k].revision, &buff[32], 4);
data/sg3-utils-1.45/src/sg_map.c:430: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 fname[64];
data/sg3-utils-1.45/src/sg_map.c:453:17:  [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).
        sg_fd = open(fname, O_RDONLY | O_NONBLOCK);
data/sg3-utils-1.45/src/sg_map26.c:197: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 safe_errbuf[64] = {'u', 'n', 'k', 'n', 'o', 'w', 'n', ' ',
data/sg3-utils-1.45/src/sg_map26.c:314:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char dir_name[D_NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:324:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char name[D_NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:399:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char name[NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:425:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char name[NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:555:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char buff[D_NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:575:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char buff[NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:608:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char buff[D_NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:622:26:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        if (NULL == (f = fopen(buff, "r"))) {
data/sg3-utils-1.45/src/sg_map26.c:672:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char value[D_NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:673:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char name[D_NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:751:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char value[D_NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:752:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char name[D_NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:808:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char value[D_NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:809:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char name[D_NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:866:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char value[D_NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:867:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char name[D_NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:924:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char value[D_NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:925:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char name[D_NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:981:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char value[D_NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:982:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char name[D_NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:1054:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char device_name[D_NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:1055:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char device_dir[D_NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_map26.c:1056:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char value[D_NAME_LEN_MAX];
data/sg3-utils-1.45/src/sg_modes.c:387: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 b[128];
data/sg3-utils-1.45/src/sg_modes.c:940: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 b[64];
data/sg3-utils-1.45/src/sg_modes.c:1114:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char b[80];
data/sg3-utils-1.45/src/sg_modes.c:1155: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 b[80];
data/sg3-utils-1.45/src/sg_modes.c:1156: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_modes.c:1157: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 pdt_name[64];
data/sg3-utils-1.45/src/sg_opcodes.c:216:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sg_opcodes.c:271:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sg_opcodes.c:313: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 b[32];
data/sg3-utils-1.45/src/sg_opcodes.c:640: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 l_name_buff[NAME_BUFF_SZ];
data/sg3-utils-1.45/src/sg_opcodes.c:641: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 r_name_buff[NAME_BUFF_SZ];
data/sg3-utils-1.45/src/sg_opcodes.c:673:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char name_buff[NAME_BUFF_SZ];
data/sg3-utils-1.45/src/sg_opcodes.c:674: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 sa_buff[8];
data/sg3-utils-1.45/src/sg_opcodes.c:867:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char name_buff[NAME_BUFF_SZ];
data/sg3-utils-1.45/src/sg_opcodes.c:868: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 b[64];
data/sg3-utils-1.45/src/sg_opcodes.c:963: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 buff[48];
data/sg3-utils-1.45/src/sg_opcodes.c:964: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 b[80];
data/sg3-utils-1.45/src/sg_opcodes.c:1030:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char name_buff[NAME_BUFF_SZ];
data/sg3-utils-1.45/src/sg_persist.c:294:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[64];
data/sg3-utils-1.45/src/sg_persist.c:295:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char bb[80];
data/sg3-utils-1.45/src/sg_persist.c:435:21:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                    char b[1024];
data/sg3-utils-1.45/src/sg_persist.c:485: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 b[64];
data/sg3-utils-1.45/src/sg_persist.c:486: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 bb[80];
data/sg3-utils-1.45/src/sg_persist.c:505:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&pr_buff[28], op->transportid_arr, t_arr_len);
data/sg3-utils-1.45/src/sg_persist.c:562:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&pr_buff[24], op->transportid_arr, t_arr_len);
data/sg3-utils-1.45/src/sg_persist.c:576:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char bb[80];
data/sg3-utils-1.45/src/sg_persist.c:724:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(tidp + 4, lcp, len);
data/sg3-utils-1.45/src/sg_persist.c:754: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 line[1024];
data/sg3-utils-1.45/src/sg_persist.c:755: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 carry_over[4];
data/sg3-utils-1.45/src/sg_persist.c:758:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fp = fopen(fnp, "r");
data/sg3-utils-1.45/src/sg_persist.c:957: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 buff[48];
data/sg3-utils-1.45/src/sg_persist.c:1239:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[1024];
data/sg3-utils-1.45/src/sg_prevent.c:175:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_raw.c:295:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_raw.c:321: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 buffer[512];
data/sg3-utils-1.45/src/sg_raw.c:357: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).
        fd = open(op->dataout_file, O_RDONLY);
data/sg3-utils-1.45/src/sg_raw.c:478: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 b[128];
data/sg3-utils-1.45/src/sg_raw.c:580:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char d[128];
data/sg3-utils-1.45/src/sg_rbuf.c:423: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).
    sg_fd = open(op->device_name, O_RDONLY | O_NONBLOCK);
data/sg3-utils-1.45/src/sg_rbuf.c:454:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sg_rbuf.c:590:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char b[128];
data/sg3-utils-1.45/src/sg_rdac.c:128:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_rdac.c:132:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(fail_paths_pg, mode6_hdr, 4);
data/sg3-utils-1.45/src/sg_rdac.c:133:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(fail_paths_pg + 4, block_descriptor, 8);
data/sg3-utils-1.45/src/sg_rdac.c:139:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(fail_paths_pg, mode10_hdr, 8);
data/sg3-utils-1.45/src/sg_rdac.c:184:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_rdac.c:200:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(fail_paths_pg, mode6_hdr, 4);
data/sg3-utils-1.45/src/sg_rdac.c:201:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(fail_paths_pg + 4, block_descriptor, 8);
data/sg3-utils-1.45/src/sg_rdac.c:209:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(fail_paths_pg, mode10_hdr, 8);
data/sg3-utils-1.45/src/sg_rdac.c:493:33:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                                char b[80];
data/sg3-utils-1.45/src/sg_read.c:331:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sg_read.c:430: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 inf[INF_SZ];
data/sg3-utils-1.45/src/sg_read.c:431: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 outf[INF_SZ];
data/sg3-utils-1.45/src/sg_read.c:432:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[STR_SZ];
data/sg3-utils-1.45/src/sg_read.c:433: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_read.c:494:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(inf, buf, INF_SZ - 1);
data/sg3-utils-1.45/src/sg_read.c:503:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(outf, buf, INF_SZ - 1);
data/sg3-utils-1.45/src/sg_read.c:635:21:  [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 ((infd = open(inf, flags)) < 0) {
data/sg3-utils-1.45/src/sg_read.c:639:25:  [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 ((infd = open(inf, flags)) < 0) {
data/sg3-utils-1.45/src/sg_read.c:682:21:  [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 ((infd = open(inf, flags)) < 0) {
data/sg3-utils-1.45/src/sg_read.c:912:19:  [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(proc_allow_dio, O_RDONLY)) >= 0) {
data/sg3-utils-1.45/src/sg_read_attr.c:268:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sg_read_attr.c:347: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 b[32];
data/sg3-utils-1.45/src/sg_read_attr.c:432: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 b[160];
data/sg3-utils-1.45/src/sg_read_attr.c:601: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 b[160];
data/sg3-utils-1.45/src/sg_read_attr.c:746: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 b[80];
data/sg3-utils-1.45/src/sg_read_block_limits.c:213:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_read_buffer.c:179:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sg_read_buffer.c:244:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sg_read_buffer.c:346: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 b[32];
data/sg3-utils-1.45/src/sg_read_buffer.c:647:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_read_long.c:100: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 b[80];
data/sg3-utils-1.45/src/sg_read_long.c:146: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 out_fname[256];
data/sg3-utils-1.45/src/sg_read_long.c:147: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_read_long.c:286:26:  [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 ((outfd = open(out_fname, O_WRONLY | O_CREAT | O_TRUNC,
data/sg3-utils-1.45/src/sg_readcap.c:415: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 b[80];
data/sg3-utils-1.45/src/sg_reassign.c:128:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char line[1024];
data/sg3-utils-1.45/src/sg_reassign.c:240: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 b[80];
data/sg3-utils-1.45/src/sg_referrals.c:365:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_rep_zones.c:148:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sg_rep_zones.c:280:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static const char * same_desc_arr[16] = {
data/sg3-utils-1.45/src/sg_rep_zones.c:315: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 b[80];
data/sg3-utils-1.45/src/sg_requests.c:149: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 b[80];
data/sg3-utils-1.45/src/sg_reset.c:218: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).
    sg_fd = open(device_name, O_RDWR | O_NONBLOCK);
data/sg3-utils-1.45/src/sg_reset_wp.c:99:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sg_reset_wp.c:262:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char b[80];
data/sg3-utils-1.45/src/sg_rmsn.c:206:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_rtpg.c:342:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_safte.c:525: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_safte.c:536: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 buff[48];
data/sg3-utils-1.45/src/sg_safte.c:537: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 b[80];
data/sg3-utils-1.45/src/sg_sanitize.c:220:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sg_sanitize.c:300:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(u_sns, bp + off + 4, sns_dlen);
data/sg3-utils-1.45/src/sg_sanitize.c:350: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 a[256];
data/sg3-utils-1.45/src/sg_sanitize.c:351: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 pdt_name[64];
data/sg3-utils-1.45/src/sg_sanitize.c:362:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(sinq_resp, b, (n < max_rlen) ? n : max_rlen);
data/sg3-utils-1.45/src/sg_sanitize.c:451: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_sanitize.c:452: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 b[80];
data/sg3-utils-1.45/src/sg_sanitize.c:679:29:  [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 ((infd = open(op->pattern_fn, O_RDONLY)) < 0) {
data/sg3-utils-1.45/src/sg_sat_phy_event.c:377: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_sat_phy_event.c:482: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).
    if ((sg_fd = open(device_name, O_RDWR)) < 0) {
data/sg3-utils-1.45/src/sg_sat_read_gplog.c:150: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 cmd_name[32];
data/sg3-utils-1.45/src/sg_scan_linux.c:143: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 buff[FNAME_SZ];
data/sg3-utils-1.45/src/sg_scan_linux.c:146:5:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
    strcpy(fname, "/dev/sg");
data/sg3-utils-1.45/src/sg_scan_linux.c:168:13:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
            strcat(fname, "xxxx");
data/sg3-utils-1.45/src/sg_scan_linux.c:195: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 fname[FNAME_SZ];
data/sg3-utils-1.45/src/sg_scan_linux.c:196: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_scan_linux.c:298:17:  [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).
        sg_fd = open(file_namep, flags);
data/sg3-utils-1.45/src/sg_scan_linux.c:480:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(sicp->data, inq_cdb, INQ_CMD_LEN);
data/sg3-utils-1.45/src/sg_scan_linux.c:483:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(inqBuff, sicp->data, INQ_REPLY_LEN);
data/sg3-utils-1.45/src/sg_scan_linux.c:569: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 tmp[65];
data/sg3-utils-1.45/src/sg_scan_linux.c:605:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(data, buff + HDIO_DRIVE_CMD_OFFSET, ATA_IDENTIFY_BUFF_SZ);
data/sg3-utils-1.45/src/sg_scan_linux.c:612: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 model[64];
data/sg3-utils-1.45/src/sg_scan_linux.c:613: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 serial[64];
data/sg3-utils-1.45/src/sg_scan_linux.c:614: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 firm[64];
data/sg3-utils-1.45/src/sg_scan_win32.c:59: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 raw[256];
data/sg3-utils-1.45/src/sg_scan_win32.c:64: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 raw[1060];
data/sg3-utils-1.45/src/sg_scan_win32.c:68:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char    name[32];
data/sg3-utils-1.45/src/sg_scan_win32.c:69: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    volume_letters[32];
data/sg3-utils-1.45/src/sg_scan_win32.c:210: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 b[256];
data/sg3-utils-1.45/src/sg_scan_win32.c:237: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 b[256];
data/sg3-utils-1.45/src/sg_scan_win32.c:324: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 adapter_name[64];
data/sg3-utils-1.45/src/sg_scan_win32.c:328: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 b[256];
data/sg3-utils-1.45/src/sg_scan_win32.c:409: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 adapter_name[64];
data/sg3-utils-1.45/src/sg_scan_win32.c:446: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 adapter_name[64];
data/sg3-utils-1.45/src/sg_scan_win32.c:447: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 b[256];
data/sg3-utils-1.45/src/sg_scan_win32.c:471:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(&storage_arr[next_unused_elem++], &tmp_se, sizeof(tmp_se));
data/sg3-utils-1.45/src/sg_scan_win32.c:498: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 adapter_name[64];
data/sg3-utils-1.45/src/sg_scan_win32.c:499: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 b[256];
data/sg3-utils-1.45/src/sg_scan_win32.c:522:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(&storage_arr[next_unused_elem++], &tmp_se, sizeof(tmp_se));
data/sg3-utils-1.45/src/sg_scan_win32.c:546: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 adapter_name[64];
data/sg3-utils-1.45/src/sg_scan_win32.c:547: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 b[256];
data/sg3-utils-1.45/src/sg_scan_win32.c:570:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(&storage_arr[next_unused_elem++], &tmp_se, sizeof(tmp_se));
data/sg3-utils-1.45/src/sg_seek.c:166: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 b[64];
data/sg3-utils-1.45/src/sg_senddiag.c:455:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_senddiag.c:493:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char line[512];
data/sg3-utils-1.45/src/sg_senddiag.c:494:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char carry_over[4];
data/sg3-utils-1.45/src/sg_ses.c:134: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 cgs_str[CGS_STR_MAX_SZ];
data/sg3-utils-1.45/src/sg_ses.c:995: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 b[64];
data/sg3-utils-1.45/src/sg_ses.c:1436:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char b[128];
data/sg3-utils-1.45/src/sg_ses.c:1678:28:  [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.
        page_num = ((const char *)outgoing_pg)[0];
data/sg3-utils-1.45/src/sg_ses.c:1869: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 b[80];
data/sg3-utils-1.45/src/sg_ses.c:1870: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 bb[120];
data/sg3-utils-1.45/src/sg_ses.c:1901:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(rsp_buff, bp + off, d_len);
data/sg3-utils-1.45/src/sg_ses.c:2012: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 b[64];
data/sg3-utils-1.45/src/sg_ses.c:2046:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char bb[1024];
data/sg3-utils-1.45/src/sg_ses.c:2142:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(primary_ip->enc_log_id, bp + 4, 8);
data/sg3-utils-1.45/src/sg_ses.c:2143:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(primary_ip->enc_vendor_id, bp + 12, 8);
data/sg3-utils-1.45/src/sg_ses.c:2144:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(primary_ip->product_id, bp + 20, 16);
data/sg3-utils-1.45/src/sg_ses.c:2145:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(primary_ip->product_rev_level, bp + 36, 4);
data/sg3-utils-1.45/src/sg_ses.c:2516: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 bb[128];
data/sg3-utils-1.45/src/sg_ses.c:2879: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 b[64];
data/sg3-utils-1.45/src/sg_ses.c:2947: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 b[64];
data/sg3-utils-1.45/src/sg_ses.c:3019: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 b[128];
data/sg3-utils-1.45/src/sg_ses.c:3020: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 b2[128];
data/sg3-utils-1.45/src/sg_ses.c:3043:13:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
            strcpy(b, "<vendor>");
data/sg3-utils-1.45/src/sg_ses.c:3048:13:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
            strcpy(b, "<vendor>");
data/sg3-utils-1.45/src/sg_ses.c:3102: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 b[64];
data/sg3-utils-1.45/src/sg_ses.c:3169: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 b[64];
data/sg3-utils-1.45/src/sg_ses.c:3256: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 b[64];
data/sg3-utils-1.45/src/sg_ses.c:3463: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 b[64];
data/sg3-utils-1.45/src/sg_ses.c:3580: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 b[64];
data/sg3-utils-1.45/src/sg_ses.c:3749:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char bb[1024];
data/sg3-utils-1.45/src/sg_ses.c:3916: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 line[512];
data/sg3-utils-1.45/src/sg_ses.c:3917: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 carry_over[4];
data/sg3-utils-1.45/src/sg_ses.c:3938: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).
            fd = open(inp + off_fn, O_RDONLY);
data/sg3-utils-1.45/src/sg_ses.c:3982:18:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
            fp = fopen(inp + off_fn, "r");
data/sg3-utils-1.45/src/sg_ses.c:4130: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 bb[120];
data/sg3-utils-1.45/src/sg_ses.c:4431: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 b[20];
data/sg3-utils-1.45/src/sg_ses.c:4615: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 b[64];
data/sg3-utils-1.45/src/sg_ses.c:4717: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 b[64];
data/sg3-utils-1.45/src/sg_ses.c:5261: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 b[64];
data/sg3-utils-1.45/src/sg_ses.c:5419:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(b + 8, op->nickname_str, len);
data/sg3-utils-1.45/src/sg_ses.c:5452: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 b[64];
data/sg3-utils-1.45/src/sg_ses.c:5453: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 a[160];
data/sg3-utils-1.45/src/sg_ses.c:5468:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char bb[64];
data/sg3-utils-1.45/src/sg_ses.c:5541: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 buff[128];
data/sg3-utils-1.45/src/sg_ses.c:5542: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 b[128];
data/sg3-utils-1.45/src/sg_ses_microcode.c:348:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(wp->doutp + 24, dmp, dmp_len);
data/sg3-utils-1.45/src/sg_ses_microcode.c:418:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(dip, dummy_rd_resp, n);
data/sg3-utils-1.45/src/sg_ses_microcode.c:498: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_ses_microcode.c:729:25:  [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 ((infd = open(file_name, O_RDONLY)) < 0) {
data/sg3-utils-1.45/src/sg_ses_microcode.c:839:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(dip, dummy_rd_resp, n);
data/sg3-utils-1.45/src/sg_start.c:597:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char b[80];
data/sg3-utils-1.45/src/sg_stpg.c:434: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 b[80];
data/sg3-utils-1.45/src/sg_stream_ctl.c:127:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sg_stream_ctl.c:194:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sg_stream_ctl.c:423:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char b[80];
data/sg3-utils-1.45/src/sg_stream_ctl.c:469:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char b[80];
data/sg3-utils-1.45/src/sg_sync.c:116:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sg_sync.c:290:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_test_rwbuf.c:115:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char b[128];
data/sg3-utils-1.45/src/sg_test_rwbuf.c:228:21:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        if (cmpbuf) memcpy (cmpbuf, (char*)buf, len);
data/sg3-utils-1.45/src/sg_test_rwbuf.c:259:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char b[128];
data/sg3-utils-1.45/src/sg_test_rwbuf.c:325:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char b[128];
data/sg3-utils-1.45/src/sg_test_rwbuf.c:534:17:  [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).
        sg_fd = open(device_name, O_RDWR | O_NONBLOCK);
data/sg3-utils-1.45/src/sg_timestamp.c:205:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sg_timestamp.c:265:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sg_timestamp.c:522:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char b[80];
data/sg3-utils-1.45/src/sg_turs.c:321: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 b[80];
data/sg3-utils-1.45/src/sg_unmap.c:264: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 line[1024];
data/sg3-utils-1.45/src/sg_unmap.c:272:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fp = fopen(file_name, "r");
data/sg3-utils-1.45/src/sg_unmap.c:675:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char b[120];
data/sg3-utils-1.45/src/sg_verify.c:166: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_verify.c:366:25:  [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 ((infd = open(file_name, O_RDONLY)) < 0) {
data/sg3-utils-1.45/src/sg_verify.c:417:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char b[80];
data/sg3-utils-1.45/src/sg_vpd.c:466:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static const char * sg_ansi_version_arr[16] =
data/sg3-utils-1.45/src/sg_vpd.c:715:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char b[1024];
data/sg3-utils-1.45/src/sg_vpd.c:949: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 b[1024];
data/sg3-utils-1.45/src/sg_vpd.c:950: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 sp[82];
data/sg3-utils-1.45/src/sg_vpd.c:1160: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 b[80];
data/sg3-utils-1.45/src/sg_vpd.c:1173:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(b, buff + 8, 8);
data/sg3-utils-1.45/src/sg_vpd.c:1176:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(b, buff + 16, 16);
data/sg3-utils-1.45/src/sg_vpd.c:1179:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(b, buff + 32, 4);
data/sg3-utils-1.45/src/sg_vpd.c:1274: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 b[64];
data/sg3-utils-1.45/src/sg_vpd.c:1603: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 b[120];
data/sg3-utils-1.45/src/sg_vpd.c:1920: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 b[64];
data/sg3-utils-1.45/src/sg_vpd.c:2196:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static const char * prov_type_arr[8] = {
data/sg3-utils-1.45/src/sg_vpd.c:2250:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char bb[1024];
data/sg3-utils-1.45/src/sg_vpd.c:2444: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 obuff[DEF_ALLOC_LEN];
data/sg3-utils-1.45/src/sg_vpd.c:2471:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(obuff, b + 4, len);
data/sg3-utils-1.45/src/sg_vpd.c:2698: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 obuff[DEF_ALLOC_LEN];
data/sg3-utils-1.45/src/sg_vpd.c:2699: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 b[48];
data/sg3-utils-1.45/src/sg_vpd.c:2839:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(obuff, rp + 4, len);
data/sg3-utils-1.45/src/sg_vpd.c:3448:21:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                    char b[80];
data/sg3-utils-1.45/src/sg_vpd.c:3484:21:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                    char b[80];
data/sg3-utils-1.45/src/sg_vpd.c:3544: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 b[64];
data/sg3-utils-1.45/src/sg_vpd.c:3569:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char b[80];
data/sg3-utils-1.45/src/sg_vpd.c:3967:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char b[80];
data/sg3-utils-1.45/src/sg_vpd_vendor.c:639:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char name[65];
data/sg3-utils-1.45/src/sg_vpd_vendor.c:654:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(name, buff + 16, 64);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:657:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(name, buff + 80, 16);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:660:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(name, buff + 96, 12);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:663:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(name, buff + 108, 4);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:666:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(name, buff + 112, 16);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:669:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(name, buff + 144, 8);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:672:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(name, buff + 152, 2);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:675:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(name, buff + 154, 4);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:685: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 part[5];
data/sg3-utils-1.45/src/sg_vpd_vendor.c:704:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(part, &buff[n], 4);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:727: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 part[5];
data/sg3-utils-1.45/src/sg_vpd_vendor.c:759:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(part, &buff[n], 4);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:803: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 subsystem_id[17];
data/sg3-utils-1.45/src/sg_vpd_vendor.c:804: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 subsystem_rev[5];
data/sg3-utils-1.45/src/sg_vpd_vendor.c:805: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 slot_id[3];
data/sg3-utils-1.45/src/sg_vpd_vendor.c:817:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(subsystem_id, &buff[8], 16);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:819:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(subsystem_rev, &buff[24], 4);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:876: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((char *)(dst+2*i), "%02x", *(src+i));
data/sg3-utils-1.45/src/sg_vpd_vendor.c:888: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 label[61];
data/sg3-utils-1.45/src/sg_vpd_vendor.c:890: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 uuid[33];
data/sg3-utils-1.45/src/sg_vpd_vendor.c:909: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(c,"%02x",buff[12 + i]);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:932: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(c,"%02x",buff[90 + i]);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:944: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(c,"%02x",buff[167 + i]);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:968:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(port_id, &buff[179], n);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:983:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(port_id, &buff[n], 8);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:1212: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 firmware_rev[25];
data/sg3-utils-1.45/src/sg_vpd_vendor.c:1213: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 build_date[43];
data/sg3-utils-1.45/src/sg_vpd_vendor.c:1214: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 hw_conf[21];
data/sg3-utils-1.45/src/sg_vpd_vendor.c:1215: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 fw_conf[21];
data/sg3-utils-1.45/src/sg_vpd_vendor.c:1223:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(firmware_rev, &buff[5], 24);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:1228:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(build_date, &buff[30], 42);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:1233:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(hw_conf, &buff[73], 20);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:1237:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(fw_conf, &buff[94], 20);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:1245:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[32];
data/sg3-utils-1.45/src/sg_vpd_vendor.c:1280:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(str, &buff[4], 26);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:1284:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(str, &buff[30], 19);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:1288:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(str, &buff[49], 24);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:1292:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(str, &buff[73], 23);
data/sg3-utils-1.45/src/sg_vpd_vendor.c:1401:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char name[64];
data/sg3-utils-1.45/src/sg_wr_mode.c:133:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char carry_over[4];
data/sg3-utils-1.45/src/sg_wr_mode.c:134:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char line[512];
data/sg3-utils-1.45/src/sg_wr_mode.c:345: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_wr_mode.c:346: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 errStr[128];
data/sg3-utils-1.45/src/sg_wr_mode.c:347: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 b[80];
data/sg3-utils-1.45/src/sg_wr_mode.c:597:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(ref_md + off, read_in, read_in_len);
data/sg3-utils-1.45/src/sg_write_buffer.c:221: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_write_buffer.c:427:29:  [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 ((infd = open(file_name, O_RDONLY)) < 0) {
data/sg3-utils-1.45/src/sg_write_buffer.c:571:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[80];
data/sg3-utils-1.45/src/sg_write_long.c:122: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 file_name[256];
data/sg3-utils-1.45/src/sg_write_long.c:123: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 b[80];
data/sg3-utils-1.45/src/sg_write_long.c:124: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_write_long.c:259:29:  [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 ((infd = open(file_name, O_RDONLY)) < 0) {
data/sg3-utils-1.45/src/sg_write_same.c:103: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 ifilename[256];
data/sg3-utils-1.45/src/sg_write_same.c:258:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sg_write_same.c:330: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_write_same.c:331: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 b[80];
data/sg3-utils-1.45/src/sg_write_same.c:609:29:  [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 ((infd = open(op->ifilename, O_RDONLY)) < 0) {
data/sg3-utils-1.45/src/sg_write_verify.c:133: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 b[32];
data/sg3-utils-1.45/src/sg_write_verify.c:137:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char d[128];
data/sg3-utils-1.45/src/sg_write_verify.c:255: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).
        fd = open(fn, O_RDONLY);
data/sg3-utils-1.45/src/sg_write_verify.c:301: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 cmd_name[32];
data/sg3-utils-1.45/src/sg_write_x.c:199: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 cdb_name[24];          /* e.g. 'Write atomic(16)' */
data/sg3-utils-1.45/src/sg_write_x.c:666: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 c[1024];
data/sg3-utils-1.45/src/sg_write_x.c:674:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(c, lcp, cp - lcp);  /* ... to just prior to first '#' */
data/sg3-utils-1.45/src/sg_write_x.c:813: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 line[1024];
data/sg3-utils-1.45/src/sg_write_x.c:829:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fp = fopen(scat_fname, "r");
data/sg3-utils-1.45/src/sg_write_x.c:1240:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sg_write_x.c:1290: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).
            w_fd = open(xx_wr_fname, O_WRONLY | O_CREAT | O_TRUNC, 0644);
data/sg3-utils-1.45/src/sg_write_x.c:1387: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 b[80];
data/sg3-utils-1.45/src/sg_write_x.c:1445:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(d, resp_buff + 14, 2);
data/sg3-utils-1.45/src/sg_write_x.c:1466:13:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
            strcpy(b,"OS error");
data/sg3-utils-1.45/src/sg_write_x.c:1477:13:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
            strcpy(b,"OS error");
data/sg3-utils-1.45/src/sg_write_x.c:1828: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 b[80];
data/sg3-utils-1.45/src/sg_write_x.c:1920:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(u2p, up, d);
data/sg3-utils-1.45/src/sg_write_x.c:2066:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(u2p, up, dd);
data/sg3-utils-1.45/src/sg_write_x.c:2132:9:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
        strcpy(b,"OS error");
data/sg3-utils-1.45/src/sg_write_x.c:2177: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_write_x.c:2178: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 b[80];
data/sg3-utils-1.45/src/sg_write_x.c:2324:25:  [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 ((infd = open(op->if_name, O_RDONLY)) < 0) {
data/sg3-utils-1.45/src/sg_write_x.c:2487:22:  [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).
            sfr_fd = open(op->scat_filename, O_RDONLY);
data/sg3-utils-1.45/src/sg_write_x.c:2614:9:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
        strcpy(b,"OS error");
data/sg3-utils-1.45/src/sg_xcopy.c:196: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 fname[INOUTF_SZ];
data/sg3-utils-1.45/src/sg_xcopy.c:268: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 a[128];
data/sg3-utils-1.45/src/sg_xcopy.c:269: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 b[128];
data/sg3-utils-1.45/src/sg_xcopy.c:273:23:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if (NULL == (fp = fopen(proc_devices, "r"))) {
data/sg3-utils-1.45/src/sg_xcopy.c:308: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_xcopy.c:321:19:  [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(ebuff, O_RDONLY)) >= 0) {
data/sg3-utils-1.45/src/sg_xcopy.c:627: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 b[80];
data/sg3-utils-1.45/src/sg_xcopy.c:635:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(xcopyBuff + desc_offset, src_desc, src_desc_len);
data/sg3-utils-1.45/src/sg_xcopy.c:637:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(xcopyBuff + desc_offset, dst_desc, dst_desc_len);
data/sg3-utils-1.45/src/sg_xcopy.c:663: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 b[80];
data/sg3-utils-1.45/src/sg_xcopy.c:710: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 b[80];
data/sg3-utils-1.45/src/sg_xcopy.c:1013: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 c[2048];
data/sg3-utils-1.45/src/sg_xcopy.c:1028: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 b[80];
data/sg3-utils-1.45/src/sg_xcopy.c:1112:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(desc + 4, best, best_len + 4);
data/sg3-utils-1.45/src/sg_xcopy.c:1162: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 buff[256];
data/sg3-utils-1.45/src/sg_xcopy.c:1205: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_xcopy.c:1221:17:  [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 ((infd = open(ifp->fname, fl | flags)) < 0) {
data/sg3-utils-1.45/src/sg_xcopy.c:1223:21:  [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 ((infd = open(ifp->fname, fl | flags)) < 0) {
data/sg3-utils-1.45/src/sg_xcopy.c:1255: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sg_xcopy.c:1269:22:  [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 ((outfd = open(ofp->fname, flags)) < 0) {
data/sg3-utils-1.45/src/sg_xcopy.c:1331:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[STR_SZ];
data/sg3-utils-1.45/src/sg_xcopy.c:1432:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(ixcf.fname, buf, INOUTF_SZ - 1);
data/sg3-utils-1.45/src/sg_xcopy.c:1447:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(oxcf.fname, buf, INOUTF_SZ - 1);
data/sg3-utils-1.45/src/sg_zone.c:122: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 b[64];
data/sg3-utils-1.45/src/sg_zone.c:131:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char d[128];
data/sg3-utils-1.45/src/sg_zone.c:316:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char b[80];
data/sg3-utils-1.45/src/sginfo.c:347: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 is_hex[MAXPARM];
data/sg3-utils-1.45/src/sginfo.c:443:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sginfo.c:551: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 unkn_page_str[64];
data/sg3-utils-1.45/src/sginfo.c:646: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 reason[REASON_SZ];
data/sg3-utils-1.45/src/sginfo.c:998:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(cbuffer1, msense6_resp, resplen);
data/sg3-utils-1.45/src/sginfo.c:1058:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(cbuffer1, msense10_resp, resplen);
data/sg3-utils-1.45/src/sginfo.c:1141: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 b[64];
data/sg3-utils-1.45/src/sginfo.c:3057:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char nm[8];
data/sg3-utils-1.45/src/sginfo.c:3072:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char prefix[96];
data/sg3-utils-1.45/src/sginfo.c:3166:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(deststr, srcbuf, i + 1);
data/sg3-utils-1.45/src/sginfo.c:3370: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 buff[MDEV_NAME_SZ];
data/sg3-utils-1.45/src/sginfo.c:3385:13:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
            strcat(fname, "xxxx");
data/sg3-utils-1.45/src/sginfo.c:3400:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char name[MDEV_NAME_SZ];
data/sg3-utils-1.45/src/sginfo.c:3401: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 dev_name[MDEV_NAME_SZ + 6];
data/sg3-utils-1.45/src/sginfo.c:3402: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sginfo.c:3449: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).
        fd = open(dev_name, O_RDONLY | O_NONBLOCK);
data/sg3-utils-1.45/src/sginfo.c:3495: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(name,"/dev/raw/raw%d",k);
data/sg3-utils-1.45/src/sginfo.c:3496:22:  [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, O_RDWR | O_NONBLOCK);
data/sg3-utils-1.45/src/sginfo.c:3503:22:  [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, O_RDWR | O_NONBLOCK);
data/sg3-utils-1.45/src/sginfo.c:3508:22:  [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, O_RDWR | O_NONBLOCK);
data/sg3-utils-1.45/src/sginfo.c:3580:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char name[DEVNAME_SZ];
data/sg3-utils-1.45/src/sginfo.c:3586:10:  [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, O_RDONLY | O_NONBLOCK);
data/sg3-utils-1.45/src/sginfo.c:3590:16:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fdrw = open(name, O_RDWR | O_NONBLOCK);
data/sg3-utils-1.45/src/sginfo.c:3623: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).
            fd = open(name, O_RDWR | O_NONBLOCK);
data/sg3-utils-1.45/src/sginfo.c:3628:26:  [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, O_RDWR | O_NONBLOCK);
data/sg3-utils-1.45/src/sginfo.c:3670:16:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        return open(name, O_RDWR | O_NONBLOCK);
data/sg3-utils-1.45/src/sgm_dd.c:496:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sgm_dd.c:589:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char b[128];
data/sg3-utils-1.45/src/sgm_dd.c:650: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 buff[256];
data/sg3-utils-1.45/src/sgm_dd.c:742: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 inf[INOUTF_SZ];
data/sg3-utils-1.45/src/sgm_dd.c:743:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[STR_SZ];
data/sg3-utils-1.45/src/sgm_dd.c:744: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 outf[INOUTF_SZ];
data/sg3-utils-1.45/src/sgm_dd.c:745: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sgm_dd.c:746: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 b[80];
data/sg3-utils-1.45/src/sgm_dd.c:817:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(inf, buf, INOUTF_SZ);
data/sg3-utils-1.45/src/sgm_dd.c:830:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(outf, buf, INOUTF_SZ);
data/sg3-utils-1.45/src/sgm_dd.c:981:25:  [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 ((infd = open(inf, flags)) < 0) {
data/sg3-utils-1.45/src/sgm_dd.c:1027:25:  [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 ((infd = open(inf, flags)) < 0) {
data/sg3-utils-1.45/src/sgm_dd.c:1070:26:  [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 ((outfd = open(outf, flags)) < 0) {
data/sg3-utils-1.45/src/sgm_dd.c:1122: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 ((outfd = open(outf, flags, 0666)) < 0) {
data/sg3-utils-1.45/src/sgm_dd.c:1131: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 ((outfd = open(outf, O_WRONLY)) < 0) {
data/sg3-utils-1.45/src/sgm_dd.c:1265:19:  [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(proc_allow_dio, O_RDONLY)) >= 0) {
data/sg3-utils-1.45/src/sgp_dd.c:257: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 infn[INOUTF_SZ];
data/sg3-utils-1.45/src/sgp_dd.c:258: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 outfn[INOUTF_SZ];
data/sg3-utils-1.45/src/sgp_dd.c:373: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 strerr_buff[STRERR_BUFF_LEN]; \
data/sg3-utils-1.45/src/sgp_dd.c:642: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 ebuff[800];
data/sg3-utils-1.45/src/sgp_dd.c:651: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).
    if ((fd = open(fnp, flags)) < 0) {
data/sg3-utils-1.45/src/sgp_dd.c:668: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 ebuff[800];
data/sg3-utils-1.45/src/sgp_dd.c:677: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).
    if ((fd = open(fnp, flags)) < 0) {
data/sg3-utils-1.45/src/sgp_dd.c:843: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 strerr_buff[STRERR_BUFF_LEN];
data/sg3-utils-1.45/src/sgp_dd.c:889: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 strerr_buff[STRERR_BUFF_LEN];
data/sg3-utils-1.45/src/sgp_dd.c:1223:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(&rep->io_hdr, &io_hdr, sizeof(struct sg_io_hdr));
data/sg3-utils-1.45/src/sgp_dd.c:1242:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sgp_dd.c:1271: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 buff[256];
data/sg3-utils-1.45/src/sgp_dd.c:1341:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[STR_SZ];
data/sg3-utils-1.45/src/sgp_dd.c:1350: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/src/sgp_dd.c:1433:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(infn, buf, INOUTF_SZ);
data/sg3-utils-1.45/src/sgp_dd.c:1452:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(outfn, buf, INOUTF_SZ);
data/sg3-utils-1.45/src/sgp_dd.c:1614: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 ((clp->infd = open(infn, flags)) < 0) {
data/sg3-utils-1.45/src/sgp_dd.c:1660:35:  [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 ((clp->outfd = open(outfn, flags, 0666)) < 0) {
data/sg3-utils-1.45/src/sgp_dd.c:1669:35:  [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 ((clp->outfd = open(outfn, O_WRONLY)) < 0) {
data/sg3-utils-1.45/src/sgp_dd.c:1925:19:  [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(proc_allow_dio, O_RDONLY)) >= 0) {
data/sg3-utils-1.45/testing/bsg_queue_tst.c:63: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/bsg_queue_tst.c:90:19:  [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 ((bsg_fd = open(file_name, O_RDWR)) < 0) {
data/sg3-utils-1.45/testing/sg_chk_asc.c:69: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 file_name[256];
data/sg3-utils-1.45/testing/sg_chk_asc.c:70:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char line[MAX_LINE_LEN];
data/sg3-utils-1.45/testing/sg_chk_asc.c:71: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 b[MAX_LINE_LEN];
data/sg3-utils-1.45/testing/sg_chk_asc.c:72: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 bb[MAX_LINE_LEN];
data/sg3-utils-1.45/testing/sg_chk_asc.c:130:10:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fp = fopen(file_name, "r");
data/sg3-utils-1.45/testing/sg_iovec_tst.c:229:17:  [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).
        sg_fd = open(sg_file_name, O_RDWR);
data/sg3-utils-1.45/testing/sg_iovec_tst.c:231:17:  [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).
        sg_fd = open(sg_file_name, O_RDONLY);
data/sg3-utils-1.45/testing/sg_iovec_tst.c:242:10:  [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(out_file_name, O_WRONLY | O_CREAT, 0666);
data/sg3-utils-1.45/testing/sg_queue_tst.c:112: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sg_queue_tst.c:122: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).
            q_len = atoi(argv[k] + 3);
data/sg3-utils-1.45/testing/sg_queue_tst.c:154: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).
    if ((sg_fd = open(file_name, O_RDWR)) < 0) {
data/sg3-utils-1.45/testing/sg_sense_test.c:104: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 b[2048];
data/sg3-utils-1.45/testing/sg_tst_async.cpp:427: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 b[160];
data/sg3-utils-1.45/testing/sg_tst_async.cpp:445: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).
    int fd = open(URANDOM_DEV, O_RDONLY);
data/sg3-utils-1.45/testing/sg_tst_async.cpp:449:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(&res, b, sizeof(unsigned int));
data/sg3-utils-1.45/testing/sg_tst_async.cpp:879: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 b[120];
data/sg3-utils-1.45/testing/sg_tst_async.cpp:1000: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sg_tst_async.cpp:1034: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).
    sg_fd = open(dev_name, open_flags);
data/sg3-utils-1.45/testing/sg_tst_async.cpp:1630: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).
    sg_fd = open(dev_name, open_flags);
data/sg3-utils-1.45/testing/sg_tst_async.cpp:1680:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(b, inqBuff + 16, 16);
data/sg3-utils-1.45/testing/sg_tst_async.cpp:1683:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(b, inqBuff + 16, b_mlen - 1);
data/sg3-utils-1.45/testing/sg_tst_async.cpp:1710: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).
    sg_fd = open(dev_name, open_flags);
data/sg3-utils-1.45/testing/sg_tst_async.cpp:1759: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 b[128];
data/sg3-utils-1.45/testing/sg_tst_async.cpp:1871: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).
                n = atoi(optarg);
data/sg3-utils-1.45/testing/sg_tst_async.cpp:1912: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).
                n = atoi(optarg);
data/sg3-utils-1.45/testing/sg_tst_async.cpp:1924: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).
                n = atoi(optarg);
data/sg3-utils-1.45/testing/sg_tst_async.cpp:1941:29:  [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).
                op->lb_sz = atoi(optarg);
data/sg3-utils-1.45/testing/sg_tst_async.cpp:1965:31:  [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).
                num_threads = atoi(optarg);
data/sg3-utils-1.45/testing/sg_tst_async.cpp:1987:37:  [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).
                    op->wait_ms = - atoi(optarg + 1);
data/sg3-utils-1.45/testing/sg_tst_async.cpp:1989:35:  [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).
                    op->wait_ms = atoi(optarg);
data/sg3-utils-1.45/testing/sg_tst_bidi.c:184: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sg_tst_bidi.c:189: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).
            lb_sz = atoi(argv[k] + 3);
data/sg3-utils-1.45/testing/sg_tst_bidi.c:196: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).
            dio_blks = atoi(argv[k] + 3);
data/sg3-utils-1.45/testing/sg_tst_bidi.c:224: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).
            q_len = atoi(argv[k] + 3);
data/sg3-utils-1.45/testing/sg_tst_bidi.c:234:31:  [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).
            reserve_buff_sz = atoi(argv[k] + 3);
data/sg3-utils-1.45/testing/sg_tst_bidi.c:241: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).
            rep_count = atoi(argv[k] + 3);
data/sg3-utils-1.45/testing/sg_tst_bidi.c:248:26:  [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).
            sleep_secs = atoi(argv[k] + 3);
data/sg3-utils-1.45/testing/sg_tst_bidi.c:313: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).
    if ((sg_fd = open(file_name, O_RDWR)) < 0) {
data/sg3-utils-1.45/testing/sg_tst_context.cpp:140: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 b[256];
data/sg3-utils-1.45/testing/sg_tst_context.cpp:185:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char turCmdBlk [TUR_CMD_LEN] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
data/sg3-utils-1.45/testing/sg_tst_context.cpp:186:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char sense_buffer[64];
data/sg3-utils-1.45/testing/sg_tst_context.cpp:230:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char ssuCmdBlk [SSU_CMD_LEN] = {0x1b, 0x0, 0x0, 0x0, 0x0, 0x0};
data/sg3-utils-1.45/testing/sg_tst_context.cpp:231:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char sense_buffer[64];
data/sg3-utils-1.45/testing/sg_tst_context.cpp:282: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sg_tst_context.cpp:382: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sg_tst_context.cpp:410:31:  [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).
                num_threads = atoi(argv[k]);
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:192:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char r16CmdBlk [READ16_CMD_LEN] =
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:194:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char w16CmdBlk [WRITE16_CMD_LEN] =
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:196:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char sense_buffer[64];
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:197:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char lb[READ16_REPLY_LEN];
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:198: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:208:22:  [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).
    while (((sg_fd = open(dev_name, open_flags)) < 0) &&
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:434:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char r16CmdBlk [READ16_CMD_LEN] =
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:436:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char w16CmdBlk [WRITE16_CMD_LEN] =
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:438:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char sense_buffer[64];
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:439:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char lb[READ16_REPLY_LEN];
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:440: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:450:22:  [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).
    while (((sg_fd = open(dev_name, open_flags)) < 0) &&
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:690:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char inqCmdBlk [INQ_CMD_LEN] =
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:692:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char inqBuff[INQ_REPLY_LEN];
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:693:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char sense_buffer[64];
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:694: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:699:22:  [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).
    while (((sg_fd = open(dev_name, open_flags)) < 0) &&
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:755:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(b, inqBuff + 16, 16);
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:758:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(b, inqBuff + 16, b_mlen - 1);
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:833: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 b[64];
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:846:30:  [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).
                sg_ifc_ver = atoi(argv[k]);
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:852:37:  [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).
                lba = (unsigned int)atoi(argv[k]);
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:858:34:  [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).
                num_per_thread = atoi(argv[k]);
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:864:31:  [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).
                num_threads = atoi(argv[k]);
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:874:33:  [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).
                    wait_ms = - atoi(argv[k] + 1);
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:876:31:  [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).
                    wait_ms = atoi(argv[k]);
data/sg3-utils-1.45/testing/sg_tst_excl2.cpp:151: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 b[256];
data/sg3-utils-1.45/testing/sg_tst_excl2.cpp:197:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char r16CmdBlk [READ16_CMD_LEN] =
data/sg3-utils-1.45/testing/sg_tst_excl2.cpp:199:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char w16CmdBlk [WRITE16_CMD_LEN] =
data/sg3-utils-1.45/testing/sg_tst_excl2.cpp:201:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char sense_buffer[64];
data/sg3-utils-1.45/testing/sg_tst_excl2.cpp:202:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char lb[READ16_REPLY_LEN];
data/sg3-utils-1.45/testing/sg_tst_excl2.cpp:203: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sg_tst_excl2.cpp:323:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char inqCmdBlk [INQ_CMD_LEN] =
data/sg3-utils-1.45/testing/sg_tst_excl2.cpp:325:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char inqBuff[INQ_REPLY_LEN];
data/sg3-utils-1.45/testing/sg_tst_excl2.cpp:326:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char sense_buffer[64];
data/sg3-utils-1.45/testing/sg_tst_excl2.cpp:327: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sg_tst_excl2.cpp:378:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(b, inqBuff + 16, 16);
data/sg3-utils-1.45/testing/sg_tst_excl2.cpp:381:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(b, inqBuff + 16, b_mlen - 1);
data/sg3-utils-1.45/testing/sg_tst_excl2.cpp:445: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 b[64];
data/sg3-utils-1.45/testing/sg_tst_excl2.cpp:458:37:  [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).
                lba = (unsigned int)atoi(argv[k]);
data/sg3-utils-1.45/testing/sg_tst_excl2.cpp:464:34:  [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).
                num_per_thread = atoi(argv[k]);
data/sg3-utils-1.45/testing/sg_tst_excl2.cpp:470:31:  [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).
                num_threads = atoi(argv[k]);
data/sg3-utils-1.45/testing/sg_tst_excl2.cpp:480:33:  [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).
                    wait_ms = - atoi(argv[k] + 1);
data/sg3-utils-1.45/testing/sg_tst_excl2.cpp:482:31:  [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).
                    wait_ms = atoi(argv[k]);
data/sg3-utils-1.45/testing/sg_tst_excl3.cpp:157:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char b[256];
data/sg3-utils-1.45/testing/sg_tst_excl3.cpp:203:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char r16CmdBlk [READ16_CMD_LEN] =
data/sg3-utils-1.45/testing/sg_tst_excl3.cpp:205:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char w16CmdBlk [WRITE16_CMD_LEN] =
data/sg3-utils-1.45/testing/sg_tst_excl3.cpp:207:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char sense_buffer[64];
data/sg3-utils-1.45/testing/sg_tst_excl3.cpp:208:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char lb[READ16_REPLY_LEN];
data/sg3-utils-1.45/testing/sg_tst_excl3.cpp:209: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sg_tst_excl3.cpp:331:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char inqCmdBlk [INQ_CMD_LEN] =
data/sg3-utils-1.45/testing/sg_tst_excl3.cpp:333:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char inqBuff[INQ_REPLY_LEN];
data/sg3-utils-1.45/testing/sg_tst_excl3.cpp:334:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char sense_buffer[64];
data/sg3-utils-1.45/testing/sg_tst_excl3.cpp:335: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sg_tst_excl3.cpp:378:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(b, inqBuff + 16, 16);
data/sg3-utils-1.45/testing/sg_tst_excl3.cpp:381:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(b, inqBuff + 16, b_mlen - 1);
data/sg3-utils-1.45/testing/sg_tst_excl3.cpp:447: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 b[64];
data/sg3-utils-1.45/testing/sg_tst_excl3.cpp:460:37:  [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).
                lba = (unsigned int)atoi(argv[k]);
data/sg3-utils-1.45/testing/sg_tst_excl3.cpp:466:34:  [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).
                num_per_thread = atoi(argv[k]);
data/sg3-utils-1.45/testing/sg_tst_excl3.cpp:472:31:  [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).
                num_threads = atoi(argv[k]);
data/sg3-utils-1.45/testing/sg_tst_excl3.cpp:484:33:  [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).
                    wait_ms = - atoi(argv[k] + 1);
data/sg3-utils-1.45/testing/sg_tst_excl3.cpp:486:31:  [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).
                    wait_ms = atoi(argv[k]);
data/sg3-utils-1.45/testing/sg_tst_ioctl.c:205:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char        control[CMSG_SPACE(sizeof (int))];
data/sg3-utils-1.45/testing/sg_tst_ioctl.c:252:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char        control[CMSG_SPACE(sizeof (int))];
data/sg3-utils-1.45/testing/sg_tst_ioctl.c:333: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 b[64];
data/sg3-utils-1.45/testing/sg_tst_ioctl.c:579:21:  [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_ma = open(fnp, O_RDWR);
data/sg3-utils-1.45/testing/sg_tst_ioctl.c:764: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sg_tst_ioctl.c:785: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).
            q_len = atoi(argv[k] + 3);
data/sg3-utils-1.45/testing/sg_tst_ioctl.c:822:31:  [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).
            reserve_buff_sz = atoi(argv[k] + 3);
data/sg3-utils-1.45/testing/sg_tst_ioctl.c:829:26:  [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).
            sleep_secs = atoi(argv[k] + 3);
data/sg3-utils-1.45/testing/sg_tst_ioctl.c:933: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).
    if ((sg_fd = open(file_name, O_RDWR)) < 0) {
data/sg3-utils-1.45/testing/sg_tst_ioctl.c:1007:23:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        if ((sg_fd2 = open(second_fname, O_RDWR)) < 0) {
data/sg3-utils-1.45/testing/sg_tst_nvme.c:80:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static const char * sg_ansi_version_arr[16] =
data/sg3-utils-1.45/testing/sg_tst_nvme.c:102:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static const char * dev_name_arr[MAX_DEV_NAMES] = {
data/sg3-utils-1.45/testing/sg_tst_nvme.c:386: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 b[32];
data/sg3-utils-1.45/testing/sg_tst_nvme.c:390:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(ucmd, cmdp, clen);
data/sg3-utils-1.45/testing/sg_tst_nvme.c:606: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 cmd_name[32];
data/sg3-utils-1.45/testing/sg_tst_nvme.c:607: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 b[2048];
data/sg3-utils-1.45/testing/sg_tst_nvme.c:619:13:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
            strcpy(cmd_name, "Identify(ctl)");
data/sg3-utils-1.45/testing/sg_tst_nvme.c:623:13:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
            strcpy(cmd_name, "INQUIRY(vpd=0x83)");
data/sg3-utils-1.45/testing/sg_tst_nvme.c:650:13:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
            strcpy(cmd_name, "Identify(ns)");
data/sg3-utils-1.45/testing/sg_tst_nvme.c:661:13:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
            strcpy(cmd_name, "Device self-test");
data/sg3-utils-1.45/testing/sg_tst_nvme.c:712:9:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
        strcpy(cmd_name, "Identify(ns)");
data/sg3-utils-1.45/testing/sgh_dd.cpp:447: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 b[180];
data/sg3-utils-1.45/testing/sgh_dd.cpp:605: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 b[80];
data/sg3-utils-1.45/testing/sgh_dd.cpp:641: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).
    int fd = open(URANDOM_DEV, O_RDONLY);
data/sg3-utils-1.45/testing/sgh_dd.cpp:645:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(&res, b, sizeof(unsigned int));
data/sg3-utils-1.45/testing/sgh_dd.cpp:655: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 b[96];
data/sg3-utils-1.45/testing/sgh_dd.cpp:659:10:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fp = fopen(PROC_SCSI_SG_VERSION, "r");
data/sg3-utils-1.45/testing/sgh_dd.cpp:668:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fp = fopen(SYS_SCSI_SG_VERSION, "r");
data/sg3-utils-1.45/testing/sgh_dd.cpp:805: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 strerr_buff[STRERR_BUFF_LEN]; \
data/sg3-utils-1.45/testing/sgh_dd.cpp:1633:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char bb[64];
data/sg3-utils-1.45/testing/sgh_dd.cpp:1695: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 strerr_buff[STRERR_BUFF_LEN];
data/sg3-utils-1.45/testing/sgh_dd.cpp:1755: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 strerr_buff[STRERR_BUFF_LEN];
data/sg3-utils-1.45/testing/sgh_dd.cpp:2216:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char b[256];
data/sg3-utils-1.45/testing/sgh_dd.cpp:2271: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 b[80];
data/sg3-utils-1.45/testing/sgh_dd.cpp:2496: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 b[80];
data/sg3-utils-1.45/testing/sgh_dd.cpp:2521:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(cmd_ap + (k * max_cdb_sz), cmdp, h4p->request_len);
data/sg3-utils-1.45/testing/sgh_dd.cpp:2610:21:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                    memcpy(cmd_ap + (k * max_cdb_sz), cmdp, h4p->request_len);
data/sg3-utils-1.45/testing/sgh_dd.cpp:2640:21:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                    memcpy(cmd_ap + (k * max_cdb_sz), cmdp, h4p->request_len);
data/sg3-utils-1.45/testing/sgh_dd.cpp:2792: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 b[80];
data/sg3-utils-1.45/testing/sgh_dd.cpp:2888:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char prefix[128];
data/sg3-utils-1.45/testing/sgh_dd.cpp:2983:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(cmdp, rep->cmd, cdbsz);
data/sg3-utils-1.45/testing/sgh_dd.cpp:3123:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(&rep->io_hdr, &io_hdr, sizeof(struct sg_io_hdr));
data/sg3-utils-1.45/testing/sgh_dd.cpp:3142:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sgh_dd.cpp:3211:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sgh_dd.cpp:3534: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 buff[256];
data/sg3-utils-1.45/testing/sgh_dd.cpp:3642: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sgh_dd.cpp:3651: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).
    if ((fd = open(inf, flags)) < 0) {
data/sg3-utils-1.45/testing/sgh_dd.cpp:3676: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sgh_dd.cpp:3685: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).
    if ((fd = open(outf, flags)) < 0) {
data/sg3-utils-1.45/testing/sgh_dd.cpp:3719:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[STR_SZ];
data/sg3-utils-1.45/testing/sgh_dd.cpp:3812:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(inf, buf, INOUTF_SZ);
data/sg3-utils-1.45/testing/sgh_dd.cpp:3857:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(out2f, buf, INOUTF_SZ);
data/sg3-utils-1.45/testing/sgh_dd.cpp:3865:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(outregf, buf, INOUTF_SZ);
data/sg3-utils-1.45/testing/sgh_dd.cpp:3879:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(outf, buf, INOUTF_SZ);
data/sg3-utils-1.45/testing/sgh_dd.cpp:4084: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 inf[INOUTF_SZ];
data/sg3-utils-1.45/testing/sgh_dd.cpp:4085: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 outf[INOUTF_SZ];
data/sg3-utils-1.45/testing/sgh_dd.cpp:4086: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 out2f[INOUTF_SZ];
data/sg3-utils-1.45/testing/sgh_dd.cpp:4087: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 outregf[INOUTF_SZ];
data/sg3-utils-1.45/testing/sgh_dd.cpp:4095: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sgh_dd.cpp:4165: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 ((clp->infd = open(inf, flags)) < 0) {
data/sg3-utils-1.45/testing/sgh_dd.cpp:4225:35:  [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 ((clp->outfd = open(outf, flags, 0666)) < 0) {
data/sg3-utils-1.45/testing/sgh_dd.cpp:4234:35:  [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 ((clp->outfd = open(outf, O_WRONLY)) < 0) {
data/sg3-utils-1.45/testing/sgh_dd.cpp:4293:36:  [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 ((clp->out2fd = open(out2f, flags, 0666)) < 0) {
data/sg3-utils-1.45/testing/sgh_dd.cpp:4302:36:  [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 ((clp->out2fd = open(out2f, O_WRONLY)) < 0) {
data/sg3-utils-1.45/testing/sgh_dd.cpp:4381: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 ((clp->outregfd = open(outregf, O_WRONLY | O_CREAT, 0666)) < 0) {
data/sg3-utils-1.45/testing/sgh_dd.cpp:4638:19:  [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(proc_allow_dio, O_RDONLY)) >= 0) {
data/sg3-utils-1.45/testing/sgs_dd.c:404:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(&rep->io_hdr, &io_hdr, sizeof(sg_io_hdr_t));
data/sg3-utils-1.45/testing/sgs_dd.c:479:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(&rep->io_v4, &io_v4, sizeof(struct sg_io_v4));
data/sg3-utils-1.45/testing/sgs_dd.c:643: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sgs_dd.c:715: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sgs_dd.c:960: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 buff[256];
data/sg3-utils-1.45/testing/sgs_dd.c:1017:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[STR_SZ];
data/sg3-utils-1.45/testing/sgs_dd.c:1020: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 inf[INOUTF_SZ];
data/sg3-utils-1.45/testing/sgs_dd.c:1021: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 outf[INOUTF_SZ];
data/sg3-utils-1.45/testing/sgs_dd.c:1022: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 ebuff[EBUFF_SZ];
data/sg3-utils-1.45/testing/sgs_dd.c:1058:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(inf, buf, INOUTF_SZ);
data/sg3-utils-1.45/testing/sgs_dd.c:1068:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(outf, buf, INOUTF_SZ);
data/sg3-utils-1.45/testing/sgs_dd.c:1130:26:  [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 ((clp->infd = open(inf, open_fl | O_RDONLY)) < 0) {
data/sg3-utils-1.45/testing/sgs_dd.c:1153: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 ((clp->infd = open(inf, open_fl)) < 0) {
data/sg3-utils-1.45/testing/sgs_dd.c:1172:27:  [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 ((clp->outfd = open(outf, open_fl)) >= 0) {
data/sg3-utils-1.45/testing/sgs_dd.c:1195:31:  [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 ((clp->outfd = open(outf, open_fl, 0666)) < 0) {
data/sg3-utils-1.45/testing/sgs_dd.c:1219:22:  [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).
        clp->outfd = open("/dev/null", O_RDWR);
data/sg3-utils-1.45/testing/tst_sg_lib.c:230: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 b[2048];
data/sg3-utils-1.45/testing/tst_sg_lib.c:231: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 bb[256];
data/sg3-utils-1.45/testing/tst_sg_lib.c:616:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(arr + OFF, &count16, 2);
data/sg3-utils-1.45/testing/tst_sg_lib.c:617:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(&count16, arr + OFF, 2);
data/sg3-utils-1.45/testing/tst_sg_lib.c:622:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(arr + OFF, &count32, 4);
data/sg3-utils-1.45/testing/tst_sg_lib.c:623:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(&count32, arr + OFF, 4);
data/sg3-utils-1.45/testing/tst_sg_lib.c:628:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(arr + OFF, &count64, 8);
data/sg3-utils-1.45/testing/tst_sg_lib.c:629:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(&count64, arr + OFF, 8);
data/sg3-utils-1.45/testing/uapi_sg.h:408:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	unsigned char sense_buffer[SG_MAX_SENSE];
data/sg3-utils-1.45/utils/hxascdmp.c:97: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 lb[32];
data/sg3-utils-1.45/utils/hxascdmp.c:115:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(lb, buf, len);
data/sg3-utils-1.45/utils/hxascdmp.c:206: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 buff[MAX_LINE_LENGTH];
data/sg3-utils-1.45/utils/hxascdmp.c:235:13:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        k = sprintf(buff + 1, "%.2lx", a);
data/sg3-utils-1.45/utils/hxascdmp.c:248:21:  [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.
                k = sprintf(buff + 1, "%.2lx", a);
data/sg3-utils-1.45/utils/hxascdmp.c:256: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(&buff[bpos], "%.2x", (int)(unsigned char)c);
data/sg3-utils-1.45/utils/hxascdmp.c:271: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 buff[MAX_LINE_LENGTH];
data/sg3-utils-1.45/utils/hxascdmp.c:291:13:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        k = sprintf(buff + 1, "%.2lx", a);
data/sg3-utils-1.45/utils/hxascdmp.c:303:21:  [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.
                k = sprintf(buff + 1, "%.2lx", a);
data/sg3-utils-1.45/utils/hxascdmp.c:311: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(&buff[bpos], "%.2x", (int)(unsigned char)c);
data/sg3-utils-1.45/utils/hxascdmp.c:349: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 buff[8192];
data/sg3-utils-1.45/utils/hxascdmp.c:446:22:  [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).
            inFile = open(argv[k], O_RDONLY);
data/sg3-utils-1.45/utils/hxascdmp.c:479:29:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                            memcpy(&us, buff, 2);
data/sg3-utils-1.45/examples/sg__sat_set_features.c:174:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(device_name, argv[optind], sizeof(device_name) - 1);
data/sg3-utils-1.45/examples/sgq_dd.c:353:20:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while (((res = read(rep->infd, rep->buffp,
data/sg3-utils-1.45/examples/sgq_dd.c:532:20:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while (((res = read(wr ? rep->outfd : rep->infd, &io_hdr,
data/sg3-utils-1.45/examples/sgq_dd.c:769:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(str, argv[k], STR_SZ);
data/sg3-utils-1.45/examples/sgq_dd.c:776:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        keylen = strlen(key);
data/sg3-utils-1.45/examples/sgq_dd.c:778:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(inf, buf, INOUTF_SZ);
data/sg3-utils-1.45/examples/sgq_dd.c:780:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(outf, buf, INOUTF_SZ);
data/sg3-utils-1.45/examples/sgq_dd.c:1113:17:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
                usleep(200);
data/sg3-utils-1.45/examples/sgq_dd.c:1218:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            if (1 == read(fd, &c, 1)) {
data/sg3-utils-1.45/getopt_long/getopt_long.c:345:23:  [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).
			current_argv_len = strlen(current_argv);
data/sg3-utils-1.45/getopt_long/getopt_long.c:353: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).
			if (strlen(long_options[i].name) ==
data/sg3-utils-1.45/lib/sg_cmds_basic.c:148: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).
        if (leadin && (strlen(leadin) > 0))
data/sg3-utils-1.45/lib/sg_lib.c:182:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        j = (int)strlen(b);
data/sg3-utils-1.45/lib/sg_lib.c:846:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (strlen(lip) > 0)
data/sg3-utils-1.45/lib/sg_lib.c:1822:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if (strlen(lip) > 0)
data/sg3-utils-1.45/lib/sg_lib.c:1923:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (strlen(lip) > 0)
data/sg3-utils-1.45/lib/sg_lib.c:2625:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(b, vp->name, b_len);
data/sg3-utils-1.45/lib/sg_lib.c:2742:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        len = strlen(safe_errbuf);
data/sg3-utils-1.45/lib/sg_lib.c:2754: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).
    for (k = ((int)strlen(b) - 1); k >= 0; --k) {
data/sg3-utils-1.45/lib/sg_lib.c:2900: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).
        bpstart = strlen(leadin);
data/sg3-utils-1.45/lib/sg_lib.c:3138:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    len = strlen(buf);
data/sg3-utils-1.45/lib/sg_lib.c:3256:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    len = strlen(buf);
data/sg3-utils-1.45/lib/sg_lib.c:3301:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    len = strlen(buf);
data/sg3-utils-1.45/lib/sg_lib.c:3442:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    len = strlen(buf);
data/sg3-utils-1.45/lib/sg_lib.c:3478:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    fn_len = strlen(fname);
data/sg3-utils-1.45/lib/sg_lib.c:3494:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        k = read(fd, mp_arr, max_arr_len);
data/sg3-utils-1.45/lib/sg_lib.c:3509:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                m = read(fd, mp_arr + k, max_arr_len - k);
data/sg3-utils-1.45/lib/sg_lib.c:3547:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        in_len = strlen(line);
data/sg3-utils-1.45/lib/sg_lib.c:3624:45:  [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 (split_line && (1 == strlen(lcp))) {
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:203:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(b, device_name, PATH_MAX - 1);
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:932:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
        strncpy(b, "no transport error available", max_b_len);
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:946:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
        strncpy(b, "no transport error available", max_b_len);
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:950:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy(b, "no transport error available", max_b_len);
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:1004:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(b, cp, max_b_len);
data/sg3-utils-1.45/lib/sg_pt_freebsd.c:1005:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if ((int)strlen(cp) >= max_b_len)
data/sg3-utils-1.45/lib/sg_pt_linux.c:143:19:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
        if ((1 == sscanf(b, "%126s", a)) &&
data/sg3-utils-1.45/lib/sg_pt_linux.c:148:18:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
        if (2 == sscanf(b, "%d %126s", &n, a)) {
data/sg3-utils-1.45/lib/sg_pt_linux.c:973:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(b, cp, max_b_len);
data/sg3-utils-1.45/lib/sg_pt_linux.c:974:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if ((int)strlen(cp) >= max_b_len)
data/sg3-utils-1.45/lib/sg_pt_linux_nvme.c:152:44:  [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).
    tlen = (cp - nvme_block_devname) + 4 + strlen(buff);
data/sg3-utils-1.45/lib/sg_pt_osf1.c:581:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
        strncpy(b, "no transport error available", max_b_len);
data/sg3-utils-1.45/lib/sg_pt_osf1.c:585:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy(b, "no transport error available", max_b_len);
data/sg3-utils-1.45/lib/sg_pt_osf1.c:597:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(b, cp, max_b_len);
data/sg3-utils-1.45/lib/sg_pt_osf1.c:598:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if ((int)strlen(cp) >= max_b_len)
data/sg3-utils-1.45/lib/sg_pt_solaris.c:478:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(b, cp, max_b_len);
data/sg3-utils-1.45/lib/sg_pt_solaris.c:479:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if ((int)strlen(cp) >= max_b_len)
data/sg3-utils-1.45/lib/sg_pt_win32.c:398:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    len = (int)strlen(device_name);
data/sg3-utils-1.45/lib/sg_pt_win32.c:442:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy(shp->adapter, "\\\\.\\", 4);
data/sg3-utils-1.45/lib/sg_pt_win32.c:1436:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(b, cp, max_b_len);
data/sg3-utils-1.45/lib/sg_pt_win32.c:1437:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if ((int)strlen(cp) >= max_b_len)
data/sg3-utils-1.45/src/sg_compare_and_write.c:517:28:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        ifn_stdin = ((1 == strlen(op->ifn)) && ('-' == op->ifn[0]));
data/sg3-utils-1.45/src/sg_compare_and_write.c:524:27:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                if ((1 == strlen(op->wfn)) && ('-' == op->wfn[0])) {
data/sg3-utils-1.45/src/sg_compare_and_write.c:552:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                res = read(infd, wrkBuff, half_xlen);
data/sg3-utils-1.45/src/sg_compare_and_write.c:561:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                res = read(wfd, wrkBuff + half_xlen, half_xlen);
data/sg3-utils-1.45/src/sg_compare_and_write.c:571:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                res = read(infd, wrkBuff, op->xfer_len);
data/sg3-utils-1.45/src/sg_copy_results.c:227: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).
            while (strlen(seg_desc->desc)) {
data/sg3-utils-1.45/src/sg_copy_results.c:233: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).
                   strlen(seg_desc->desc) ? seg_desc->desc : "Reserved");
data/sg3-utils-1.45/src/sg_copy_results.c:241: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).
            while (strlen(tgt_desc->desc)) {
data/sg3-utils-1.45/src/sg_copy_results.c:247: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).
                   strlen(tgt_desc->desc) ? tgt_desc->desc : "Reserved");
data/sg3-utils-1.45/src/sg_dd.c:273:19:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
        if ((1 == sscanf(b, "%126s", a)) &&
data/sg3-utils-1.45/src/sg_dd.c:278:18:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
        if (2 == sscanf(b, "%d %126s", &n, a)) {
data/sg3-utils-1.45/src/sg_dd.c:299:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    size_t len = strlen(filename);
data/sg3-utils-1.45/src/sg_dd.c:1155:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(buff, arg, sizeof(buff));
data/sg3-utils-1.45/src/sg_dd.c:1210:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(buff, arg, sizeof(buff));
data/sg3-utils-1.45/src/sg_dd.c:1582:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(str, argv[k], STR_SZ);
data/sg3-utils-1.45/src/sg_dd.c:1590:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        keylen = strlen(key);
data/sg3-utils-1.45/src/sg_dd.c:2063:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            while (((res = read(infd, wrkPos, blocks * blk_sz)) < 0) &&
data/sg3-utils-1.45/src/sg_dd.c:2344:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            if (1 == read(fd, &c, 1)) {
data/sg3-utils-1.45/src/sg_decode_sense.c:211:25:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                    if (strlen(op->no_space_str) > sizeof(concat_buff)) {
data/sg3-utils-1.45/src/sg_decode_sense.c:217:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                if ((strlen(concat_buff) + strlen(avp)) >=
data/sg3-utils-1.45/src/sg_decode_sense.c:217:44:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                if ((strlen(concat_buff) + strlen(avp)) >=
data/sg3-utils-1.45/src/sg_format.c:939: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).
                n = strlen(get_lu_name(b, n + 4, a, sizeof(a)));
data/sg3-utils-1.45/src/sg_get_config.c:788:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(buff, (const char *)(bp + 4), n);
data/sg3-utils-1.45/src/sg_get_config.c:1087:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if (strlen(cp) > 0)
data/sg3-utils-1.45/src/sg_inq.c:618:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        plen = strlen(cp);
data/sg3-utils-1.45/src/sg_inq.c:2756:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(buff, sg_ansi_version_arr[version], buff_len - 1);
data/sg3-utils-1.45/src/sg_inq.c:2800:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (strlen(cp) > 0)
data/sg3-utils-1.45/src/sg_inq.c:2838:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (strlen(cp) > 0)
data/sg3-utils-1.45/src/sg_logs.c:801:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        len = strlen(vpp->acron);
data/sg3-utils-1.45/src/sg_logs.c:817: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).
    size_t t10_v_len = strlen(t10_vendor_str);
data/sg3-utils-1.45/src/sg_logs.c:818: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).
    size_t t10_p_len = strlen(t10_product_str);
data/sg3-utils-1.45/src/sg_logs.c:827: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).
            len = strlen(vpp->t10_vendorp);
data/sg3-utils-1.45/src/sg_logs.c:834: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).
            len = strlen(vpp->t10_productp);
data/sg3-utils-1.45/src/sg_logs.c:1095:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        plen = strlen(cp);
data/sg3-utils-1.45/src/sg_logs.c:1220:25:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                    if (strlen(ccp) >= (sizeof(b) - 1)) {
data/sg3-utils-1.45/src/sg_logs.c:6769:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (strlen(op->pg_arg) >= (sizeof(b) - 1)) {
data/sg3-utils-1.45/src/sg_luns.c:148:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(l_leadin, leadin, sizeof(l_leadin) - 3);
data/sg3-utils-1.45/src/sg_luns.c:522:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            m = strlen(cp);    /* must be at least 1 char in test_arg */
data/sg3-utils-1.45/src/sg_map26.c:208:23:  [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(safe_errbuf);
data/sg3-utils-1.45/src/sg_map26.c:378:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(nd_match.dir_name, dir_name, D_NAME_LEN_MAX - 1);
data/sg3-utils-1.45/src/sg_map26.c:415:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(for_first.name, s->d_name, NAME_LEN_MAX);
data/sg3-utils-1.45/src/sg_map26.c:458:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy(from_sg.name, s->d_name, NAME_LEN_MAX);
data/sg3-utils-1.45/src/sg_map26.c:463:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy(from_sg.name, s->d_name, NAME_LEN_MAX);
data/sg3-utils-1.45/src/sg_map26.c:472:23:  [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->d_name);
data/sg3-utils-1.45/src/sg_map26.c:526:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy(to_sg.name, s->d_name, NAME_LEN_MAX);
data/sg3-utils-1.45/src/sg_map26.c:559:9:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
        strcat(buff, "/");
data/sg3-utils-1.45/src/sg_map26.c:580:9:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
        strcat(buff, "/");
data/sg3-utils-1.45/src/sg_map26.c:591:9:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
        strcat(buff, "/");
data/sg3-utils-1.45/src/sg_map26.c:616:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                if (base_name && (strlen(base_name) > 0)) {
data/sg3-utils-1.45/src/sg_map26.c:617:25:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
                        strcat(buff, "/");
data/sg3-utils-1.45/src/sg_map26.c:629:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        len = strlen(value);
data/sg3-utils-1.45/src/sg_map26.c:1070:25:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                        strncpy(device_dir, optarg, sizeof(device_dir) - 1);
data/sg3-utils-1.45/src/sg_map26.c:1114:25:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                        strncpy(device_name, argv[optind],
data/sg3-utils-1.45/src/sg_modes.c:606:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        plen = strlen(cp);
data/sg3-utils-1.45/src/sg_opcodes.c:352:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if (strlen(optarg) >= (sizeof(b) - 1)) {
data/sg3-utils-1.45/src/sg_opcodes.c:359:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy(b, optarg, cp - optarg);
data/sg3-utils-1.45/src/sg_opcodes.c:390:28:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            else if ((2 == strlen(optarg)) && (0 == strcmp("-1", optarg)))
data/sg3-utils-1.45/src/sg_opcodes.c:461:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        plen = strlen(cp);
data/sg3-utils-1.45/src/sg_opcodes.c:845:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    len = strlen(b);
data/sg3-utils-1.45/src/sg_opcodes.c:1088:21:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                if (strlen(cp) > 0)
data/sg3-utils-1.45/src/sg_persist.c:712:40:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        len = ecp ? (ecp - lcp) : (int)strlen(lcp);
data/sg3-utils-1.45/src/sg_persist.c:768:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        in_len = strlen(line);
data/sg3-utils-1.45/src/sg_persist.c:821:41:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                if (split_line && (1 == strlen(lcp))) {
data/sg3-utils-1.45/src/sg_persist.c:885:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    in_len = strlen(inp);
data/sg3-utils-1.45/src/sg_persist.c:1267:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if (strlen(cp) > 0)
data/sg3-utils-1.45/src/sg_raw.c:332:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        done = read(fd, buffer, amount);
data/sg3-utils-1.45/src/sg_raw.c:394:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        len = read(fd, buf + boff , tot_len - boff);
data/sg3-utils-1.45/src/sg_raw.c:430:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        ((1 == strlen(filename)) && ('-' == filename[0])))
data/sg3-utils-1.45/src/sg_raw.c:712: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).
                    ! ((1 == strlen(op->datain_file)) &&
data/sg3-utils-1.45/src/sg_rbuf.c:250:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        plen = strlen(cp);
data/sg3-utils-1.45/src/sg_read.c:446:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(str, argv[k], STR_SZ);
data/sg3-utils-1.45/src/sg_read.c:454:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        keylen = strlen(key);
data/sg3-utils-1.45/src/sg_read.c:812:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            while (((res = read(infd, wrkPos, blocks * bs)) < 0) &&
data/sg3-utils-1.45/src/sg_read.c:913:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            if (1 == read(fd, &c, 1)) {
data/sg3-utils-1.45/src/sg_read_buffer.c:487:23:  [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(optarg);
data/sg3-utils-1.45/src/sg_read_long.c:175:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(out_fname, optarg, sizeof(out_fname) - 1);
data/sg3-utils-1.45/src/sg_readcap.c:262:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        plen = strlen(cp);
data/sg3-utils-1.45/src/sg_reassign.c:124:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    in_len = strlen(inp);
data/sg3-utils-1.45/src/sg_reassign.c:135:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            in_len = strlen(line);
data/sg3-utils-1.45/src/sg_safte.c:656:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if (strlen(cp) > 0)
data/sg3-utils-1.45/src/sg_sanitize.c:434:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        n = strlen(get_lu_name(b, n + 4, a, sizeof(a)));
data/sg3-utils-1.45/src/sg_sanitize.c:689:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            res = read(infd, wBuff + 4, op->ipl);
data/sg3-utils-1.45/src/sg_scan_linux.c:209:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        plen = strlen(cp);
data/sg3-utils-1.45/src/sg_scan_linux.c:557:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    for (k = strlen(in) - 1; k >= first && isspace((int)in[k]); k--)
data/sg3-utils-1.45/src/sg_scan_win32.c:612:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            n = strlen(sp->volume_letters);
data/sg3-utils-1.45/src/sg_senddiag.c:292:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        plen = strlen(cp);
data/sg3-utils-1.45/src/sg_senddiag.c:487:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    in_len = strlen(inp);
data/sg3-utils-1.45/src/sg_senddiag.c:500:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            in_len = strlen(line);
data/sg3-utils-1.45/src/sg_senddiag.c:552:45:  [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 (split_line && (1 == strlen(lcp))) {
data/sg3-utils-1.45/src/sg_ses.c:1030:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        n = strlen(op->index_str);
data/sg3-utils-1.45/src/sg_ses.c:1094: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).
        int b_len = strlen(b);
data/sg3-utils-1.45/src/sg_ses.c:1097:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            n = strlen(etp->abbrev);
data/sg3-utils-1.45/src/sg_ses.c:1153:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if ((strlen(optarg) > 2) && ('X' == toupper(optarg[1])))
data/sg3-utils-1.45/src/sg_ses.c:1178:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if (strlen(optarg) >= CGS_STR_MAX_SZ) {
data/sg3-utils-1.45/src/sg_ses.c:1218:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if (strlen(optarg) >= CGS_STR_MAX_SZ) {
data/sg3-utils-1.45/src/sg_ses.c:1323:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if (strlen(optarg) >= CGS_STR_MAX_SZ) {
data/sg3-utils-1.45/src/sg_ses.c:1736: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).
            len = strlen(etp->desc);
data/sg3-utils-1.45/src/sg_ses.c:1740:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy(b, etp->desc, mlen_b - 1);
data/sg3-utils-1.45/src/sg_ses.c:3006:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
        strncpy(buff, "<res>", buff_len);
data/sg3-utils-1.45/src/sg_ses.c:3883:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (strlen(cp) > 0) {
data/sg3-utils-1.45/src/sg_ses.c:3924:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    in_len = strlen(inp);
data/sg3-utils-1.45/src/sg_ses.c:3945:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        k = read(fd, arr, mx_arr_len);
data/sg3-utils-1.45/src/sg_ses.c:3959:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                m = read(fd, arr + k, mx_arr_len - k);
data/sg3-utils-1.45/src/sg_ses.c:3993:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            in_len = strlen(line);
data/sg3-utils-1.45/src/sg_ses.c:4050:45:  [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 (split_line && (1 == strlen(lcp))) {
data/sg3-utils-1.45/src/sg_ses.c:4620:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    dn_len = op->desc_name ? (int)strlen(op->desc_name) : 0;
data/sg3-utils-1.45/src/sg_ses.c:5304:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    dn_len = op->desc_name ? (int)strlen(op->desc_name) : 0;
data/sg3-utils-1.45/src/sg_ses.c:5416:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    len = strlen(op->nickname_str);
data/sg3-utils-1.45/src/sg_ses_microcode.c:275:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (strlen(cp) > 0) {
data/sg3-utils-1.45/src/sg_ses_microcode.c:568:23:  [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(optarg);
data/sg3-utils-1.45/src/sg_ses_microcode.c:785:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        res = read(infd, dmp, op->mc_len);
data/sg3-utils-1.45/src/sg_start.c:269:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (1 == strlen(argv[optind])) {
data/sg3-utils-1.45/src/sg_start.c:305:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        plen = strlen(cp);
data/sg3-utils-1.45/src/sg_stpg.c:303:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    in_len = strlen(inp);
data/sg3-utils-1.45/src/sg_stpg.c:350:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    in_len = strlen(inp);
data/sg3-utils-1.45/src/sg_turs.c:227:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        plen = strlen(cp);
data/sg3-utils-1.45/src/sg_unmap.c:148:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    in_len = strlen(inp);
data/sg3-utils-1.45/src/sg_unmap.c:206:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    in_len = strlen(inp);
data/sg3-utils-1.45/src/sg_unmap.c:268:25:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    have_stdin = ((1 == strlen(file_name)) && ('-' == file_name[0]));
data/sg3-utils-1.45/src/sg_unmap.c:283:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        in_len = strlen(line);
data/sg3-utils-1.45/src/sg_verify.c:378:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            res = read(infd, ref_data + nread, ndo - nread);
data/sg3-utils-1.45/src/sg_vpd.c:982:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if (strlen(print_if_found) > 0)
data/sg3-utils-1.45/src/sg_vpd.c:1714:25:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                    if (strlen(cp) > 0)
data/sg3-utils-1.45/src/sg_vpd.c:1725:25:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                    if (strlen(cp) > 0)
data/sg3-utils-1.45/src/sg_vpd.c:1755:25:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                    if (strlen(cp) > 0)
data/sg3-utils-1.45/src/sg_vpd_vendor.c:306:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        len = strlen(vpp->acron);
data/sg3-utils-1.45/src/sg_wr_mode.c:127:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    in_len = strlen(inp);
data/sg3-utils-1.45/src/sg_wr_mode.c:140:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            in_len = strlen(line);
data/sg3-utils-1.45/src/sg_wr_mode.c:192:45:  [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 (split_line && (1 == strlen(lcp))) {
data/sg3-utils-1.45/src/sg_wr_mode.c:275:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    in_len = strlen(inp);
data/sg3-utils-1.45/src/sg_write_buffer.c:279:23:  [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(optarg);
data/sg3-utils-1.45/src/sg_write_buffer.c:452:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                res = read(infd, read_buf, DEF_XFER_LEN);
data/sg3-utils-1.45/src/sg_write_buffer.c:483:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                res = read(infd, dop, wb_len);
data/sg3-utils-1.45/src/sg_write_long.c:144:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(file_name, optarg, sizeof(file_name) - 1);
data/sg3-utils-1.45/src/sg_write_long.c:267:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            res = read(infd, writeLongBuff, xfer_len);
data/sg3-utils-1.45/src/sg_write_same.c:368:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(op->ifilename, optarg, sizeof(op->ifilename) - 1);
data/sg3-utils-1.45/src/sg_write_same.c:618:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            res = read(infd, wBuff, op->xfer_len);
data/sg3-utils-1.45/src/sg_write_verify.c:501:27:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                if ((1 == strlen(ifnp)) && ('-' == ifnp[0])) {
data/sg3-utils-1.45/src/sg_write_verify.c:537:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                res = read(ifd, wvb, ilen);
data/sg3-utils-1.45/src/sg_write_verify.c:571:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            res = read(ifd, wvb, ilen);
data/sg3-utils-1.45/src/sg_write_x.c:494:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    res = read(fd, up, len);
data/sg3-utils-1.45/src/sg_write_x.c:548:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    in_len = strlen(inp);
data/sg3-utils-1.45/src/sg_write_x.c:606:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    in_len = strlen(inp);
data/sg3-utils-1.45/src/sg_write_x.c:824:25:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    have_stdin = ((1 == strlen(scat_fname)) && ('-' == scat_fname[0]));
data/sg3-utils-1.45/src/sg_write_x.c:843:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        in_len = strlen(line);
data/sg3-utils-1.45/src/sg_write_x.c:2294:36:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (op->scat_filename && (1 == strlen(op->scat_filename)) &&
data/sg3-utils-1.45/src/sg_write_x.c:2316: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).
        if ((1 == strlen(op->if_name)) && ('-' == op->if_name[0])) {
data/sg3-utils-1.45/src/sg_xcopy.c:279:19:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
        if ((1 == sscanf(b, "%126s", a)) &&
data/sg3-utils-1.45/src/sg_xcopy.c:284:18:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
        if (2 == sscanf(b, "%d %126s", &n, a)) {
data/sg3-utils-1.45/src/sg_xcopy.c:323:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            len = read(fd, ebuff, EBUFF_SZ - 1);
data/sg3-utils-1.45/src/sg_xcopy.c:365:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    size_t len = strlen(fp->fname);
data/sg3-utils-1.45/src/sg_xcopy.c:1166:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(buff, arg, sizeof(buff) - 1);
data/sg3-utils-1.45/src/sg_xcopy.c:1348:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(str, argv[k], STR_SZ - 1);
data/sg3-utils-1.45/src/sg_xcopy.c:1356:23:  [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).
        keylen = (int)strlen(key);
data/sg3-utils-1.45/src/sginfo.c:3373:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy(fname, "/dev/sg", MDEV_NAME_SZ);
data/sg3-utils-1.45/src/sginfo.c:3375:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    len = strlen(fname);
data/sg3-utils-1.45/src/sginfo.c:3440:36:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if ( isdigit(entry->d_name[strlen(entry->d_name)-1]) ) {
data/sg3-utils-1.45/src/sginfo.c:3473:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        n = strlen(dev_name);
data/sg3-utils-1.45/src/sginfo.c:3584:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(name, devname, DEVNAME_SZ);
data/sg3-utils-1.45/src/sginfo.c:3935:27:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                int len = strlen(argv[optind + j] + 1);
data/sg3-utils-1.45/src/sgm_dd.c:219:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    size_t len = strlen(filename);
data/sg3-utils-1.45/src/sgm_dd.c:521:20:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while (((res = read(sg_fd, &io_hdr, sizeof(io_hdr))) < 0) &&
data/sg3-utils-1.45/src/sgm_dd.c:614:20:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while (((res = read(sg_fd, &io_hdr, sizeof(io_hdr))) < 0) &&
data/sg3-utils-1.45/src/sgm_dd.c:654:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(buff, arg, sizeof(buff));
data/sg3-utils-1.45/src/sgm_dd.c:769:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        keylen = strlen(key);
data/sg3-utils-1.45/src/sgm_dd.c:1266:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            if (1 == read(fd, &c, 1)) {
data/sg3-utils-1.45/src/sgm_dd.c:1328:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            while (((res = read(infd, wrkPos, blocks * blk_sz)) < 0) &&
data/sg3-utils-1.45/src/sgp_dd.c:361:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(ebp, cp, STRERR_BUFF_LEN);
data/sg3-utils-1.45/src/sgp_dd.c:384:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    size_t len = strlen(filename);
data/sg3-utils-1.45/src/sgp_dd.c:846:20:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while (((res = read(rep->infd, rep->buffp, blocks * clp->bs)) < 0) &&
data/sg3-utils-1.45/src/sgp_dd.c:1213:20:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while (((res = read(wr ? rep->outfd : rep->infd, &io_hdr,
data/sg3-utils-1.45/src/sgp_dd.c:1275:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(buff, arg, sizeof(buff));
data/sg3-utils-1.45/src/sgp_dd.c:1372:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(str, argv[k], STR_SZ);
data/sg3-utils-1.45/src/sgp_dd.c:1381:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        keylen = strlen(key);
data/sg3-utils-1.45/src/sgp_dd.c:1926:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            if (1 == read(fd, &c, 1)) {
data/sg3-utils-1.45/testing/bsg_queue_tst.c:131:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if (read(bsg_fd, &rio_hdr, sizeof(struct sg_io_v4)) < 0) {
data/sg3-utils-1.45/testing/sg_chk_asc.c:112:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(file_name, argv[optind], sizeof(file_name) - 1);
data/sg3-utils-1.45/testing/sg_chk_asc.c:137:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        len = strlen(line);
data/sg3-utils-1.45/testing/sg_chk_asc.c:154:1:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
strncpy(b , line, sizeof(b) - 1);
data/sg3-utils-1.45/testing/sg_chk_asc.c:156: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).
num = strlen(b);
data/sg3-utils-1.45/testing/sg_chk_asc.c:163:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(b , line + offset, sizeof(b) - 1);
data/sg3-utils-1.45/testing/sg_chk_asc.c:165:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        num = strlen(b);
data/sg3-utils-1.45/testing/sg_chk_asc.c:169:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        num = strlen(b);
data/sg3-utils-1.45/testing/sg_chk_asc.c:180: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).
            num = strlen(cp);
data/sg3-utils-1.45/testing/sg_iovec_tst.c:126:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        res = read(sg_fd, &io_hdr, sizeof(io_hdr));
data/sg3-utils-1.45/testing/sg_queue_tst.c:201:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if (read(sg_fd, &rio_hdr, sizeof(sg_io_hdr_t)) < 0) {
data/sg3-utils-1.45/testing/sg_sense_test.c:183:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if (prev_len == (int)strlen(b))
data/sg3-utils-1.45/testing/sg_sense_test.c:186:28:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                prev_len = strlen(b);
data/sg3-utils-1.45/testing/sg_sense_test.c:197:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if (prev_len == (int)strlen(b))
data/sg3-utils-1.45/testing/sg_sense_test.c:200:28:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                prev_len = strlen(b);
data/sg3-utils-1.45/testing/sg_tst_async.cpp:447:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        n = read(fd, b, sizeof(unsigned int));
data/sg3-utils-1.45/testing/sg_tst_async.cpp:597:31:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                              read(sg_fd, ptp, sizeof(*ptp)))) < 0) &&
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:260:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        while (((res = read(sg_fd, &pt, sizeof(pt))) < 0) &&
data/sg3-utils-1.45/testing/sg_tst_excl.cpp:302:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            while (((res = read(sg_fd, &pt2, sizeof(pt2))) < 0) &&
data/sg3-utils-1.45/testing/sg_tst_ioctl.c:190:25:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    ret = snprintf(&buf[strlen(buf)], len, ".%09ld", ts->tv_nsec);
data/sg3-utils-1.45/testing/sg_tst_ioctl.c:288:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        size = read (sock, buf, bufsize);
data/sg3-utils-1.45/testing/sg_tst_ioctl.c:1163:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if (read(sg_fd, &rio_hdr, sizeof(sg_io_hdr_t)) < 0) {
data/sg3-utils-1.45/testing/sg_tst_nvme.c:641:23:  [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 ((2 == strlen(optarg)) && (0 == memcmp("-1", optarg, 2))) {
data/sg3-utils-1.45/testing/sgh_dd.cpp:643:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        n = read(fd, b, sizeof(unsigned int));
data/sg3-utils-1.45/testing/sgh_dd.cpp:793:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(ebp, cp, STRERR_BUFF_LEN);
data/sg3-utils-1.45/testing/sgh_dd.cpp:816:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    size_t len = strlen(filename);
data/sg3-utils-1.45/testing/sgh_dd.cpp:1711:20:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while (((res = read(clp->infd, rep->buffp, blocks * clp->bs)) < 0) &&
data/sg3-utils-1.45/testing/sgh_dd.cpp:3100:20:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while (((res = read(fd, &io_hdr, sizeof(struct sg_io_hdr))) < 0) &&
data/sg3-utils-1.45/testing/sgh_dd.cpp:3538:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(buff, arg, sizeof(buff));
data/sg3-utils-1.45/testing/sgh_dd.cpp:3726:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(str, argv[k], STR_SZ);
data/sg3-utils-1.45/testing/sgh_dd.cpp:3735:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        keylen = strlen(key);
data/sg3-utils-1.45/testing/sgh_dd.cpp:4639:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            if (1 == read(fd, &c, 1)) {
data/sg3-utils-1.45/testing/sgs_dd.c:384:20:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while (((res = read(fd, &io_hdr, sizeof(sg_io_hdr_t))) < 0) &&
data/sg3-utils-1.45/testing/sgs_dd.c:678:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        while (((res = read(clp->infd, rep->buffp, blocks * clp->bs)) < 0) &&
data/sg3-utils-1.45/testing/sgs_dd.c:964:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(buff, arg, sizeof(buff));
data/sg3-utils-1.45/testing/sgs_dd.c:1038:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(str, argv[k], STR_SZ);
data/sg3-utils-1.45/testing/tst_sg_lib.c:201:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        n = (int)strlen(b);
data/sg3-utils-1.45/testing/tst_sg_lib.c:346:63:  [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).
        printf("sg_get_sense_str: strlen(b)->%u\n", (uint32_t)strlen(b));
data/sg3-utils-1.45/testing/tst_sg_lib.c:380:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
               len, n, (uint32_t)strlen(b));
data/sg3-utils-1.45/testing/tst_sg_lib.c:381:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (strlen(b) > 0)
data/sg3-utils-1.45/testing/tst_sg_lib.c:388:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
               len, n, (uint32_t)strlen(b));
data/sg3-utils-1.45/testing/tst_sg_lib.c:389:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (strlen(b) > 0)
data/sg3-utils-1.45/testing/tst_sg_lib.c:396:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
               len, n, (uint32_t)strlen(b));
data/sg3-utils-1.45/testing/tst_sg_lib.c:397:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (strlen(b) > 0)
data/sg3-utils-1.45/testing/tst_sg_lib.c:404:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
               len, n, (uint32_t)strlen(b));
data/sg3-utils-1.45/testing/tst_sg_lib.c:405:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (strlen(b) > 0)
data/sg3-utils-1.45/testing/tst_sg_lib.c:412:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
               len, n, (uint32_t)strlen(b));
data/sg3-utils-1.45/testing/tst_sg_lib.c:413:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (strlen(b) > 0)
data/sg3-utils-1.45/testing/tst_sg_lib.c:420:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
               len, n, (uint32_t)strlen(b));
data/sg3-utils-1.45/testing/tst_sg_lib.c:421:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (strlen(b) > 0)
data/sg3-utils-1.45/testing/tst_sg_lib.c:428:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
               len, n, (uint32_t)strlen(b));
data/sg3-utils-1.45/testing/tst_sg_lib.c:429:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (strlen(b) > 0)
data/sg3-utils-1.45/testing/tst_sg_lib.c:436:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
               len, n, (uint32_t)strlen(b));
data/sg3-utils-1.45/testing/tst_sg_lib.c:437:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (strlen(b) > 0)
data/sg3-utils-1.45/testing/tst_sg_lib.c:444:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
               len, n, (uint32_t)strlen(b));
data/sg3-utils-1.45/testing/tst_sg_lib.c:445:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (strlen(b) > 0)
data/sg3-utils-1.45/testing/tst_sg_lib.c:452:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
               len, n, (uint32_t)strlen(b));
data/sg3-utils-1.45/testing/tst_sg_lib.c:453:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (strlen(b) > 0)
data/sg3-utils-1.45/utils/hxascdmp.c:101:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    len = strlen(buf);
data/sg3-utils-1.45/utils/hxascdmp.c:368:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        len = strlen(cp);
data/sg3-utils-1.45/utils/hxascdmp.c:469:31:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                while ((res = read(inFile, buff, num)) > 0) {
data/sg3-utils-1.45/utils/hxascdmp.c:502:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                if ((res = read(inFile, buff,
data/sg3-utils-1.45/utils/hxascdmp.c:512:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        while ((res = read(inFile, buff, num)) > 0) {

ANALYSIS SUMMARY:

Hits = 1698
Lines analyzed = 121285 in approximately 3.72 seconds (32619 lines/second)
Physical Source Lines of Code (SLOC) = 106395
Hits@level = [0] 5364 [1] 288 [2] 1145 [3]  97 [4] 167 [5]   1
Hits@level+ = [0+] 7062 [1+] 1698 [2+] 1410 [3+] 265 [4+] 168 [5+]   1
Hits/KSLOC@level+ = [0+] 66.3753 [1+] 15.9594 [2+] 13.2525 [3+] 2.49072 [4+] 1.57902 [5+] 0.00939894
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.