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/libqmi-1.26.6/utils/swi-update.c
Examining data/libqmi-1.26.6/build-aux/templates/qmi-enum-types-template.c
Examining data/libqmi-1.26.6/build-aux/templates/qmi-flags64-types-template.h
Examining data/libqmi-1.26.6/build-aux/templates/qmi-enum-types-template.h
Examining data/libqmi-1.26.6/build-aux/templates/qmi-error-types-template.c
Examining data/libqmi-1.26.6/build-aux/templates/qmi-error-quarks-template.c
Examining data/libqmi-1.26.6/build-aux/templates/qmi-flags64-types-template.c
Examining data/libqmi-1.26.6/build-aux/templates/qmi-error-types-template.h
Examining data/libqmi-1.26.6/src/qmi-proxy/qmi-proxy.c
Examining data/libqmi-1.26.6/src/libqrtr-glib/qrtr-utils.h
Examining data/libqmi-1.26.6/src/libqrtr-glib/qrtr-control-socket.h
Examining data/libqmi-1.26.6/src/libqrtr-glib/libqrtr-glib.h
Examining data/libqmi-1.26.6/src/libqrtr-glib/qrtr-utils.c
Examining data/libqmi-1.26.6/src/libqrtr-glib/qrtr-node.h
Examining data/libqmi-1.26.6/src/libqrtr-glib/qrtr-node.c
Examining data/libqmi-1.26.6/src/libqrtr-glib/qrtr-control-socket.c
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-endpoint-qmux.c
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-device.c
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums-loc.h
Examining data/libqmi-1.26.6/src/libqmi-glib/test/test-message.c
Examining data/libqmi-1.26.6/src/libqmi-glib/test/test-compat-utils.c
Examining data/libqmi-1.26.6/src/libqmi-glib/test/test-generated.c
Examining data/libqmi-1.26.6/src/libqmi-glib/test/test-fixture.h
Examining data/libqmi-1.26.6/src/libqmi-glib/test/test-port-context.h
Examining data/libqmi-1.26.6/src/libqmi-glib/test/test-fixture.c
Examining data/libqmi-1.26.6/src/libqmi-glib/test/test-utils.c
Examining data/libqmi-1.26.6/src/libqmi-glib/test/test-port-context.c
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-flags64-dsd.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-endpoint.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-message-context.c
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums-wms.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-endpoint-qrtr.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-client.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-proxy.c
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-file.c
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-client.c
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-endpoint-qmux.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums-wds.c
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-utils.c
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums-private.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums-wds.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums-oma.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums-qos.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums-pds.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums-pbm.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-file.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums-gas.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-endpoint-qrtr.c
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-utils.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-message.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums-dms.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-endpoint.c
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-flags64-dms.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-proxy.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums-nas.c
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums-dsd.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-flags64-nas.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-errors.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums-nas.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums-voice.h
Examining data/libqmi-1.26.6/src/libqmi-glib/libqmi-glib.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-endpoint-mbim.c
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums-wda.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-endpoint-mbim.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums-pdc.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-message-context.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums-dms.c
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-device.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-utils-private.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-enums-uim.h
Examining data/libqmi-1.26.6/src/libqmi-glib/qmi-flags64-loc.h
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-qdl-message.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-image-cwe.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-log.h
Examining data/libqmi-1.26.6/src/qmi-firmware-update/test/test-firehose.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/test/test-utils.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-updater.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-udev-helpers.h
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-sahara-message.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-utils.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-utils.h
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-device-selection.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-dload-message.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-qdl-message.h
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-qdl-device.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-at-device.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-udev-helpers.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-sahara-device.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-firehose-message.h
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-image.h
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-image-factory.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-main.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-reseter.h
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-operation.h
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-image-cwe.h
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-dload-message.h
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-updater.h
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-at-device.h
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-operation-reset.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-log.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-operation-verify.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-sahara-message.h
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-firehose-message.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-device-selection.h
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-image.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-operation-update.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-reseter.c
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-sahara-device.h
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-qdl-device.h
Examining data/libqmi-1.26.6/src/qmi-firmware-update/qfu-image-factory.h
Examining data/libqmi-1.26.6/src/qmicli/qmicli-gms.c
Examining data/libqmi-1.26.6/src/qmicli/test/test-helpers.c
Examining data/libqmi-1.26.6/src/qmicli/qmicli-pbm.c
Examining data/libqmi-1.26.6/src/qmicli/qmicli-uim.c
Examining data/libqmi-1.26.6/src/qmicli/qmicli-helpers.h
Examining data/libqmi-1.26.6/src/qmicli/qmicli-helpers.c
Examining data/libqmi-1.26.6/src/qmicli/qmicli.h
Examining data/libqmi-1.26.6/src/qmicli/qmicli-loc.c
Examining data/libqmi-1.26.6/src/qmicli/qmicli-dms.c
Examining data/libqmi-1.26.6/src/qmicli/qmicli-nas.c
Examining data/libqmi-1.26.6/src/qmicli/qmicli-wds.c
Examining data/libqmi-1.26.6/src/qmicli/qmicli-gas.c
Examining data/libqmi-1.26.6/src/qmicli/qmicli-pdc.c
Examining data/libqmi-1.26.6/src/qmicli/qmicli-qos.c
Examining data/libqmi-1.26.6/src/qmicli/qmicli-voice.c
Examining data/libqmi-1.26.6/src/qmicli/qmicli-dsd.c
Examining data/libqmi-1.26.6/src/qmicli/qmicli-wda.c
Examining data/libqmi-1.26.6/src/qmicli/qmicli.c
Examining data/libqmi-1.26.6/src/qmicli/qmicli-wms.c

