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/lxi-tools-1.21/src/benchmark.c
Examining data/lxi-tools-1.21/src/discover.c
Examining data/lxi-tools-1.21/src/gui/lxi-gui/main.cpp
Examining data/lxi-tools-1.21/src/gui/lxi-gui/mainwindow.cpp
Examining data/lxi-tools-1.21/src/gui/lxi-gui/mainwindow.h
Examining data/lxi-tools-1.21/src/gui/lxi-gui/workerthread.cpp
Examining data/lxi-tools-1.21/src/gui/lxi-gui/workerthread.h
Examining data/lxi-tools-1.21/src/include/benchmark.h
Examining data/lxi-tools-1.21/src/include/discover.h
Examining data/lxi-tools-1.21/src/include/error.h
Examining data/lxi-tools-1.21/src/include/lxilua.h
Examining data/lxi-tools-1.21/src/include/options.h
Examining data/lxi-tools-1.21/src/include/run.h
Examining data/lxi-tools-1.21/src/include/scpi.h
Examining data/lxi-tools-1.21/src/include/screenshot.h
Examining data/lxi-tools-1.21/src/lxilua.c
Examining data/lxi-tools-1.21/src/main.c
Examining data/lxi-tools-1.21/src/options.c
Examining data/lxi-tools-1.21/src/plugins/screenshot_keysight-dmm.c
Examining data/lxi-tools-1.21/src/plugins/screenshot_keysight-ivx.c
Examining data/lxi-tools-1.21/src/plugins/screenshot_rigol-1000z.c
Examining data/lxi-tools-1.21/src/plugins/screenshot_rigol-2000.c
Examining data/lxi-tools-1.21/src/plugins/screenshot_rigol-dg4000.c
Examining data/lxi-tools-1.21/src/plugins/screenshot_rigol-dm3068.c
Examining data/lxi-tools-1.21/src/plugins/screenshot_rigol-dp800.c
Examining data/lxi-tools-1.21/src/plugins/screenshot_rigol-dsa.c
Examining data/lxi-tools-1.21/src/plugins/screenshot_rohde-schwarz-hmo-rtb.c
Examining data/lxi-tools-1.21/src/plugins/screenshot_siglent-sdg.c
Examining data/lxi-tools-1.21/src/plugins/screenshot_siglent-sdm3000.c
Examining data/lxi-tools-1.21/src/plugins/screenshot_siglent-sds.c
Examining data/lxi-tools-1.21/src/plugins/screenshot_siglent-ssa3000x.c
Examining data/lxi-tools-1.21/src/plugins/screenshot_tektronix.c
Examining data/lxi-tools-1.21/src/run.c
Examining data/lxi-tools-1.21/src/scpi.c
Examining data/lxi-tools-1.21/src/screenshot.c

FINAL RESULTS:

data/lxi-tools-1.21/src/gui/lxi-gui/mainwindow.cpp:73:20:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    string_version.sprintf("%s (BETA)", VERSION);
data/lxi-tools-1.21/src/gui/lxi-gui/mainwindow.cpp:175: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(command_buffer, command->toUtf8().constData());
data/lxi-tools-1.21/src/include/error.h:35: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, "Error: " format, ## args)
data/lxi-tools-1.21/src/scpi.c:107: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(command_buffer, command);
data/lxi-tools-1.21/src/screenshot.c:156:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(automatic_filename, "screenshot_%s_%s.%s", screenshot_address, date_time(), format);
data/lxi-tools-1.21/src/screenshot.c:194: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(screenshot_image_format, format);
data/lxi-tools-1.21/src/screenshot.c:195: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(screenshot_image_filename, filename);
data/lxi-tools-1.21/src/options.c:157: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, "t:m", long_options, &option_index);
data/lxi-tools-1.21/src/options.c:173:17:  [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, "t:m", long_options, &option_index);
data/lxi-tools-1.21/src/options.c:204:17:  [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:p:t:xis:r", long_options, &option_index);
data/lxi-tools-1.21/src/options.c:260:17:  [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:t:p:l", long_options, &option_index);
data/lxi-tools-1.21/src/options.c:301:17:  [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:p:t:rc:", long_options, &option_index);
data/lxi-tools-1.21/src/options.c:342:17:  [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, "t:", long_options, &option_index);
data/lxi-tools-1.21/src/options.c:369:17:  [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, "vh", long_options, &option_index);
data/lxi-tools-1.21/src/benchmark.c:51:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char id[ID_LENGTH_MAX];
data/lxi-tools-1.21/src/gui/lxi-gui/mainwindow.cpp:168:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response_buffer[10000] = "";
data/lxi-tools-1.21/src/gui/lxi-gui/mainwindow.cpp: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 command_buffer[10000] = "";
data/lxi-tools-1.21/src/gui/lxi-gui/mainwindow.cpp:454:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char image_buffer[0x200000];
data/lxi-tools-1.21/src/gui/lxi-gui/mainwindow.cpp:456:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char image_format[10];
data/lxi-tools-1.21/src/gui/lxi-gui/mainwindow.cpp:457:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char image_filename[1000];
data/lxi-tools-1.21/src/gui/lxi-gui/mainwindow.cpp:499: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).
    file.open(QIODevice::WriteOnly);
data/lxi-tools-1.21/src/gui/lxi-gui/mainwindow.cpp:734: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).
    file.open(QIODevice::WriteOnly|QFile::Truncate);
data/lxi-tools-1.21/src/gui/lxi-gui/workerthread.cpp:10:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char image_buffer[0x200000];
data/lxi-tools-1.21/src/gui/lxi-gui/workerthread.cpp:12:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char image_format[10];
data/lxi-tools-1.21/src/gui/lxi-gui/workerthread.cpp:13:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char image_filename[1000];
data/lxi-tools-1.21/src/include/options.h:43:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char ip[500];
data/lxi-tools-1.21/src/include/options.h:44:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char scpi_command[500];
data/lxi-tools-1.21/src/include/options.h:49:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char lua_script_filename[1000];
data/lxi-tools-1.21/src/include/options.h:52:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char screenshot_filename[1000];
data/lxi-tools-1.21/src/lxilua.c:77:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response[RESPONSE_LENGTH_MAX];
data/lxi-tools-1.21/src/lxilua.c:126:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response[RESPONSE_LENGTH_MAX];
data/lxi-tools-1.21/src/options.c:164:38:  [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).
                    option.timeout = atoi(optarg) * 1000;
data/lxi-tools-1.21/src/options.c:213: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).
                    option.port = atoi(optarg);
data/lxi-tools-1.21/src/options.c:217:38:  [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).
                    option.timeout = atoi(optarg) * 1000;
data/lxi-tools-1.21/src/options.c:269:38:  [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).
                    option.timeout = atoi(optarg) * 1000;
data/lxi-tools-1.21/src/options.c:310: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).
                    option.port = atoi(optarg);
data/lxi-tools-1.21/src/options.c:314:38:  [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).
                    option.timeout = atoi(optarg) * 1000;
data/lxi-tools-1.21/src/options.c:318:36:  [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).
                    option.count = atoi(optarg);
data/lxi-tools-1.21/src/options.c:347:38:  [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).
                    option.timeout = atoi(optarg) * 1000;