FINAL RESULTS:

data/libqmi-1.26.6/src/qmicli/qmicli-helpers.c:184: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 (&new_str[j], line_prefix);
data/libqmi-1.26.6/src/qmicli/qmicli-loc.c:366:162:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
        g_print ("      system:           %s\n", (element->valid_information & QMI_LOC_SATELLITE_VALID_INFORMATION_SYSTEM) ? qmi_loc_system_get_string (element->system) : "n/a");
data/libqmi-1.26.6/utils/swi-update.c:56:34:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define debug(arg...) if (debug) fprintf(stderr, arg)
data/libqmi-1.26.6/src/libqmi-glib/qmi-utils.c:457:16:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
        path = realpath (tmp, NULL);
data/libqmi-1.26.6/src/libqmi-glib/qmi-utils.c:545:11:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
    aux = realpath (cdc_wdm_path, NULL);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-udev-helpers.c:238:12:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
    path = realpath (tmp, NULL);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-udev-helpers.c:523:16:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
        path = realpath (tmp, NULL);
data/libqmi-1.26.6/utils/swi-update.c:899:19:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((opt = getopt_long(argc, argv, "i:s:m:dvh", main_options, NULL)) != -1) {
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:102: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 (out, &((*buffer)[0]), 2);
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:125: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 (out, &((*buffer)[0]), 2);
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:148: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 (out, &((*buffer)[0]), 4);
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:171: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 (out, &((*buffer)[0]), 4);
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:194: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 (out, &((*buffer)[0]), 8);
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:217: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 (out, &((*buffer)[0]), 8);
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:247:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy (out, *buffer, n_bytes);
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:254: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 (&tmp[8 - n_bytes], *buffer, n_bytes);
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.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 (out, &tmp[0], 8);
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:274: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 (out, &((*buffer)[0]), 4);
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:292: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 (&(*buffer)[0], in, sizeof (*in));
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:308: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 (&(*buffer)[0], in, sizeof (*in));
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:331: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 (&(*buffer)[0], &tmp, sizeof (tmp));
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:354: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 (&(*buffer)[0], &tmp, sizeof (tmp));
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:377: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 (&(*buffer)[0], &tmp, sizeof (tmp));
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:400: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 (&(*buffer)[0], &tmp, sizeof (tmp));
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:423: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 (&(*buffer)[0], &tmp, sizeof (tmp));
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:446: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 (&(*buffer)[0], &tmp, sizeof (tmp));
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:474: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 (*buffer, &tmp, n_bytes);
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:480: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 (&tmp_buffer[0], &tmp, 8);
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:481: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 (*buffer, &tmp_buffer[8 - n_bytes], n_bytes);
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:536: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 (*out, *buffer, valid_string_length);
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:555: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 (out, *buffer, fixed_size);
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:608: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 (*buffer, in, len);
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:625: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 (*buffer, in, fixed_size);
data/libqmi-1.26.6/src/libqmi-glib/qmi-device.c:785:15:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if (!(f = fopen (sysfs_path, "r"))) {
data/libqmi-1.26.6/src/libqmi-glib/qmi-device.c:835:15:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if (!(f = fopen (sysfs_path, "w"))) {
data/libqmi-1.26.6/src/libqmi-glib/qmi-endpoint-mbim.c:298: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 (&(entries[n_entries]->device_service_id), MBIM_UUID_QMI, sizeof (MbimUuid));
data/libqmi-1.26.6/src/libqmi-glib/qmi-endpoint-qmux.c:220: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 (qmi_file_get_path (file), O_RDWR | O_EXCL | O_NONBLOCK | O_NOCTTY);
data/libqmi-1.26.6/src/libqmi-glib/qmi-endpoint.c:173:46:  [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).
    g_assert (QMI_ENDPOINT_GET_CLASS (self)->open &&
data/libqmi-1.26.6/src/libqmi-glib/qmi-endpoint.c:176:43:  [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 QMI_ENDPOINT_GET_CLASS (self)->open (self,
data/libqmi-1.26.6/src/libqmi-glib/qmi-endpoint.h:63: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).
    void (* open)            (QmiEndpoint         *self,
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:489: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 (&buffer->qmi, qmi_data->data, message_len);
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:840: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 (&self->data[offset], &tmp, n_bytes);
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:846: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 (&tmp_buffer[0], &tmp, 8);
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:847: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 (&self->data[offset], &tmp_buffer[8 - n_bytes], n_bytes);
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:1034: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 (out, ptr, 2);
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:1060: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 (out, ptr, 2);
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:1086: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 (out, ptr, 4);
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:1112: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 (out, ptr, 4);
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:1138: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 (out, ptr, 8);
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:1164: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 (out, ptr, 8);
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:1197:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy (out, ptr, n_bytes);
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:1204: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 (&tmp[8 - n_bytes], ptr, n_bytes);
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:1205:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy (out, &tmp[0], 8);
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:1230: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 (out, ptr, 4);
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:1257: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 (out, ptr, 8);
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:1332:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy (*out, ptr, valid_string_length);
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:1375:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy (out, ptr, string_length);
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:1383:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy (out, ptr, end - (const gchar *)ptr);
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:1481: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 (tlv->value, raw, length);
data/libqmi-1.26.6/src/libqmi-glib/qmi-utils.c:261: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 (out_utf8, &gsm_def_utf8_alphabet[gsm].chars[0], gsm_def_utf8_alphabet[gsm].len);
data/libqmi-1.26.6/src/libqmi-glib/qmi-utils.c:288: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 (out_utf8, &gsm_ext_utf8_alphabet[i].chars[0], gsm_ext_utf8_alphabet[i].len);
data/libqmi-1.26.6/src/libqmi-glib/qmi-utils.c:426: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 (ucs2he, ucs2le, ucs2le_len);
data/libqmi-1.26.6/src/libqmi-glib/test/test-compat-utils.c:947: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 (expected_out_buffer, in_buffer, n_bytes);
data/libqmi-1.26.6/src/libqmi-glib/test/test-compat-utils.c:1017: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 (&in_buffer_aux[0], &in_buffer[sizeof (in_buffer) - n_bytes], n_bytes);
data/libqmi-1.26.6/src/libqmi-glib/test/test-compat-utils.c:1020: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 (&expected_out_buffer[0], &in_buffer_aux[0], n_bytes);
data/libqmi-1.26.6/src/libqmi-glib/test/test-compat-utils.c:1093: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 (expected_out_buffer, &in_buffer[1], n_bytes);
data/libqmi-1.26.6/src/libqmi-glib/test/test-compat-utils.c:1163: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 (&in_buffer_aux[1], &in_buffer[sizeof (in_buffer) - n_bytes], n_bytes);
data/libqmi-1.26.6/src/libqmi-glib/test/test-compat-utils.c:1166: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 (expected_out_buffer, &in_buffer_aux[1], n_bytes);
data/libqmi-1.26.6/src/libqmi-glib/test/test-fixture.c:157: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 (&expected[15], fixture->path, strlen (fixture->path));
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-at-device.c:294: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).
    self->priv->fd = open (path, O_RDWR | O_NOCTTY);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-firehose-message.c:222:48:  [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).
        *max_payload_size_to_target_in_bytes = atoi (aux);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-image-cwe.c:349:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy (out_buffer, &(info->hdr), sizeof (QfuCweFileHeader));
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-log.c:133:28:  [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).
        verbose_log_file = fopen (verbose_log_path, "w");
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-qdl-device.c:733: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).
    self->priv->fd = open (path, O_RDWR | O_NOCTTY);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-qdl-message.c:99: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 (req, &common_hello_req, sizeof (QdlHelloReq));
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-sahara-device.c:898:41:  [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).
            ctx->sector_size_in_bytes = atoi (strv[1]);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-sahara-device.c:900:42:  [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).
            ctx->num_partition_sectors = atoi (strv[1]);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-sahara-device.c:902:47:  [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).
            ctx->total_sector_size_in_bytes = atoi (strv[1]);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-sahara-device.c:904: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).
            ctx->pages_in_block = atoi (strv[1]);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-sahara-device.c:1275: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).
    self->priv->fd = open (path, O_RDWR | O_NOCTTY);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-utils.c:84: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 (unique_id_str, unique_id->data, UNIQUE_ID_LEN);
data/libqmi-1.26.6/src/qmicli/qmicli-helpers.c:224: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 (unique_id_str, unique_id->data, UNIQUE_ID_LEN);
data/libqmi-1.26.6/src/qmicli/qmicli-helpers.c:395: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 (&aux[0], str, 3);
data/libqmi-1.26.6/src/qmicli/qmicli-helpers.c:397:11:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    tmp = atoi (aux);
data/libqmi-1.26.6/src/qmicli/qmicli-helpers.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 (&aux[0], &str[3], 2);
data/libqmi-1.26.6/src/qmicli/qmicli-helpers.c:406: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 (&aux[0], &str[3], 3);
data/libqmi-1.26.6/src/qmicli/qmicli-helpers.c:407:16:  [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).
    *out_mnc = atoi (aux);
data/libqmi-1.26.6/src/qmicli/qmicli-wda.c:202:40:  [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).
        props->endpoint_iface_number = atoi (value);
data/libqmi-1.26.6/src/qmicli/qmicli-wda.c:494:39:  [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).
        props->dl_datagram_max_size = atoi(value);
data/libqmi-1.26.6/src/qmicli/qmicli-wda.c:499: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).
        props->dl_max_datagrams = atoi(value);
data/libqmi-1.26.6/src/qmicli/qmicli-wda.c:516:40:  [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).
        props->endpoint_iface_number = atoi(value);
data/libqmi-1.26.6/src/qmicli/qmicli-wds.c:510: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).
        props->profile_index_3gpp = atoi (value);
data/libqmi-1.26.6/src/qmicli/qmicli-wds.c:515: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).
        props->profile_index_3gpp2 = atoi (value);
data/libqmi-1.26.6/src/qmicli/qmicli-wds.c:556:17:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        switch (atoi (value)) {
data/libqmi-1.26.6/src/qmicli/qmicli-wds.c:1374: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).
        props->context_number = atoi (value);
data/libqmi-1.26.6/src/qmicli/qmicli-wds.c:1640:27:  [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).
    props.profile_index = atoi (split[1]);
data/libqmi-1.26.6/src/qmicli/qmicli-wds.c:1790:27:  [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).
    props.profile_index = atoi (split[1]);
data/libqmi-1.26.6/src/qmicli/qmicli-wds.c:2309:19:  [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).
    profile_num = atoi (split[1]);
data/libqmi-1.26.6/src/qmicli/qmicli-wds.c:2880:17:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        switch (atoi (set_ip_family_str)) {
data/libqmi-1.26.6/src/qmicli/qmicli-wds.c:3143: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).
        profile_index = atoi (split[1]);
data/libqmi-1.26.6/src/qmicli/qmicli.c:511:17:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        cid32 = atoi (client_cid_str);
data/libqmi-1.26.6/src/qmicli/qmicli.c:563:23:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        instance_id = atoi (device_set_instance_id_str);
data/libqmi-1.26.6/utils/swi-update.c:205:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char magic[32];
data/libqmi-1.26.6/utils/swi-update.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 magic[32];
data/libqmi-1.26.6/utils/swi-update.c:298: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 id[16];
data/libqmi-1.26.6/utils/swi-update.c:506:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[sizeof(*r) + sizeof(__u16)];
data/libqmi-1.26.6/utils/swi-update.c:507:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char magicbuf[33] = {0};
data/libqmi-1.26.6/utils/swi-update.c:513: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(magicbuf, r->magic, r->maxver <= 5 ? 24 : 32);
data/libqmi-1.26.6/utils/swi-update.c:583:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[sizeof(*r) + sizeof(__u16)];
data/libqmi-1.26.6/utils/swi-update.c:599:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[sizeof(*r) + sizeof(__u16)];
data/libqmi-1.26.6/utils/swi-update.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 buf[sizeof(*r) + sizeof(__u16)];
data/libqmi-1.26.6/utils/swi-update.c:631:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[sizeof(*r) + sizeof(__u16)];
data/libqmi-1.26.6/utils/swi-update.c:647:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char *end, *p, rbuf[512];
data/libqmi-1.26.6/utils/swi-update.c:700:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char wbuf[512];
data/libqmi-1.26.6/utils/swi-update.c:721: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(dev,  O_RDWR | O_NOCTTY);
data/libqmi-1.26.6/utils/swi-update.c:735:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char reserved1[256];
data/libqmi-1.26.6/utils/swi-update.c:739:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char type[4];       /* ASCII - not null terminated */
data/libqmi-1.26.6/utils/swi-update.c:740:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-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[4];    /* ASCII - not null terminated */
data/libqmi-1.26.6/utils/swi-update.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 version[84];   /* ASCII - null terminated */
data/libqmi-1.26.6/utils/swi-update.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 date[8];       /* ASCII - null terminated */
data/libqmi-1.26.6/utils/swi-update.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 reserved2[20];
data/libqmi-1.26.6/utils/swi-update.c:752:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-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[5];
data/libqmi-1.26.6/utils/swi-update.c:755: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(tmp, h->type, 4);
data/libqmi-1.26.6/utils/swi-update.c:758: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(tmp, h->product, 4);
data/libqmi-1.26.6/utils/swi-update.c:798: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).
    imgfd = open(image, O_RDONLY);
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:578: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 (in);
data/libqmi-1.26.6/src/libqmi-glib/qmi-compat.c:768:38:  [1] (buffer) strlen:
  Does not handle 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 (value_session_information_application_identifier));           \