data/lxi-tools-1.21/src/plugins/screenshot_keysight-dmm.c:45:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response[IMAGE_SIZE_MAX];
data/lxi-tools-1.21/src/plugins/screenshot_keysight-dmm.c:72:9:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    n = atoi(&c);
data/lxi-tools-1.21/src/plugins/screenshot_keysight-ivx.c:45:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response[IMAGE_SIZE_MAX];
data/lxi-tools-1.21/src/plugins/screenshot_keysight-ivx.c:72:9:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    n = atoi(&c);
data/lxi-tools-1.21/src/plugins/screenshot_rigol-1000z.c:45:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response[IMAGE_SIZE_MAX];
data/lxi-tools-1.21/src/plugins/screenshot_rigol-1000z.c:70:9:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    n = atoi(&c);
data/lxi-tools-1.21/src/plugins/screenshot_rigol-2000.c:45:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response[IMAGE_SIZE_MAX];
data/lxi-tools-1.21/src/plugins/screenshot_rigol-2000.c:70:9:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    n = atoi(&c);
data/lxi-tools-1.21/src/plugins/screenshot_rigol-dg4000.c:45:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response[IMAGE_SIZE_MAX];
data/lxi-tools-1.21/src/plugins/screenshot_rigol-dg4000.c:72:9:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    n = atoi(&c);
data/lxi-tools-1.21/src/plugins/screenshot_rigol-dm3068.c:45:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response[IMAGE_SIZE_MAX];
data/lxi-tools-1.21/src/plugins/screenshot_rigol-dm3068.c:70:9:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    n = atoi(&c);
data/lxi-tools-1.21/src/plugins/screenshot_rigol-dp800.c:45:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response[IMAGE_SIZE_MAX];
data/lxi-tools-1.21/src/plugins/screenshot_rigol-dp800.c:70:9:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    n = atoi(&c);
data/lxi-tools-1.21/src/plugins/screenshot_rigol-dsa.c:45:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response[IMAGE_SIZE_MAX];
data/lxi-tools-1.21/src/plugins/screenshot_rigol-dsa.c:70:9:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    n = atoi(&c);
data/lxi-tools-1.21/src/plugins/screenshot_rohde-schwarz-hmo-rtb.c:45:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response[IMAGE_SIZE_MAX];
data/lxi-tools-1.21/src/plugins/screenshot_rohde-schwarz-hmo-rtb.c:72:9:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    n = atoi(&c);
data/lxi-tools-1.21/src/plugins/screenshot_siglent-sdg.c:45:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response[IMAGE_SIZE_MAX] = {};
data/lxi-tools-1.21/src/plugins/screenshot_siglent-sdm3000.c:45:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response[IMAGE_SIZE_MAX] = {};
data/lxi-tools-1.21/src/plugins/screenshot_siglent-sds.c:45:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response[IMAGE_SIZE_MAX] = {};
data/lxi-tools-1.21/src/plugins/screenshot_siglent-ssa3000x.c:45:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response[IMAGE_SIZE_MAX] = {};
data/lxi-tools-1.21/src/plugins/screenshot_tektronix.c:45:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response[IMAGE_SIZE_MAX];
data/lxi-tools-1.21/src/scpi.c:98:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response[RESPONSE_LENGTH_MAX] = "";
data/lxi-tools-1.21/src/scpi.c:99:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char command_buffer[1000];
data/lxi-tools-1.21/src/scpi.c:172:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response[RESPONSE_LENGTH_MAX] = "";
data/lxi-tools-1.21/src/scpi.c:243:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char response[RESPONSE_LENGTH_MAX] = "";
data/lxi-tools-1.21/src/scpi.c:247: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(filename, "r");
data/lxi-tools-1.21/src/screenshot.c:134:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    static char date_time_string[50];
data/lxi-tools-1.21/src/screenshot.c:138:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(date_time_string, "%d-%02d-%02d_%02d:%02d:%02d", tm.tm_year + 1900,
data/lxi-tools-1.21/src/screenshot.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 automatic_filename[1000];
data/lxi-tools-1.21/src/screenshot.c:177: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).
            fd = fopen(filename, "w+");
data/lxi-tools-1.21/src/screenshot.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(screenshot_image_buffer, data, length);
data/lxi-tools-1.21/src/screenshot.c:270:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char id[ID_LENGTH_MAX];
data/lxi-tools-1.21/src/benchmark.c:55:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (strlen(ip) == 0)
data/lxi-tools-1.21/src/benchmark.c:86: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).
        lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/gui/lxi-gui/mainwindow.cpp:179:46:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        lxi_send(lxi_device, command_buffer, strlen(command_buffer), timeout);
data/lxi-tools-1.21/src/lxilua.c:83: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).
    length = lxi_send(device, command, strlen(command), option.timeout);
data/lxi-tools-1.21/src/lxilua.c:132: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).
    length = lxi_send(device, command, strlen(command), option.timeout);
data/lxi-tools-1.21/src/lxilua.c:178:5:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
    usleep(useconds);