data/libqmi-1.26.6/src/libqmi-glib/qmi-message.c:866: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).
    len = (in_length < 0 ? strlen (in) : (gsize) in_length);
data/libqmi-1.26.6/src/libqmi-glib/test/test-fixture.c:156: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).
        g_assert_cmpuint (strlen (fixture->path), ==, 20);
data/libqmi-1.26.6/src/libqmi-glib/test/test-fixture.c:157:47:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        memcpy (&expected[15], fixture->path, strlen (fixture->path));
data/libqmi-1.26.6/src/libqrtr-glib/qrtr-utils.c:54:53:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (g_ascii_strncasecmp (name, QRTR_URI_PREFIX, strlen (QRTR_URI_PREFIX)) != 0)
data/libqmi-1.26.6/src/libqrtr-glib/qrtr-utils.c:57: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).
    start = name + strlen (QRTR_URI_PREFIX);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-at-device.c:103: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).
    wlen = write (self->priv->fd, request, strlen (request));
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-at-device.c:113: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 ((gsize)wlen != strlen (request)) {
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-at-device.c:116: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).
                     wlen, strlen (request));
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-at-device.c:172:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    rlen = read (self->priv->fd, self->priv->buffer->data, self->priv->buffer->len);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-at-device.c:240:26:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            *response += strlen (request);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-at-device.c:241: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).
            rsplen -= strlen (request);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-firehose-message.c:45:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    return strlen ((gchar *)buffer);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-firehose-message.c:64:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    return strlen ((gchar *)buffer);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-firehose-message.c:77:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    return strlen ((gchar *)buffer);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-firehose-message.c:96:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    return strlen ((gchar *)buffer);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-firehose-message.c:109:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    return strlen ((gchar *)buffer);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-qdl-device.c:360:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    rlen = read (self->priv->fd, self->priv->buffer->data, self->priv->buffer->len);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-sahara-device.c:162:61:  [1] (buffer) strlen:
  Does not handle 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 (strncmp ((const gchar *)request, XML_START_TAG, strlen (XML_START_TAG)) == 0) {
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-sahara-device.c:230:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    rlen = read (self->priv->fd, self->priv->buffer->data, self->priv->buffer->len - 1);
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-sahara-device.c:263:78:  [1] (buffer) strlen:
  Does not handle 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 (strncmp ((const gchar *)self->priv->buffer->data, XML_START_TAG, strlen (XML_START_TAG)) == 0) {
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-sahara-device.c:414:38:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                               req ? strlen (req) : 0,
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-updater.c:1160:69:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    g_array_insert_vals (pri_image_id.unique_id, 0, config_version, strlen (config_version));
data/libqmi-1.26.6/src/qmi-firmware-update/qfu-utils.c:193: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).
    if (!g_regex_match_full (regex, version, strlen (version), 0, 0, &match_info, NULL)) {
data/libqmi-1.26.6/src/qmicli/qmicli-dms.c:2415:49:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    array = g_array_sized_new (FALSE, FALSE, 1, strlen (str));
data/libqmi-1.26.6/src/qmicli/qmicli-dms.c:2416: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).
    g_array_insert_vals (array, 0, str, strlen (str));
data/libqmi-1.26.6/src/qmicli/qmicli-dms.c:3544:88:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    g_array_insert_vals (firmware_preference_ctx->pri_image_id.unique_id, 0, split[1], strlen (split[1]));
data/libqmi-1.26.6/src/qmicli/qmicli-helpers.c:167: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).
    prefix_len = strlen (line_prefix) + 1;
data/libqmi-1.26.6/src/qmicli/qmicli-helpers.c:185: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 += strlen (line_prefix);
data/libqmi-1.26.6/src/qmicli/qmicli-helpers.c:256: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).
    unique_id_str[strlen (unique_id_str) - 1] = '\0'; /* remove EOL */
data/libqmi-1.26.6/src/qmicli/qmicli-helpers.c:387: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 (str);
data/libqmi-1.26.6/src/qmicli/qmicli-helpers.c:521: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).
    str_len = str ? strlen (str) : 0;
data/libqmi-1.26.6/src/qmicli/qmicli-nas.c:3261: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 (mnc) >= 3 && (mnc[2] == 'F' || mnc[2] == 'f'))
data/libqmi-1.26.6/utils/swi-update.c:659:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    rlen = read(fd, rbuf, sizeof(rbuf));
data/libqmi-1.26.6/utils/swi-update.c:819:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if (read(imgfd, buf + rlen, hdrlen(type)) != hdrlen(type))
data/libqmi-1.26.6/utils/swi-update.c:842:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        rlen += read(imgfd, buf + rlen, CHUNK);

ANALYSIS SUMMARY:

Hits = 162
Lines analyzed = 67708 in approximately 1.76 seconds (38501 lines/second)
Physical Source Lines of Code (SLOC) = 46070
Hits@level = [0]  32 [1]  37 [2] 117 [3]   5 [4]   3 [5]   0
Hits@level+ = [0+] 194 [1+] 162 [2+] 125 [3+]   8 [4+]   3 [5+]   0
Hits/KSLOC@level+ = [0+] 4.21098 [1+] 3.51639 [2+] 2.71326 [3+] 0.173649 [4+] 0.0651183 [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.