data/lxi-tools-1.21/src/options.c:209:21:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                    strncpy(option.ip, optarg, 500);
data/lxi-tools-1.21/src/options.c:265:21:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                    strncpy(option.ip, optarg, 500);
data/lxi-tools-1.21/src/options.c:306:21:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                    strncpy(option.ip, optarg, 500);
data/lxi-tools-1.21/src/options.c:396:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(option.scpi_command, argv[optind++], 500);
data/lxi-tools-1.21/src/options.c:398: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(option.ip) == 0)
data/lxi-tools-1.21/src/options.c:404: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 ((strlen(option.scpi_command) == 0) && (option.interactive == false))
data/lxi-tools-1.21/src/options.c:413:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(option.screenshot_filename, argv[optind++], 1000);
data/lxi-tools-1.21/src/options.c:418:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(option.lua_script_filename, argv[optind++], 1000);
data/lxi-tools-1.21/src/plugins/screenshot_keysight-dmm.c:60:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/plugins/screenshot_keysight-dmm.c:62:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/plugins/screenshot_keysight-ivx.c:60:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/plugins/screenshot_keysight-ivx.c:62:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/plugins/screenshot_rigol-1000z.c:60:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/plugins/screenshot_rigol-2000.c:60:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/plugins/screenshot_rigol-dg4000.c:60:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/plugins/screenshot_rigol-dg4000.c:62:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/plugins/screenshot_rigol-dm3068.c:60:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/plugins/screenshot_rigol-dp800.c:60:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/plugins/screenshot_rigol-dsa.c:60:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/plugins/screenshot_rohde-schwarz-hmo-rtb.c:60:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/plugins/screenshot_rohde-schwarz-hmo-rtb.c:62:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/plugins/screenshot_siglent-sdg.c:59:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/plugins/screenshot_siglent-sdm3000.c:59:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/plugins/screenshot_siglent-sds.c:59:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/plugins/screenshot_siglent-ssa3000x.c:59:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/plugins/screenshot_tektronix.c:59:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/plugins/screenshot_tektronix.c:61:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/plugins/screenshot_tektronix.c:63:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/run.c:49:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (strlen(filename) == 0)
data/lxi-tools-1.21/src/scpi.c:71: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).
    int i = strlen(line) - 1;
data/lxi-tools-1.21/src/scpi.c:108: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).
        command_buffer[strlen(command)] = '\n';
data/lxi-tools-1.21/src/scpi.c:109: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).
        command_buffer[strlen(command)+1] = 0;
data/lxi-tools-1.21/src/scpi.c:122: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).
    length = lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/scpi.c:199: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(input) == 0)
data/lxi-tools-1.21/src/scpi.c:203:42:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        length = lxi_send(device, input, strlen(input), timeout);
data/lxi-tools-1.21/src/scpi.c:242:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ssize_t read;
data/lxi-tools-1.21/src/scpi.c:272: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(line) == 1)
data/lxi-tools-1.21/src/scpi.c:276: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).
        length = lxi_send(device, line, strlen(line), timeout);
data/lxi-tools-1.21/src/scpi.c:281: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 (line[strlen(line)-1] == '?')
data/lxi-tools-1.21/src/screenshot.c:88: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).
    bytes_sent = lxi_send(device, command, strlen(command), timeout);
data/lxi-tools-1.21/src/screenshot.c:153:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (strlen(screenshot_filename) == 0)
data/lxi-tools-1.21/src/screenshot.c:225: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).
        length = strlen(plugin_list[i]->name);
data/lxi-tools-1.21/src/screenshot.c:238:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        for (j=0; j<(length_max-strlen(plugin_list[i]->name)); j++)
data/lxi-tools-1.21/src/screenshot.c:280:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (strlen(address) == 0)
data/lxi-tools-1.21/src/screenshot.c:295:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (strlen(plugin_name) == 0)

ANALYSIS SUMMARY:

Hits = 124
Lines analyzed = 4342 in approximately 0.15 seconds (28836 lines/second)
Physical Source Lines of Code (SLOC) = 2675
Hits@level = [0]  73 [1]  51 [2]  59 [3]   7 [4]   7 [5]   0
Hits@level+ = [0+] 197 [1+] 124 [2+]  73 [3+]  14 [4+]   7 [5+]   0
Hits/KSLOC@level+ = [0+] 73.6449 [1+] 46.3551 [2+] 27.2897 [3+] 5.23364 [4+] 2.61682 [5+]   0
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.