{"$schema": "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json",
 "version": "2.1.0",
 "runs": [{"tool": {"driver": {"name": "GNU C99",
                               "fullName": "GNU C99 (GCC) version 16.1.1 20260703 (Red Hat 16.1.1-4) (x86_64-redhat-linux)",
                               "version": "16.1.1 20260703 (Red Hat 16.1.1-4)",
                               "informationUri": "https://gcc.gnu.org/gcc-16/",
                               "rules": [{"id": "-Wanalyzer-null-dereference",
                                          "helpUri": "https://gcc.gnu.org/onlinedocs/gcc-16.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-null-dereference"}]}},
           "taxonomies": [{"name": "CWE",
                           "version": "4.7",
                           "organization": "MITRE",
                           "shortDescription": {"text": "The MITRE Common Weakness Enumeration"},
                           "taxa": [{"id": "476",
                                     "helpUri": "https://cwe.mitre.org/data/definitions/476.html"}]}],
           "invocations": [{"arguments": ["/usr/libexec/gcc/x86_64-redhat-linux/16/cc1",
                                          "-quiet",
                                          "-I",
                                          ".",
                                          "-I",
                                          "./../../include/",
                                          "-I",
                                          "/usr/include/glib-2.0",
                                          "-I",
                                          "/usr/lib64/glib-2.0/include",
                                          "-I",
                                          "/usr/include/sysprof-6",
                                          "-I",
                                          "/usr/include/glib-2.0",
                                          "-I",
                                          "/usr/lib64/glib-2.0/include",
                                          "-I",
                                          "/usr/include/libmount",
                                          "-I",
                                          "/usr/include/blkid",
                                          "-I",
                                          "/usr/include/sysprof-6",
                                          "-I",
                                          "/usr/include/libfdisk",
                                          "-I",
                                          "/usr/include/uuid",
                                          "-I",
                                          "/usr/include/blkid",
                                          "-D",
                                          "PACKAGE_NAME=\"libblockdev\"",
                                          "-D",
                                          "PACKAGE_TARNAME=\"libblockdev\"",
                                          "-D",
                                          "PACKAGE_VERSION=\"3.4.0\"",
                                          "-D",
                                          "PACKAGE_STRING=\"libblockdev 3.4.0\"",
                                          "-D",
                                          "PACKAGE_BUGREPORT=\"\"",
                                          "-D",
                                          "PACKAGE_URL=\"https://github.com/storaged-project/libblockdev\"",
                                          "-D",
                                          "PACKAGE=\"libblockdev\"",
                                          "-D",
                                          "VERSION=\"3.4.0\"",
                                          "-D",
                                          "NDEBUG=1",
                                          "-D",
                                          "HAVE_STDIO_H=1",
                                          "-D",
                                          "HAVE_STDLIB_H=1",
                                          "-D",
                                          "HAVE_STRING_H=1",
                                          "-D",
                                          "HAVE_INTTYPES_H=1",
                                          "-D",
                                          "HAVE_STDINT_H=1",
                                          "-D",
                                          "HAVE_STRINGS_H=1",
                                          "-D",
                                          "HAVE_SYS_STAT_H=1",
                                          "-D",
                                          "HAVE_SYS_TYPES_H=1",
                                          "-D",
                                          "HAVE_UNISTD_H=1",
                                          "-D",
                                          "STDC_HEADERS=1",
                                          "-D",
                                          "HAVE_DLFCN_H=1",
                                          "-D",
                                          "LT_OBJDIR=\".libs/\"",
                                          "-D",
                                          "HAVE_DLFCN_H=1",
                                          "-D",
                                          "HAVE_STRING_H=1",
                                          "-D",
                                          "HAVE_UNISTD_H=1",
                                          "-D",
                                          "HAVE_SYS_FCNTL_H=1",
                                          "-D",
                                          "HAVE_SYS_IOCTL_H=1",
                                          "-D",
                                          "HAVE_LINUX_RANDOM_H=1",
                                          "-D",
                                          "HAVE_GLOB_H=1",
                                          "-D",
                                          "HAVE_SYSLOG_H=1",
                                          "-D",
                                          "HAVE_MATH_H=1",
                                          "-D",
                                          "WITH_BD_ESCROW=/**/",
                                          "-D",
                                          "WITH_BD_NVME=/**/",
                                          "-D",
                                          "WITH_BD_BTRFS=/**/",
                                          "-D",
                                          "WITH_BD_CRYPTO=/**/",
                                          "-D",
                                          "WITH_BD_DM=/**/",
                                          "-D",
                                          "WITH_BD_LOOP=/**/",
                                          "-D",
                                          "WITH_BD_LVM=/**/",
                                          "-D",
                                          "WITH_BD_LVM_DBUS=/**/",
                                          "-D",
                                          "WITH_BD_MDRAID=/**/",
                                          "-D",
                                          "WITH_BD_MPATH=/**/",
                                          "-D",
                                          "WITH_BD_SWAP=/**/",
                                          "-D",
                                          "WITH_BD_PART=/**/",
                                          "-D",
                                          "WITH_BD_FS=/**/",
                                          "-D",
                                          "WITH_BD_NVDIMM=/**/",
                                          "-D",
                                          "WITH_BD_NVME=/**/",
                                          "-D",
                                          "WITH_BD_SMART=/**/",
                                          "-D",
                                          "LIBCRYPTSETUP_24=1",
                                          "-D",
                                          "LIBCRYPTSETUP_26=1",
                                          "-D",
                                          "LIBCRYPTSETUP_27=1",
                                          "-D",
                                          "LIBCRYPTSETUP_28=1",
                                          "-D",
                                          "HAVE_LINUX_OPAL=1",
                                          "-D",
                                          "LIBMOUNT_NEW_ERR_API=1",
                                          "-D",
                                          "LIBNDCTL_NEW_MODES=1",
                                          "-D",
                                          "HAVE_LIBNVME_1_4=1",
                                          "-D",
                                          "HAVE_SMART=1",
                                          "-D",
                                          "HAVE_SMARTMONTOOLS=1",
                                          "-D",
                                          "WITH_GZFILEOP",
                                          "-D",
                                          "PIC",
                                          "part.c",
                                          "-quiet",
                                          "-dumpbase",
                                          "part.c",
                                          "-dumpbase-ext",
                                          ".c",
                                          "-m64",
                                          "-mtune=generic",
                                          "-march=x86-64",
                                          "-mtls-dialect=gnu2",
                                          "-O2",
                                          "-Wno-unknown-pragmas",
                                          "-std=gnu99",
                                          "-flto=auto",
                                          "-ffat-lto-objects",
                                          "-fexceptions",
                                          "-fstack-protector-strong",
                                          "-fasynchronous-unwind-tables",
                                          "-fstack-clash-protection",
                                          "-fcf-protection=full",
                                          "-fno-omit-frame-pointer",
                                          "-fPIC",
                                          "-fanalyzer",
                                          "-fdiagnostics-path-format=separate-events",
                                          "-fno-diagnostics-show-caret",
                                          "-fno-lto",
                                          "-fanalyzer-assume-nothrow",
                                          "-fdiagnostics-text-art-charset=none",
                                          "-fdiagnostics-set-output=sarif:file=/builddir/gcc-results/4197-g8vw.sarif",
                                          "-o",
                                          "/tmp/cckmKKQl.s"],
                            "workingDirectory": {"uri": "/builddir/build/BUILD/libblockdev-3.4.0-build/libblockdev-3.4.0/src/plugins"},
                            "startTimeUtc": "2026-08-03T16:58:19Z",
                            "executionSuccessful": true,
                            "toolExecutionNotifications": [],
                            "endTimeUtc": "2026-08-03T16:58:21Z"}],
           "originalUriBaseIds": {"PWD": {"uri": "file:///builddir/build/BUILD/libblockdev-3.4.0-build/libblockdev-3.4.0/src/plugins/"}},
           "artifacts": [{"location": {"uri": "part.c",
                                       "uriBaseId": "PWD"},
                          "sourceLanguage": "c",
                          "contents": {"text": "/*\n * Copyright (C) 2016  Red Hat, Inc.\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, see <http://www.gnu.org/licenses/>.\n *\n * Author: Vratislav Podzimek <vpodzime@redhat.com>\n */\n\n#include <ctype.h>\n#include <sys/file.h>\n#include <fcntl.h>\n#include <blockdev/utils.h>\n#include <libfdisk.h>\n#include <locale.h>\n\n#include \"part.h\"\n\n/**\n * SECTION: part\n * @short_description: plugin for operations with partition tables\n * @title: Part\n * @include: part.h\n *\n * A plugin for operations with partition tables. Currently supported table\n * (disk label) types are MBR and GPT. See the functions below to get an\n * overview of which operations are supported. If there's anything missing,\n * please don't hesitate to report it as this plugin (just like all the others)\n * is subject to future development and enhancements.\n *\n * This particular implementation of the part plugin uses libfdisk for\n * manipulations of both the MBR and GPT disk label types.\n */\n\n/**\n * bd_part_error_quark: (skip)\n */\nGQuark bd_part_error_quark (void)\n{\n    return g_quark_from_static_string (\"g-bd-part-error-quark\");\n}\n\nBDPartSpec* bd_part_spec_copy (BDPartSpec *data) {\n    if (data == NULL)\n        return NULL;\n\n    BDPartSpec *ret = g_new0 (BDPartSpec, 1);\n\n    ret->path = g_strdup (data->path);\n    ret->name = g_strdup (data->name);\n    ret->id = g_strdup (data->id);\n    ret->uuid = g_strdup (data->uuid);\n    ret->type_guid = g_strdup (data->type_guid);\n    ret->type_name = g_strdup (data->type_name);\n    ret->type = data->type;\n    ret->start = data->start;\n    ret->size = data->size;\n    ret->bootable = data->bootable;\n    ret->attrs = data->attrs;\n\n    return ret;\n}\n\nvoid bd_part_spec_free (BDPartSpec *data) {\n    if (data == NULL)\n        return;\n\n    g_free (data->path);\n    g_free (data->name);\n    g_free (data->uuid);\n    g_free (data->id);\n    g_free (data->type_guid);\n    g_free (data->type_name);\n    g_free (data);\n}\n\nBDPartDiskSpec* bd_part_disk_spec_copy (BDPartDiskSpec *data) {\n    if (data == NULL)\n        return NULL;\n\n    BDPartDiskSpec *ret = g_new0 (BDPartDiskSpec, 1);\n\n    ret->path = g_strdup (data->path);\n    ret->table_type = data->table_type;\n    ret->size = data->size;\n    ret->sector_size = data->sector_size;\n\n    return ret;\n}\n\nvoid bd_part_disk_spec_free (BDPartDiskSpec *data) {\n    if (data == NULL)\n        return;\n\n    g_free (data->path);\n    g_free (data);\n}\n\n/* \"C\" locale to get the locale-agnostic error messages */\nstatic locale_t c_locale = (locale_t) 0;\n\nstatic int fdisk_version = 0;\n\n/* base 2 logarithm of x */\nstatic gint log2i (guint x) {\n    gint ret = 0;\n\n    if (x == 0)\n        return -1;\n\n    while (x >>= 1)\n        ret++;\n\n    return ret;\n}\n\n\n/**\n * get_part_num: (skip)\n *\n * Extract partition number from it's name (e.g. sda1).\n *\n * Returns: partition number or -1 in case of an error\n */\nstatic gint get_part_num (const gchar *part, GError **error) {\n    const gchar *part_num_str = NULL;\n    gint part_num = -1;\n\n    if (!part || *part == '\\0') {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_INVAL,\n                     \"Invalid partition path given: '%s'\", part);\n        return -1;\n    }\n\n    part_num_str = part + (strlen (part) - 1);\n    while (isdigit (*part_num_str) || (*part_num_str == '-')) {\n        part_num_str--;\n    }\n    part_num_str++;\n\n    part_num = atoi (part_num_str);\n    if (part_num == 0) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_INVAL,\n                     \"Invalid partition path given: '%s'. Cannot extract partition number\", part);\n        return -1;\n    } else if (part_num < 0) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_INVAL,\n                     \"Invalid partition path given: '%s'.\", part);\n        return -1;\n    }\n\n    return part_num;\n}\n\nstatic int fdisk_ask_callback (struct fdisk_context *cxt G_GNUC_UNUSED, struct fdisk_ask *ask, void *data G_GNUC_UNUSED) {\n    gint type = 0;\n    const gchar *fdisk_msg = NULL;\n    gchar *message = NULL;\n\n    type = fdisk_ask_get_type (ask);\n    fdisk_msg = fdisk_ask_print_get_mesg (ask);\n\n    switch (type) {\n        case FDISK_ASKTYPE_INFO:\n            message = g_strdup_printf (\"[fdisk] %s\", fdisk_msg);\n            bd_utils_log (BD_UTILS_LOG_INFO, message);\n            g_free (message);\n            break;\n        case FDISK_ASKTYPE_WARNX:\n        case FDISK_ASKTYPE_WARN:\n            message = g_strdup_printf (\"[fdisk] %s\", fdisk_msg);\n            bd_utils_log (BD_UTILS_LOG_WARNING, message);\n            g_free (message);\n            break;\n        default:\n            break;\n    }\n\n    return 0;\n}\n\nstatic struct fdisk_context* get_device_context (const gchar *disk, gboolean read_only, GError **error) {\n    struct fdisk_context *cxt = fdisk_new_context ();\n    gint ret = 0;\n\n    if (!cxt) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to create a new context\");\n        return NULL;\n    }\n\n    ret = fdisk_assign_device (cxt, disk, read_only);\n    if (ret != 0) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to assign the new context to disk '%s': %s\", disk, strerror_l (-ret, c_locale));\n        fdisk_unref_context (cxt);\n        return NULL;\n    }\n\n    fdisk_disable_dialogs (cxt, 1);\n    fdisk_set_ask (cxt, fdisk_ask_callback, NULL);\n    return cxt;\n}\n\nstatic void close_context (struct fdisk_context *cxt) {\n    gint ret = 0;\n\n    ret = fdisk_deassign_device (cxt, 0); /* context, nosync */\n\n    if (ret != 0)\n        /* XXX: should report error here? */\n        bd_utils_log_format (BD_UTILS_LOG_WARNING,\n                             \"Failed to close and sync the device: %s\",\n                             strerror_l (-ret, c_locale));\n\n    fdisk_unref_context (cxt);\n}\n\nstatic gboolean write_label (struct fdisk_context *cxt, struct fdisk_table *orig, const gchar *disk, gboolean force, GError **error) {\n    gint ret = 0;\n    gint dev_fd = 0;\n    guint num_tries = 1;\n\n    /* XXX: try to grab a lock for the device so that udev doesn't step in\n       between the two operations we need to perform (see below) with its\n       BLKRRPART ioctl() call which makes the device busy\n       see https://systemd.io/BLOCK_DEVICE_LOCKING */\n    dev_fd = open (disk, O_RDONLY|O_CLOEXEC);\n    if (dev_fd >= 0) {\n        ret = flock (dev_fd, LOCK_EX|LOCK_NB);\n        while ((ret != 0) && (num_tries <= 5)) {\n            g_usleep (100 * 1000); /* microseconds */\n            ret = flock (dev_fd, LOCK_EX|LOCK_NB);\n            num_tries++;\n        }\n    }\n\n    /* Just continue even in case we don't get the lock, there's still a\n       chance things will just work. If not, an error will be reported\n       anyway with no harm. */\n\n    ret = fdisk_write_disklabel (cxt);\n    if (ret != 0) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to write the new disklabel to disk '%s': %s\", disk, strerror_l (-ret, c_locale));\n        if (dev_fd >= 0)\n            close (dev_fd);\n        return FALSE;\n    }\n\n    if (force) {\n        /* force kernel to re-read entire partition table, not only changed partitions */\n        ret = fdisk_reread_partition_table (cxt);\n        if (ret != 0) {\n            g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                         \"Failed to inform kernel about changes on the '%s' device: %s\", disk, strerror_l (-ret, c_locale));\n            if (dev_fd >= 0)\n                close (dev_fd);\n            return FALSE;\n        }\n    } else if (orig) {\n        /* We have original table layout -- reread changed partitions */\n        ret = fdisk_reread_changes (cxt, orig);\n        if (ret != 0) {\n            g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                         \"Failed to inform kernel about changes on the '%s' device: %s\", disk, strerror_l (-ret, c_locale));\n            if (dev_fd >= 0)\n                close (dev_fd);\n            return FALSE;\n        }\n    }\n\n    if (dev_fd >= 0)\n        close (dev_fd);\n\n    return TRUE;\n}\n\n/**\n * bd_part_init:\n *\n * Initializes the plugin. **This function is called automatically by the\n * library's initialization functions.**\n *\n */\ngboolean bd_part_init (void) {\n    c_locale = newlocale (LC_ALL_MASK, \"C\", c_locale);\n    fdisk_init_debug (0);\n    fdisk_version = fdisk_get_library_version (NULL);\n    return TRUE;\n}\n\n/**\n * bd_part_close:\n *\n * Cleans up after the plugin. **This function is called automatically by the\n * library's functions that unload it.**\n *\n */\nvoid bd_part_close (void) {\n    c_locale = (locale_t) 0;\n}\n\n/**\n * bd_part_is_tech_avail:\n * @tech: the queried tech\n * @mode: a bit mask of queried modes of operation (#BDPartTechMode) for @tech\n * @error: (out) (optional): place to store error (details about why the @tech-@mode combination is not available)\n *\n * Returns: whether the @tech-@mode combination is available -- supported by the\n *          plugin implementation and having all the runtime dependencies available\n */\ngboolean bd_part_is_tech_avail (BDPartTech tech, guint64 mode G_GNUC_UNUSED, GError **error) {\n    switch (tech) {\n    case BD_PART_TECH_MBR:\n    case BD_PART_TECH_GPT:\n        /* all MBR and GPT-mode combinations are supported by this implementation of the\n         * plugin, nothing extra is needed */\n        return TRUE;\n    default:\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_TECH_UNAVAIL, \"Unknown technology\");\n        return FALSE;\n    }\n}\n\nstatic const gchar *table_type_str[BD_PART_TABLE_UNDEF] = {\"dos\", \"gpt\"};\n\n/**\n * bd_part_create_table:\n * @disk: path of the disk block device to create partition table on\n * @type: type of the partition table to create\n * @ignore_existing: whether to ignore/overwrite the existing table or not\n *                   (reports an error if %FALSE and there's some table on @disk)\n * @error: (out) (optional): place to store error (if any)\n *\n * Returns: whether the partition table was successfully created or not\n *\n * Tech category: %BD_PART_TECH_MODE_CREATE_TABLE + the tech according to @type\n */\ngboolean bd_part_create_table (const gchar *disk, BDPartTableType type, gboolean ignore_existing, GError **error) {\n    struct fdisk_context *cxt = NULL;\n    gint ret = 0;\n    guint64 progress_id = 0;\n    gchar *msg = NULL;\n    GError *l_error = NULL;\n\n    msg = g_strdup_printf (\"Starting creation of a new partition table on '%s'\", disk);\n    progress_id = bd_utils_report_started (msg);\n    g_free (msg);\n\n    cxt = get_device_context (disk, FALSE, &l_error);\n    if (!cxt) {\n        /* error is already populated */\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    if (!ignore_existing && fdisk_has_label (cxt)) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_EXISTS,\n                     \"Device '%s' already contains a partition table\", disk);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        close_context (cxt);\n        return FALSE;\n    }\n\n    ret = fdisk_create_disklabel (cxt, table_type_str[type]);\n    if (ret != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to create a new disklabel for disk '%s': %s\", disk, strerror_l (-ret, c_locale));\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        close_context (cxt);\n        return FALSE;\n    }\n\n    if (!write_label (cxt, NULL, disk, FALSE, &l_error)) {\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        close_context (cxt);\n        return FALSE;\n    }\n\n    close_context (cxt);\n    bd_utils_report_finished (progress_id, \"Completed\");\n    return TRUE;\n}\n\nstatic gchar* get_part_type_guid_and_gpt_flags (const gchar *device, int part_num, guint64 *attrs, char **type_name, GError **error) {\n    struct fdisk_context *cxt = NULL;\n    struct fdisk_label *lb = NULL;\n    struct fdisk_partition *pa = NULL;\n    struct fdisk_parttype *ptype = NULL;\n    const gchar *label_name = NULL;\n    const gchar *ptype_string = NULL;\n    gchar *ret = NULL;\n    gint status = 0;\n\n    /* first partition in fdisk is 0 */\n    part_num--;\n\n    cxt = get_device_context (device, TRUE, error);\n    if (!cxt) {\n        /* error is already populated */\n        return NULL;\n    }\n\n    lb = fdisk_get_label (cxt, NULL);\n    if (!lb) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to read partition table on device '%s'\", device);\n        close_context (cxt);\n        return NULL;\n    }\n\n    label_name = fdisk_label_get_name (lb);\n    if (g_strcmp0 (label_name, table_type_str[BD_PART_TABLE_GPT]) != 0) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_INVAL,\n                     \"Setting GPT flags is not supported on '%s' partition table\", label_name);\n        close_context (cxt);\n        return NULL;\n    }\n\n    if (attrs) {\n        status = fdisk_gpt_get_partition_attrs (cxt, part_num, attrs);\n        if (status < 0) {\n            g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                         \"Failed to read GPT attributes\");\n            close_context (cxt);\n            return NULL;\n        }\n    }\n\n    status = fdisk_get_partition (cxt, part_num, &pa);\n    if (status != 0) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to get partition %d on device '%s'\", part_num, device);\n        close_context (cxt);\n        return NULL;\n    }\n\n    ptype = fdisk_partition_get_type (pa);\n    if (!ptype) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to get partition type for partition %d on device '%s'\", part_num, device);\n        fdisk_unref_partition (pa);\n        close_context (cxt);\n        return NULL;\n    }\n\n    /* part type name -- human readable string, e.g. \"Microsoft Reserved Partition\" */\n    ptype_string = fdisk_parttype_get_name (ptype);\n    if (!ptype_string) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to get partition type string for partition %d on device '%s'\", part_num, device);\n        fdisk_unref_partition (pa);\n        close_context (cxt);\n        return NULL;\n    }\n\n    *type_name = g_strdup (ptype_string);\n\n    /* part type string -- GUID as a string */\n    ptype_string = fdisk_parttype_get_string (ptype);\n    if (!ptype_string) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to get partition type for partition %d on device '%s'\", part_num, device);\n        fdisk_unref_partition (pa);\n        close_context (cxt);\n        return NULL;\n    }\n\n    ret = g_strdup (ptype_string);\n\n    fdisk_unref_partition (pa);\n    close_context (cxt);\n    return ret;\n}\n\nstatic BDPartSpec* get_part_spec_fdisk (struct fdisk_context *cxt, struct fdisk_partition *pa, GError **error) {\n    struct fdisk_label *lb = NULL;\n    struct fdisk_parttype *ptype = NULL;\n    BDPartSpec *ret = NULL;\n    const gchar *devname = NULL;\n    const gchar *partname = NULL;\n    const gchar *partuuid = NULL;\n    GError *l_error = NULL;\n\n    ret = g_new0 (BDPartSpec, 1);\n\n    devname = fdisk_get_devname (cxt);\n\n    if (fdisk_partition_has_partno (pa)) {\n        if (isdigit (devname[strlen (devname) - 1]))\n            ret->path = g_strdup_printf (\"%sp%zu\", devname, fdisk_partition_get_partno (pa) + 1);\n        else\n            ret->path = g_strdup_printf (\"%s%zu\", devname, fdisk_partition_get_partno (pa) + 1);\n    }\n\n    partname = fdisk_partition_get_name (pa);\n    if (partname)\n        ret->name = g_strdup (partname);\n\n    partuuid = fdisk_partition_get_uuid (pa);\n    if (partuuid)\n        ret->uuid = g_strdup (partuuid);\n\n    if (fdisk_partition_is_container (pa))\n        ret->type = BD_PART_TYPE_EXTENDED;\n    else if (fdisk_partition_is_nested (pa))\n        ret->type = BD_PART_TYPE_LOGICAL;\n    else\n        ret->type = BD_PART_TYPE_NORMAL;\n\n    if (fdisk_partition_is_freespace (pa))\n        ret->type |= BD_PART_TYPE_FREESPACE;\n\n    if (fdisk_partition_has_start (pa))\n        ret->start = (guint64) fdisk_partition_get_start (pa) * fdisk_get_sector_size (cxt);\n\n    if (fdisk_partition_has_size (pa))\n        ret->size = (guint64) fdisk_partition_get_size (pa) * fdisk_get_sector_size (cxt);\n\n    lb = fdisk_get_label (cxt, NULL);\n    if (!lb) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to read partition table.\");\n        bd_part_spec_free (ret);\n        return NULL;\n    }\n\n    if (g_strcmp0 (fdisk_label_get_name (lb), \"gpt\") == 0) {\n        if (ret->type == BD_PART_TYPE_NORMAL) {\n          /* only 'normal' partitions have GUIDs */\n          ret->type_guid = get_part_type_guid_and_gpt_flags (devname, fdisk_partition_get_partno (pa) + 1,\n                                                             &(ret->attrs), &(ret->type_name), &l_error);\n          if (!ret->type_guid && l_error) {\n              g_propagate_error (error, l_error);\n              bd_part_spec_free (ret);\n              return NULL;\n          }\n        }\n    } else if (g_strcmp0 (fdisk_label_get_name (lb), \"dos\") == 0) {\n        /* freespace and extended have no type/ids */\n        if (ret->type == BD_PART_TYPE_NORMAL || ret->type == BD_PART_TYPE_LOGICAL || ret->type == BD_PART_TYPE_EXTENDED) {\n            ptype = fdisk_partition_get_type (pa);\n            if (!ptype) {\n                g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                             \"Failed to get partition type.\");\n                bd_part_spec_free (ret);\n                return NULL;\n            }\n            ret->id = g_strdup_printf (\"0x%02x\", fdisk_parttype_get_code (ptype));\n        }\n        if (fdisk_partition_is_bootable (pa) == 1)\n            ret->bootable = TRUE;\n    }\n\n    return ret;\n}\n\n/**\n * bd_part_get_part_spec:\n * @disk: disk to remove the partition from\n * @part: partition to get spec for\n * @error: (out) (optional): place to store error (if any)\n *\n * Returns: (transfer full): spec of the @part partition from @disk or %NULL in case of error\n *\n * Tech category: %BD_PART_TECH_MODE_QUERY_PART + the tech according to the partition table type\n */\nBDPartSpec* bd_part_get_part_spec (const gchar *disk, const gchar *part, GError **error) {\n    struct fdisk_context *cxt = NULL;\n    struct fdisk_partition *pa = NULL;\n    gint status = 0;\n    gint part_num = 0;\n    BDPartSpec *ret = NULL;\n\n    part_num = get_part_num (part, error);\n    if (part_num == -1)\n        return NULL;\n\n    /* first partition in fdisk is 0 */\n    part_num--;\n\n    cxt = get_device_context (disk, TRUE, error);\n    if (!cxt) {\n        /* error is already populated */\n        return NULL;\n    }\n\n    status = fdisk_get_partition (cxt, part_num, &pa);\n    if (status != 0) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to get partition %d on device '%s'\", part_num, disk);\n        close_context (cxt);\n        return NULL;\n    }\n\n    ret = get_part_spec_fdisk (cxt, pa, error);\n\n    fdisk_unref_partition (pa);\n    close_context (cxt);\n\n    return ret;\n}\n\nstatic BDPartSpec** get_disk_parts (const gchar *disk, gboolean parts, gboolean freespaces, gboolean metadata, GError **error) {\n    struct fdisk_context *cxt = NULL;\n    struct fdisk_table *table = NULL;\n    struct fdisk_partition *pa = NULL;\n    struct fdisk_iter *itr = NULL;\n    BDPartSpec *spec = NULL;\n    BDPartSpec *prev_spec = NULL;\n    GPtrArray *array = NULL;\n    gint status = 0;\n\n    cxt = get_device_context (disk, TRUE, error);\n    if (!cxt) {\n        /* error is already populated */\n        return NULL;\n    }\n\n    table = fdisk_new_table ();\n    if (!table) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to create a new table\");\n        close_context (cxt);\n        return NULL;\n    }\n\n    itr = fdisk_new_iter (FDISK_ITER_FORWARD);\n    if (!itr) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to create a new iterator\");\n        close_context (cxt);\n        return NULL;\n    }\n\n    if (parts) {\n        status = fdisk_get_partitions (cxt, &table);\n        if (status != 0) {\n            g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                         \"Failed to get partitions\");\n            fdisk_free_iter (itr);\n            fdisk_unref_table (table);\n            close_context (cxt);\n            return NULL;\n        }\n    }\n\n    if (freespaces) {\n        status = fdisk_get_freespaces (cxt, &table);\n        if (status != 0) {\n            g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                         \"Failed to get free spaces\");\n            fdisk_free_iter (itr);\n            fdisk_unref_table (table);\n            close_context (cxt);\n            return NULL;\n        }\n    }\n\n    /* sort partitions by start */\n    status = fdisk_table_sort_partitions (table, fdisk_partition_cmp_start);\n    if (status != 0) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to sort partitions\");\n        fdisk_free_iter (itr);\n        fdisk_unref_table (table);\n        close_context (cxt);\n        return NULL;\n    }\n\n    array = g_ptr_array_new_with_free_func ((GDestroyNotify) (void *) bd_part_spec_free);\n\n    while (fdisk_table_next_partition (table, itr, &pa) == 0) {\n        spec = get_part_spec_fdisk (cxt, pa, error);\n        if (!spec) {\n            g_ptr_array_free (array, TRUE);\n            fdisk_free_iter (itr);\n            fdisk_unref_table (table);\n            close_context (cxt);\n            return NULL;\n        }\n\n        /* libfdisk doesn't have a special partition for metadata so we need to add\n           a special metadata partition to the \"empty\" spaces between partitions\n           and free spaces to mimic behaviour of parted\n           metadata partitions should be present in the extended partition in front\n           of every logical partition */\n        if (prev_spec && metadata) {\n            if ((spec->start > prev_spec->start + prev_spec->size) ||\n                (prev_spec->type == BD_PART_TYPE_EXTENDED && spec->start > prev_spec->start) ) {\n                BDPartSpec *ext_meta = g_new0 (BDPartSpec, 1);\n                ext_meta->name = NULL;\n                ext_meta->path = NULL;\n\n                if (prev_spec->type == BD_PART_TYPE_EXTENDED) {\n                    ext_meta->start = prev_spec->start;\n                    ext_meta->size = spec->start - ext_meta->start;\n                    ext_meta->type = BD_PART_TYPE_METADATA | BD_PART_TYPE_LOGICAL;\n                } else {\n                    ext_meta->start = prev_spec->start + prev_spec->size;\n                    ext_meta->size = spec->start - ext_meta->start;\n                    if (spec->type & BD_PART_TYPE_LOGICAL)\n                        ext_meta->type = BD_PART_TYPE_METADATA | BD_PART_TYPE_LOGICAL;\n                    else\n                        ext_meta->type = BD_PART_TYPE_METADATA;\n                }\n                ext_meta->type_guid = NULL;\n\n                g_ptr_array_add (array, ext_meta);\n            }\n        }\n\n        prev_spec = spec;\n        g_ptr_array_add (array, spec);\n    }\n\n    fdisk_free_iter (itr);\n    fdisk_unref_table (table);\n    close_context (cxt);\n\n    g_ptr_array_add (array, NULL);\n    return (BDPartSpec **) g_ptr_array_free (array, FALSE);\n}\n\n/**\n * bd_part_get_part_by_pos:\n * @disk: disk to remove the partition from\n * @position: position (in bytes) determining the partition\n * @error: (out) (optional): place to store error (if any)\n *\n * Returns: (transfer full): spec of the partition from @disk spanning over the @position or %NULL if no such\n *          partition exists or in case of error (@error is set)\n *\n * Tech category: %BD_PART_TECH_MODE_QUERY_PART + the tech according to the partition table type\n */\nBDPartSpec* bd_part_get_part_by_pos (const gchar *disk, guint64 position, GError **error) {\n    BDPartSpec **parts = NULL;\n    BDPartSpec *ret = NULL;\n\n    parts = get_disk_parts (disk, TRUE, TRUE, TRUE, error);\n    if (!parts)\n        return NULL;\n\n    for (BDPartSpec **parts_p = parts; *parts_p; parts_p++) {\n        if ((*parts_p)->start <= position && ((*parts_p)->start + (*parts_p)->size) > position) {\n            if ((*parts_p)->type == BD_PART_TYPE_EXTENDED) {\n                /* we don't want to return extended partition here -- there\n                   is either another logical or free space at this position */\n                continue;\n            }\n\n            ret = *parts_p;\n            break;\n        }\n    }\n\n    /* free the array except the selected element */\n    for (BDPartSpec **parts_p = parts; *parts_p; parts_p++)\n        if (*parts_p != ret)\n            bd_part_spec_free (*parts_p);\n    g_free (parts);\n\n    return ret;\n}\n\n/**\n * bd_part_get_disk_spec:\n * @disk: disk to get information about\n * @error: (out) (optional): place to store error (if any)\n *\n * Returns: (transfer full): information about the given @disk or %NULL (in case of error)\n *\n * Tech category: %BD_PART_TECH_MODE_QUERY_TABLE + the tech according to the partition table type\n */\nBDPartDiskSpec* bd_part_get_disk_spec (const gchar *disk, GError **error) {\n    struct fdisk_context *cxt = NULL;\n    struct fdisk_label *lb = NULL;\n    BDPartDiskSpec *ret = NULL;\n    const gchar *label_name = NULL;\n    BDPartTableType type = BD_PART_TABLE_UNDEF;\n    gboolean found = FALSE;\n\n    cxt = get_device_context (disk, TRUE, error);\n    if (!cxt) {\n        /* error is already populated */\n        return NULL;\n    }\n\n    ret = g_new0 (BDPartDiskSpec, 1);\n    ret->path = g_strdup (fdisk_get_devname (cxt));\n    ret->sector_size = (guint64) fdisk_get_sector_size (cxt);\n    ret->size = fdisk_get_nsectors (cxt) * ret->sector_size;\n\n    lb = fdisk_get_label (cxt, NULL);\n    if (lb) {\n        label_name = fdisk_label_get_name (lb);\n        for (type=BD_PART_TABLE_MSDOS; !found && type < BD_PART_TABLE_UNDEF; type++) {\n            if (g_strcmp0 (label_name, table_type_str[type]) == 0) {\n                ret->table_type = type;\n                found = TRUE;\n            }\n        }\n        if (!found)\n            ret->table_type = BD_PART_TABLE_UNDEF;\n    } else\n        ret->table_type = BD_PART_TABLE_UNDEF;\n\n    close_context (cxt);\n\n    return ret;\n}\n\n/**\n * bd_part_get_disk_parts:\n * @disk: disk to get information about partitions for\n * @error: (out) (optional): place to store error (if any)\n *\n * Returns: (transfer full) (array zero-terminated=1): specs of the partitions from @disk or %NULL in case of error\n *\n * Tech category: %BD_PART_TECH_MODE_QUERY_TABLE + the tech according to the partition table type\n */\nBDPartSpec** bd_part_get_disk_parts (const gchar *disk, GError **error) {\n    return get_disk_parts (disk, TRUE, FALSE, FALSE, error);\n}\n\n/**\n * bd_part_get_disk_free_regions:\n * @disk: disk to get free regions for\n * @error: (out) (optional): place to store error (if any)\n *\n * Returns: (transfer full) (array zero-terminated=1): specs of the free regions from @disk or %NULL in case of error\n *\n * Tech category: %BD_PART_TECH_MODE_QUERY_TABLE + the tech according to the partition table type\n */\nBDPartSpec** bd_part_get_disk_free_regions (const gchar *disk, GError **error) {\n    return get_disk_parts (disk, FALSE, TRUE, FALSE, error);\n}\n\n/**\n * bd_part_get_best_free_region:\n * @disk: disk to get the best free region for\n * @type: type of the partition that is planned to be added\n * @size: size of the partition to be added\n * @error: (out) (optional): place to store error (if any)\n *\n * Returns: (transfer full): spec of the best free region on @disk for a new partition of type @type\n *                           with the size of @size or %NULL if there is none such region or if\n *                           there was an error (@error gets populated)\n *\n * Note: For the @type %BD_PART_TYPE_NORMAL, the smallest possible space that *is not* in an extended partition\n *       is found. For the @type %BD_PART_TYPE_LOGICAL, the smallest possible space that *is* in an extended\n *       partition is found. For %BD_PART_TYPE_EXTENDED, the biggest possible space is found as long as there\n *       is no other extended partition (there can only be one).\n *\n * Tech category: %BD_PART_TECH_MODE_QUERY_TABLE + the tech according to the partition table type\n */\nBDPartSpec* bd_part_get_best_free_region (const gchar *disk, BDPartType type, guint64 size, GError **error) {\n    BDPartSpec **free_regs = NULL;\n    BDPartSpec **free_reg_p = NULL;\n    BDPartSpec *ret = NULL;\n\n    free_regs = bd_part_get_disk_free_regions (disk, error);\n    if (!free_regs)\n        /* error should be populated */\n        return NULL;\n    if (!(*free_regs)) {\n        /* no free regions */\n        g_free (free_regs);\n        return NULL;\n    }\n\n    if (type == BD_PART_TYPE_NORMAL) {\n        for (free_reg_p=free_regs; *free_reg_p; free_reg_p++) {\n            /* check if it has enough space and is not inside an extended partition */\n            if ((*free_reg_p)->size > size && !((*free_reg_p)->type & BD_PART_TYPE_LOGICAL))\n                /* if it is the first that would fit or if it is smaller than\n                   what we found earlier, it is a better match */\n                if (!ret || ((*free_reg_p)->size < ret->size))\n                    ret = *free_reg_p;\n        }\n    } else if (type == BD_PART_TYPE_EXTENDED) {\n        for (free_reg_p=free_regs; *free_reg_p; free_reg_p++) {\n            /* if there already is an extended partition, there cannot be another one */\n            if ((*free_reg_p)->type & BD_PART_TYPE_LOGICAL) {\n                for (free_reg_p=free_regs; *free_reg_p; free_reg_p++)\n                    bd_part_spec_free (*free_reg_p);\n                g_free (free_regs);\n                return NULL;\n            }\n            /* check if it has enough space */\n            if ((*free_reg_p)->size > size)\n                /* if it is the first that would fit or if it is bigger than\n                   what we found earlier, it is a better match */\n                if (!ret || ((*free_reg_p)->size > ret->size))\n                    ret = *free_reg_p;\n        }\n    } else if (type == BD_PART_TYPE_LOGICAL) {\n        for (free_reg_p=free_regs; *free_reg_p; free_reg_p++) {\n            /* check if it has enough space and is inside an extended partition */\n            if ((*free_reg_p)->size > size && ((*free_reg_p)->type & BD_PART_TYPE_LOGICAL))\n                /* if it is the first that would fit or if it is smaller than\n                   what we found earlier, it is a better match */\n                if (!ret || ((*free_reg_p)->size < ret->size))\n                    ret = *free_reg_p;\n        }\n    }\n\n    /* free all the other specs and return the best one */\n    for (free_reg_p=free_regs; *free_reg_p; free_reg_p++)\n        if (*free_reg_p != ret)\n            bd_part_spec_free (*free_reg_p);\n    g_free (free_regs);\n\n    return ret;\n}\n\n/**\n * bd_part_create_part:\n * @disk: disk to create partition on\n * @type: type of the partition to create (if %BD_PART_TYPE_REQ_NEXT, the\n *        partition type will be determined automatically based on the existing\n *        partitions)\n * @start: where the partition should start (i.e. offset from the disk start)\n * @size: desired size of the partition (if 0, a max-sized partition is created)\n * @align: alignment to use for the partition\n * @error: (out) (optional): place to store error (if any)\n *\n * Returns: (transfer full): specification of the created partition or %NULL in case of error\n *\n * NOTE: The resulting partition may start at a different position than given by\n *       @start and can have different size than @size due to alignment.\n *\n * Tech category: %BD_PART_TECH_MODE_MODIFY_TABLE + the tech according to the partition table type\n */\nBDPartSpec* bd_part_create_part (const gchar *disk, BDPartTypeReq type, guint64 start, guint64 size, BDPartAlign align, GError **error) {\n    struct fdisk_context *cxt = NULL;\n    struct fdisk_partition *npa = NULL;\n    gint status = 0;\n    BDPartSpec *ret = NULL;\n    guint64 progress_id = 0;\n    gchar *msg = NULL;\n    guint64 sector_size = 0;\n    guint64 grain_size = 0;\n    guint64 end = 0;\n    struct fdisk_parttype *ptype = NULL;\n    struct fdisk_label *lbl = NULL;\n    struct fdisk_table *table = NULL;\n    struct fdisk_iter *iter = NULL;\n    struct fdisk_partition *pa = NULL;\n    struct fdisk_partition *epa = NULL;\n    struct fdisk_partition *in_pa = NULL;\n    struct fdisk_partition *n_epa = NULL;\n    guint n_parts = 0;\n    gboolean on_gpt = FALSE;\n    size_t partno = 0;\n    gchar *ppath = NULL;\n    gboolean new_extended = FALSE;\n    GError *l_error = NULL;\n\n    msg = g_strdup_printf (\"Started adding partition to '%s'\", disk);\n    progress_id = bd_utils_report_started (msg);\n    g_free (msg);\n\n    cxt = get_device_context (disk, FALSE, &l_error);\n    if (!cxt) {\n        /* error is already populated */\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return NULL;\n    }\n\n    status = fdisk_get_partitions (cxt, &table);\n    if (status != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to get existing partitions on the device: %s\", strerror_l (-status, c_locale));\n        fdisk_unref_partition (npa);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return NULL;\n   }\n\n    npa = fdisk_new_partition ();\n    if (!npa) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to create new partition object\");\n        fdisk_unref_table (table);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return NULL;\n    }\n\n    sector_size = (guint64) fdisk_get_sector_size (cxt);\n    grain_size = (guint64) fdisk_get_grain_size (cxt);\n\n    if (align == BD_PART_ALIGN_NONE)\n        grain_size = sector_size;\n    else if (align == BD_PART_ALIGN_MINIMAL)\n        grain_size = (guint64) fdisk_get_minimal_iosize (cxt);\n    /* else OPTIMAL or unknown -> nothing to do */\n\n    status = fdisk_save_user_grain (cxt, grain_size);\n    if (status != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to setup alignment\");\n        fdisk_unref_table (table);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return NULL;\n    }\n\n    /* this is needed so that the saved grain size from above becomes\n     * effective */\n    status = fdisk_reset_device_properties (cxt);\n    if (status != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to setup alignment\");\n        fdisk_unref_table (table);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return NULL;\n    }\n\n    /* set first usable sector to 1 for none and minimal alignments\n       we need to set this here, because fdisk_reset_device_properties */\n    if (align == BD_PART_ALIGN_NONE || align == BD_PART_ALIGN_MINIMAL)\n        fdisk_set_first_lba (cxt, 1);\n\n    grain_size = (guint64) fdisk_get_grain_size (cxt);\n\n    /* align start up to sectors, we will align it further based on grain_size\n       using libfdisk later */\n    start = (start + sector_size - 1) / sector_size;\n\n    /* start on sector 0 doesn't work with libfdisk alignment -- everything\n       else is properly aligned, but zero is aligned to zero */\n    if (start == 0)\n        start = 1;\n\n    start = fdisk_align_lba (cxt, (fdisk_sector_t) start, FDISK_ALIGN_UP);\n\n    if (size == 0)\n        /* no size specified, set the end to default (maximum) */\n        fdisk_partition_end_follow_default (npa, 1);\n    else {\n        /* align size down */\n        size = (size / grain_size) * grain_size;\n        size = size / sector_size;\n\n        /* use libfdisk to align the end sector */\n        end = start + size;\n        end = fdisk_align_lba (cxt, (fdisk_sector_t) end, FDISK_ALIGN_DOWN);\n        size = end - start;\n\n        if (fdisk_partition_set_size (npa, size) != 0) {\n            g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                         \"Failed to set partition size\");\n            fdisk_unref_table (table);\n            fdisk_unref_partition (npa);\n            close_context (cxt);\n            bd_utils_report_finished (progress_id, l_error->message);\n            g_propagate_error (error, l_error);\n            return NULL;\n        }\n    }\n\n    fdisk_partition_partno_follow_default (npa, 1);\n    lbl = fdisk_get_label (cxt, NULL);\n    on_gpt = g_strcmp0 (fdisk_label_get_name (lbl), \"gpt\") == 0;\n\n    /* GPT is easy, all partitions are the same (NORMAL) */\n    if (on_gpt && type == BD_PART_TYPE_REQ_NEXT)\n      type = BD_PART_TYPE_REQ_NORMAL;\n\n    if (on_gpt && type != BD_PART_TYPE_REQ_NORMAL) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Only normal partitions are supported on GPT.\");\n        fdisk_unref_table (table);\n        fdisk_unref_partition (npa);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return NULL;\n    }\n\n    /* on DOS we may have to decide if requested */\n    if (type == BD_PART_TYPE_REQ_NEXT) {\n        iter = fdisk_new_iter (FDISK_ITER_FORWARD);\n        while (fdisk_table_next_partition (table, iter, &pa) == 0) {\n            if (fdisk_partition_is_freespace (pa))\n                continue;\n            if (!epa && fdisk_partition_is_container (pa))\n                epa = pa;\n            if (!in_pa && fdisk_partition_has_start (pa) && fdisk_partition_has_size (pa) &&\n                fdisk_partition_get_start (pa) <= start &&\n                (start < (fdisk_partition_get_start (pa) + fdisk_partition_get_size (pa))))\n                in_pa = pa;\n            n_parts++;\n        }\n          if (in_pa) {\n            if (epa == in_pa)\n                /* creating a partition inside an extended partition -> LOGICAL */\n                type = BD_PART_TYPE_REQ_LOGICAL;\n            else {\n                /* trying to create a partition inside an existing one, but not\n                   an extended one -> error */\n                g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_INVAL,\n                             \"Cannot create a partition inside an existing non-extended one\");\n                fdisk_unref_partition (npa);\n                fdisk_free_iter (iter);\n                fdisk_unref_table (table);\n                close_context (cxt);\n                bd_utils_report_finished (progress_id, l_error->message);\n                g_propagate_error (error, l_error);\n                return NULL;\n            }\n        } else if (epa)\n            /* there's an extended partition already and we are creating a new\n               one outside of it */\n            type = BD_PART_TYPE_REQ_NORMAL;\n        else if (n_parts == 3) {\n            /* already 3 primary partitions -> create an extended partition of\n               the biggest possible size and a logical partition as requested in\n               it */\n            new_extended = TRUE;\n            n_epa = fdisk_new_partition ();\n            if (!n_epa) {\n                g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                             \"Failed to create new partition object\");\n                fdisk_unref_partition (npa);\n                close_context (cxt);\n                bd_utils_report_finished (progress_id, l_error->message);\n                g_propagate_error (error, l_error);\n                return NULL;\n            }\n            if (fdisk_partition_set_start (n_epa, start) != 0) {\n                g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                             \"Failed to set partition start\");\n                fdisk_unref_partition (n_epa);\n                fdisk_unref_partition (npa);\n                fdisk_free_iter (iter);\n                fdisk_unref_table (table);\n                close_context (cxt);\n                bd_utils_report_finished (progress_id, l_error->message);\n                g_propagate_error (error, l_error);\n                return NULL;\n            }\n\n            fdisk_partition_partno_follow_default (n_epa, 1);\n\n            status = fdisk_partition_next_partno (npa, cxt, &partno);\n            if (status != 0) {\n                g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                             \"Failed to get new extended partition number\");\n                fdisk_unref_partition (npa);\n                close_context (cxt);\n                bd_utils_report_finished (progress_id, l_error->message);\n                g_propagate_error (error, l_error);\n                return NULL;\n            }\n\n            status = fdisk_partition_set_partno (npa, partno);\n            if (status != 0) {\n                g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                             \"Failed to set new extended partition number\");\n                fdisk_unref_partition (npa);\n                close_context (cxt);\n                bd_utils_report_finished (progress_id, l_error->message);\n                g_propagate_error (error, l_error);\n                return NULL;\n            }\n\n            /* set the end to default (maximum) */\n            fdisk_partition_end_follow_default (n_epa, 1);\n\n            /* \"05\" for extended partition */\n            ptype = fdisk_label_parse_parttype (fdisk_get_label (cxt, NULL), \"05\");\n            if (fdisk_partition_set_type (n_epa, ptype) != 0) {\n                g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                             \"Failed to set partition type\");\n                fdisk_unref_partition (n_epa);\n                fdisk_unref_partition (npa);\n                fdisk_free_iter (iter);\n                fdisk_unref_table (table);\n                close_context (cxt);\n                bd_utils_report_finished (progress_id, l_error->message);\n                g_propagate_error (error, l_error);\n                return NULL;\n            }\n            fdisk_unref_parttype (ptype);\n\n            status = fdisk_add_partition (cxt, n_epa, NULL);\n            fdisk_unref_partition (n_epa);\n            if (status != 0) {\n                g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                             \"Failed to add new partition to the table: %s\", strerror_l (-status, c_locale));\n                fdisk_unref_partition (npa);\n                fdisk_free_iter (iter);\n                fdisk_unref_table (table);\n                close_context (cxt);\n                bd_utils_report_finished (progress_id, l_error->message);\n                g_propagate_error (error, l_error);\n                return NULL;\n            }\n            /* shift the start 2 MiB further as that's where the first logical\n               partition inside an extended partition can start */\n            start += (2 MiB / sector_size);\n            type = BD_PART_TYPE_REQ_LOGICAL;\n        } else\n            /* no extended partition and not 3 primary partitions -> just create\n               another primary (NORMAL) partition*/\n            type = BD_PART_TYPE_REQ_NORMAL;\n\n        fdisk_free_iter (iter);\n    }\n\n    if (type == BD_PART_TYPE_REQ_EXTENDED) {\n        new_extended = TRUE;\n        /* \"05\" for extended partition */\n        ptype = fdisk_label_parse_parttype (fdisk_get_label (cxt, NULL), \"05\");\n        if (fdisk_partition_set_type (npa, ptype) != 0) {\n            g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                         \"Failed to set partition type\");\n            fdisk_unref_table (table);\n            fdisk_unref_partition (npa);\n            close_context (cxt);\n            bd_utils_report_finished (progress_id, l_error->message);\n            g_propagate_error (error, l_error);\n            return NULL;\n        }\n\n        fdisk_unref_parttype (ptype);\n    }\n\n    if (fdisk_partition_set_start (npa, start) != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to set partition start\");\n        fdisk_unref_table (table);\n        fdisk_unref_partition (npa);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return NULL;\n    }\n\n    if (type == BD_PART_TYPE_REQ_LOGICAL) {\n        /* next_partno doesn't work for logical partitions, for these the\n           current maximal number of partitions supported by the label\n           is the next (logical) partition number */\n        partno = fdisk_get_npartitions (cxt);\n\n    } else {\n        status = fdisk_partition_next_partno (npa, cxt, &partno);\n        if (status != 0) {\n            g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                         \"Failed to get new partition number\");\n            fdisk_unref_table (table);\n            fdisk_unref_partition (npa);\n            close_context (cxt);\n            bd_utils_report_finished (progress_id, l_error->message);\n            g_propagate_error (error, l_error);\n            return NULL;\n        }\n    }\n\n    status = fdisk_partition_set_partno (npa, partno);\n    if (status != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to set new partition number\");\n        fdisk_unref_table (table);\n        fdisk_unref_partition (npa);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return NULL;\n    }\n\n    status = fdisk_add_partition (cxt, npa, NULL);\n    if (status != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to add new partition to the table: %s\", strerror_l (-status, c_locale));\n        fdisk_unref_table (table);\n        fdisk_unref_partition (npa);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return NULL;\n    }\n\n    /* for new extended partition we need to force reread whole partition table with\n       libfdisk < 2.36.1 */\n    if (!write_label (cxt, table, disk, new_extended && fdisk_version < 2361, &l_error)) {\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        fdisk_unref_table (table);\n        fdisk_unref_partition (npa);\n        close_context (cxt);\n        return NULL;\n    }\n\n    if (fdisk_partition_has_partno (npa)) {\n        if (isdigit (disk[strlen (disk) - 1]))\n            ppath = g_strdup_printf (\"%sp%zu\", disk, fdisk_partition_get_partno (npa) + 1);\n        else\n            ppath = g_strdup_printf (\"%s%zu\", disk, fdisk_partition_get_partno (npa) + 1);\n    }\n\n    /* close the context now, we no longer need it */\n    fdisk_unref_table (table);\n    fdisk_unref_partition (npa);\n    close_context (cxt);\n\n    /* the in-memory model of the new partition is not updated, we need to\n       read the spec manually\n       if we get NULL and error here, just propagate it further */\n    ret = bd_part_get_part_spec (disk, ppath, error);\n    g_free (ppath);\n\n    bd_utils_report_finished (progress_id, \"Completed\");\n\n    return ret;\n}\n\n/**\n * bd_part_delete_part:\n * @disk: disk to remove the partition from\n * @part: partition to remove\n * @error: (out) (optional): place to store error (if any)\n *\n * Returns: whether the @part partition was successfully deleted from @disk\n *\n * Tech category: %BD_PART_TECH_MODE_MODIFY_TABLE + the tech according to the partition table type\n */\ngboolean bd_part_delete_part (const gchar *disk, const gchar *part, GError **error) {\n    gint part_num = 0;\n    struct fdisk_context *cxt = NULL;\n    struct fdisk_table *table = NULL;\n    gint ret = 0;\n    guint64 progress_id = 0;\n    gchar *msg = NULL;\n    GError *l_error = NULL;\n\n    msg = g_strdup_printf (\"Started deleting partition '%s'\", part);\n    progress_id = bd_utils_report_started (msg);\n    g_free (msg);\n\n    part_num = get_part_num (part, &l_error);\n    if (part_num == -1) {\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    /* /dev/sda1 is the partition number 0 in libfdisk */\n    part_num--;\n    cxt = get_device_context (disk, FALSE, &l_error);\n    if (!cxt) {\n        /* error is already populated */\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    ret = fdisk_get_partitions (cxt, &table);\n    if (ret != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to get existing partitions on the device: %s\", strerror_l (-ret, c_locale));\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n   }\n\n    ret = fdisk_delete_partition (cxt, (size_t) part_num);\n    if (ret != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to delete partition '%d' on device '%s': %s\", part_num+1, disk, strerror_l (-ret, c_locale));\n        fdisk_unref_table (table);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    if (!write_label (cxt, table, disk, FALSE, &l_error)) {\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        fdisk_unref_table (table);\n        close_context (cxt);\n        return FALSE;\n    }\n\n    fdisk_unref_table (table);\n    close_context (cxt);\n\n    bd_utils_report_finished (progress_id, \"Completed\");\n\n    return TRUE;\n}\n\n/* get maximal size for partition when resizing\n * this is a simplified copy of 'resize_get_last_possible' function from\n * libfdisk which is unfortunately not public\n */\nstatic gboolean get_max_part_size (struct fdisk_table *tb, guint partno, guint64 *max_size, GError **error) {\n    struct fdisk_partition *pa = NULL;\n    struct fdisk_partition *cur = NULL;\n    struct fdisk_iter *itr = NULL;\n    guint64 start = 0;\n    gboolean found = FALSE;\n\n    itr = fdisk_new_iter (FDISK_ITER_FORWARD);\n    if (!itr) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to create a new iterator\");\n        return FALSE;\n    }\n\n    cur = fdisk_table_get_partition_by_partno (tb, partno);\n    if (!cur) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to locate partition '%d' in table.\", partno);\n        fdisk_free_iter (itr);\n        return FALSE;\n    }\n\n    start = fdisk_partition_get_start (cur);\n\n    while (!found && fdisk_table_next_partition (tb, itr, &pa) == 0) {\n        if (!fdisk_partition_has_start (pa) || !fdisk_partition_has_size (pa) ||\n            (fdisk_partition_is_container (pa) && pa != cur)) {\n            /* partition has no size/start or is an extended partition */\n            continue;\n        }\n\n        if (fdisk_partition_is_nested (pa) && fdisk_partition_is_container (cur)) {\n            /* ignore logical partitions inside if we are checking an extended partition */\n            continue;\n        }\n\n        if (fdisk_partition_is_nested (cur) && !fdisk_partition_is_nested (pa)) {\n            /* current partition is nested, we are looking for a nested free space */\n            continue;\n        }\n\n        if (pa == cur) {\n            /* found our current partition */\n            found = TRUE;\n        }\n    }\n\n    if (found && fdisk_table_next_partition (tb, itr, &pa) == 0) {\n        /* check next partition after our current we found */\n        if (fdisk_partition_is_freespace (pa)) {\n            /* we found a free space after current partition */\n            if (LIBFDISK_MINOR_VERSION <= 32)\n                /* XXX: older versions of libfdisk doesn't count free space between\n                    partitions as usable so we need to do the same here, see\n                    https://github.com/karelzak/util-linux/commit/2f35c1ead621f42f32f7777232568cb03185b473 */\n                *max_size  = fdisk_partition_get_size (cur) + fdisk_partition_get_size (pa);\n            else\n                *max_size = fdisk_partition_get_size (pa) - (start - fdisk_partition_get_start (pa));\n        }\n    }\n\n    /* no free space found: set max_size to current size */\n    if (*max_size == 0)\n        *max_size = fdisk_partition_get_size (cur);\n\n    fdisk_free_iter (itr);\n    return TRUE;\n}\n\n/**\n * bd_part_resize_part:\n * @disk: disk containing the partition\n * @part: partition to resize\n * @size: new partition size, 0 for maximal size\n * @align: alignment to use for the partition end\n * @error: (out) (optional): place to store error (if any)\n *\n * Returns: whether the @part partition was successfully resized on @disk to @size\n *\n * NOTE: The resulting partition may be slightly bigger than requested due to alignment.\n *\n * Tech category: %BD_PART_TECH_MODE_MODIFY_TABLE + the tech according to the partition table type\n */\ngboolean bd_part_resize_part (const gchar *disk, const gchar *part, guint64 size, BDPartAlign align, GError **error) {\n    gint part_num = 0;\n    struct fdisk_context *cxt = NULL;\n    struct fdisk_table *table = NULL;\n    struct fdisk_partition *pa = NULL;\n    gint ret = 0;\n    guint64 old_size = 0;\n    guint64 sector_size = 0;\n    guint64 grain_size = 0;\n    guint64 progress_id = 0;\n    guint64 max_size = 0;\n    guint64 start = 0;\n    guint64 end = 0;\n    gint version = 0;\n    gchar *msg = NULL;\n    GError *l_error = NULL;\n\n    msg = g_strdup_printf (\"Started resizing partition '%s'\", part);\n    progress_id = bd_utils_report_started (msg);\n    g_free (msg);\n\n    part_num = get_part_num (part, &l_error);\n    if (part_num == -1) {\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    /* /dev/sda1 is the partition number 0 in libfdisk */\n    part_num--;\n    cxt = get_device_context (disk, FALSE, &l_error);\n    if (!cxt) {\n        /* error is already populated */\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    /* get existing partitions and free spaces and sort the table */\n    ret = fdisk_get_partitions (cxt, &table);\n    if (ret != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to get existing partitions on the device: %s\", strerror_l (-ret, c_locale));\n        fdisk_unref_table (table);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    ret = fdisk_get_freespaces (cxt, &table);\n    if (ret != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to get free spaces on the device: %s\", strerror_l (-ret, c_locale));\n        fdisk_unref_table (table);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    fdisk_table_sort_partitions (table, fdisk_partition_cmp_start);\n\n    ret = fdisk_get_partition (cxt, part_num, &pa);\n    if (ret != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to get partition %d on device '%s'\", part_num, disk);\n        fdisk_unref_table (table);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    if (fdisk_partition_has_size (pa))\n        old_size = (guint64) fdisk_partition_get_size (pa);\n    else {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to get size for partition %d on device '%s'\", part_num, disk);\n        fdisk_unref_partition (pa);\n        fdisk_unref_table (table);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    /* set grain_size based on user alignment preferences */\n    sector_size = (guint64) fdisk_get_sector_size (cxt);\n    grain_size = (guint64) fdisk_get_grain_size (cxt);\n\n    if (align == BD_PART_ALIGN_NONE)\n        grain_size = sector_size;\n    else if (align == BD_PART_ALIGN_MINIMAL)\n        grain_size = (guint64) fdisk_get_minimal_iosize (cxt);\n    /* else OPTIMAL or unknown -> nothing to do */\n\n    if (!get_max_part_size (table, part_num, &max_size, &l_error)) {\n        g_prefix_error (&l_error, \"Failed to get maximal size for '%s': \", part);\n        fdisk_unref_table (table);\n        fdisk_unref_partition (pa);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    if (size == 0) {\n        if (max_size == old_size) {\n            bd_utils_log_format (BD_UTILS_LOG_INFO, \"Not resizing, partition '%s' is already at its maximum size.\", part);\n            fdisk_unref_table (table);\n            fdisk_unref_partition (pa);\n            close_context (cxt);\n            bd_utils_report_finished (progress_id, \"Completed\");\n            return TRUE;\n        }\n\n        /* latest libfdisk introduces default end alignment for new partitions, we should\n           do the same for resizes where we calculate the size ourselves */\n        version = fdisk_get_library_version (NULL);\n        if (version >= 2380 && align != BD_PART_ALIGN_NONE) {\n            start = fdisk_partition_get_start (pa);\n            end = start + max_size;\n            end = fdisk_align_lba_in_range (cxt, end, start, end);\n            max_size = end - start;\n        }\n\n        if (fdisk_partition_set_size (pa, max_size) != 0) {\n            g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                         \"Failed to set size for partition %d on device '%s'\", part_num, disk);\n            fdisk_unref_table (table);\n            fdisk_unref_partition (pa);\n            close_context (cxt);\n            bd_utils_report_finished (progress_id, l_error->message);\n            g_propagate_error (error, l_error);\n            return FALSE;\n        }\n    } else {\n        /* align size up */\n        if (size % grain_size != 0)\n            size = ((size + grain_size) / grain_size) * grain_size;\n        size = size / sector_size;\n\n        if (size == old_size) {\n            bd_utils_log_format (BD_UTILS_LOG_INFO, \"Not resizing, new size after alignment is the same as the old size.\");\n            fdisk_unref_table (table);\n            fdisk_unref_partition (pa);\n            close_context (cxt);\n            bd_utils_report_finished (progress_id, \"Completed\");\n            return TRUE;\n        }\n\n        if (size > old_size && size > max_size) {\n            if (size - max_size <= 4 MiB / sector_size) {\n                bd_utils_log_format (BD_UTILS_LOG_INFO,\n                                     \"Requested size %\"G_GUINT64_FORMAT\" is bigger than max size for partition '%s', adjusting to %\"G_GUINT64_FORMAT\".\",\n                                     size * sector_size, part, max_size * sector_size);\n                size = max_size;\n            } else {\n                g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                             \"Requested size %\"G_GUINT64_FORMAT\" is bigger than max size (%\"G_GUINT64_FORMAT\") for partition '%s'\",\n                             size * sector_size, max_size * sector_size, part);\n                fdisk_unref_table (table);\n                fdisk_unref_partition (pa);\n                close_context (cxt);\n                bd_utils_report_finished (progress_id, l_error->message);\n                g_propagate_error (error, l_error);\n                return FALSE;\n            }\n        }\n\n        if (fdisk_partition_set_size (pa, size) != 0) {\n            g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                         \"Failed to set partition size\");\n            fdisk_unref_table (table);\n            fdisk_unref_partition (pa);\n            close_context (cxt);\n            bd_utils_report_finished (progress_id, l_error->message);\n            g_propagate_error (error, l_error);\n            return FALSE;\n        }\n    }\n\n    ret = fdisk_set_partition (cxt, part_num, pa);\n    if (ret != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to resize partition '%s': %s\", part, strerror_l (-ret, c_locale));\n        fdisk_unref_table (table);\n        fdisk_unref_partition (pa);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    if (!write_label (cxt, table, disk, FALSE, &l_error)) {\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        fdisk_unref_table (table);\n        fdisk_unref_partition (pa);\n        close_context (cxt);\n        return FALSE;\n    }\n\n    fdisk_unref_table (table);\n\n    /* XXX: double free in libfdisk, see https://github.com/karelzak/util-linux/pull/822\n    fdisk_unref_partition (pa); */\n    close_context (cxt);\n\n    bd_utils_report_finished (progress_id, \"Completed\");\n\n    return TRUE;\n}\n\nstatic gboolean set_part_type (struct fdisk_context *cxt, gint part_num, const gchar *type_str, BDPartTableType table_type, GError **error) {\n    struct fdisk_label *lb = NULL;\n    struct fdisk_partition *pa = NULL;\n    struct fdisk_parttype *ptype = NULL;\n    const gchar *label_name = NULL;\n    gint status = 0;\n    gint part_id_int = 0;\n\n    /* check if part type/id is valid for MBR */\n    if (table_type == BD_PART_TABLE_MSDOS) {\n        part_id_int = g_ascii_strtoull (type_str, NULL, 0);\n\n        if (part_id_int == 0) {\n            g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_INVAL,\n                         \"Invalid partition id given: '%s'.\", type_str);\n            return FALSE;\n        }\n\n        if (part_id_int == 0x05 || part_id_int == 0x0f || part_id_int == 0x85) {\n            g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_INVAL,\n                         \"Cannot change partition id to extended.\");\n            return FALSE;\n        }\n    }\n\n    lb = fdisk_get_label (cxt, NULL);\n    if (!lb) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to read partition table.\");\n        return FALSE;\n    }\n\n    label_name = fdisk_label_get_name (lb);\n    if (g_strcmp0 (label_name, table_type_str[table_type]) != 0) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_INVAL,\n                     \"Setting partition type is not supported on '%s' partition table\", label_name);\n        return FALSE;\n    }\n\n    status = fdisk_get_partition (cxt, part_num, &pa);\n    if (status != 0) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_INVAL,\n                     \"Failed to get partition %d.\", part_num);\n        return FALSE;\n    }\n\n    ptype = fdisk_label_parse_parttype (lb, type_str);\n    if (!ptype) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_INVAL,\n                     \"Failed to parse partition type.\");\n        fdisk_unref_partition (pa);\n        return FALSE;\n    }\n\n    status = fdisk_set_partition_type (cxt, part_num, ptype);\n    if (status != 0) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to set partition type for partition %d.\", part_num);\n        fdisk_unref_parttype (ptype);\n        fdisk_unref_partition (pa);\n        return FALSE;\n    }\n\n    fdisk_unref_parttype (ptype);\n    fdisk_unref_partition (pa);\n    return TRUE;\n}\n\n/**\n * bd_part_set_part_name:\n * @disk: device the partition belongs to\n * @part: partition the name should be set for\n * @name: name to set\n * @error: (out) (optional): place to store error (if any)\n *\n * Returns: whether the name was successfully set or not\n *\n * Tech category: %BD_PART_TECH_MODE_MODIFY_PART + the tech according to the partition table type\n */\ngboolean bd_part_set_part_name (const gchar *disk, const gchar *part, const gchar *name, GError **error) {\n    struct fdisk_context *cxt = NULL;\n    struct fdisk_label *lb = NULL;\n    struct fdisk_partition *pa = NULL;\n    const gchar *label_name = NULL;\n    gint part_num = 0;\n    gint status = 0;\n    guint64 progress_id = 0;\n    gchar *msg = NULL;\n    GError *l_error = NULL;\n\n    msg = g_strdup_printf (\"Started setting name on the partition '%s'\", part);\n    progress_id = bd_utils_report_started (msg);\n    g_free (msg);\n\n    cxt = get_device_context (disk, FALSE, error);\n    if (!cxt) {\n        /* error is already populated */\n        return FALSE;\n    }\n\n    lb = fdisk_get_label (cxt, NULL);\n    if (!lb) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to read partition table on device '%s'\", disk);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    label_name = fdisk_label_get_name (lb);\n    if (g_strcmp0 (label_name, table_type_str[BD_PART_TABLE_GPT]) != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_INVAL,\n                     \"Partition names unsupported on the device '%s' ('%s')\", disk,\n                     label_name);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    part_num = get_part_num (part, &l_error);\n    if (part_num == -1) {\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    /* /dev/sda1 is the partition number 0 in libfdisk */\n    part_num--;\n\n    status = fdisk_get_partition (cxt, part_num, &pa);\n    if (status != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to get partition '%s' on device '%s': %s\",\n                     part, disk, strerror_l (-status, c_locale));\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    status = fdisk_partition_set_name (pa, name);\n    if (status != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to set name on the partition '%s' on device '%s': %s\",\n                     part, disk, strerror_l (-status, c_locale));\n        fdisk_unref_partition (pa);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    status = fdisk_set_partition (cxt, part_num, pa);\n    if (status != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to set name on the partition '%s' on device '%s': %s\",\n                     part, disk, strerror_l (-status, c_locale));\n        fdisk_unref_partition (pa);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    fdisk_unref_partition (pa);\n\n    if (!write_label (cxt, NULL, disk, FALSE, &l_error)) {\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        close_context (cxt);\n        return FALSE;\n    }\n\n    close_context (cxt);\n    bd_utils_report_finished (progress_id, \"Completed\");\n    return TRUE;\n}\n\n/**\n * bd_part_set_part_type:\n * @disk: device the partition belongs to\n * @part: partition the type should be set for\n * @type_guid: GUID of the type\n * @error: (out) (optional): place to store error (if any)\n *\n * Returns: whether the @type_guid type was successfully set for @part or not\n *\n * Tech category: %BD_PART_TECH_GPT-%BD_PART_TECH_MODE_MODIFY_PART\n */\ngboolean bd_part_set_part_type (const gchar *disk, const gchar *part, const gchar *type_guid, GError **error) {\n    guint64 progress_id = 0;\n    gchar *msg = NULL;\n    struct fdisk_context *cxt = NULL;\n    gint part_num = 0;\n    GError *l_error = NULL;\n\n    msg = g_strdup_printf (\"Started setting type on the partition '%s'\", part);\n    progress_id = bd_utils_report_started (msg);\n    g_free (msg);\n\n    part_num = get_part_num (part, &l_error);\n    if (part_num == -1) {\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    /* /dev/sda1 is the partition number 0 in libfdisk */\n    part_num--;\n\n    cxt = get_device_context (disk, FALSE, &l_error);\n    if (!cxt) {\n        /* error is already populated */\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    if (!set_part_type (cxt, part_num, type_guid, BD_PART_TABLE_GPT, &l_error)) {\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        close_context (cxt);\n        return FALSE;\n    }\n\n    if (!write_label (cxt, NULL, disk, FALSE, &l_error)) {\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        close_context (cxt);\n        return FALSE;\n    }\n\n    close_context (cxt);\n    bd_utils_report_finished (progress_id, \"Completed\");\n    return TRUE;\n}\n\n/**\n * bd_part_set_part_id:\n * @disk: device the partition belongs to\n * @part: partition the ID should be set for\n * @part_id: partition Id\n * @error: (out) (optional): place to store error (if any)\n *\n * Returns: whether the @part_id type was successfully set for @part or not\n *\n * Tech category: %BD_PART_TECH_MBR-%BD_PART_TECH_MODE_MODIFY_PART\n */\ngboolean bd_part_set_part_id (const gchar *disk, const gchar *part, const gchar *part_id, GError **error) {\n    guint64 progress_id = 0;\n    gchar *msg = NULL;\n    struct fdisk_context *cxt = NULL;\n    gint part_num = 0;\n    GError *l_error = NULL;\n\n    msg = g_strdup_printf (\"Started setting id on the partition '%s'\", part);\n    progress_id = bd_utils_report_started (msg);\n    g_free (msg);\n\n    part_num = get_part_num (part, &l_error);\n    if (part_num == -1) {\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    /* /dev/sda1 is the partition number 0 in libfdisk */\n    part_num--;\n\n    cxt = get_device_context (disk, FALSE, &l_error);\n    if (!cxt) {\n        /* error is already populated */\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    if (!set_part_type (cxt, part_num, part_id, BD_PART_TABLE_MSDOS, &l_error)) {\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        close_context (cxt);\n        return FALSE;\n    }\n\n    if (!write_label (cxt, NULL, disk, FALSE, &l_error)) {\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        close_context (cxt);\n        return FALSE;\n    }\n\n    close_context (cxt);\n    bd_utils_report_finished (progress_id, \"Completed\");\n    return TRUE;\n}\n\n/**\n * bd_part_set_part_uuid:\n * @disk: device the partition belongs to\n * @part: partition the UUID should be set for\n * @uuid: partition UUID to set\n * @error: (out) (optional): place to store error (if any)\n *\n * Returns: whether the @uuid type was successfully set for @part or not\n *\n * Tech category: %BD_PART_TECH_GPT-%BD_PART_TECH_MODE_MODIFY_PART\n */\ngboolean bd_part_set_part_uuid (const gchar *disk, const gchar *part, const gchar *uuid, GError **error) {\n    struct fdisk_context *cxt = NULL;\n    struct fdisk_partition *pa = NULL;\n    struct fdisk_label *lb = NULL;\n    const gchar *label_name = NULL;\n    gint part_num = 0;\n    gint status = 0;\n    guint64 progress_id = 0;\n    gchar *msg = NULL;\n    GError *l_error = NULL;\n\n    msg = g_strdup_printf (\"Started setting UUID on the partition '%s'\", part);\n    progress_id = bd_utils_report_started (msg);\n    g_free (msg);\n\n    cxt = get_device_context (disk, FALSE, error);\n    if (!cxt) {\n        /* error is already populated */\n        return FALSE;\n    }\n\n    lb = fdisk_get_label (cxt, NULL);\n    if (!lb) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to read partition table on device '%s'\", disk);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    label_name = fdisk_label_get_name (lb);\n    if (g_strcmp0 (label_name, table_type_str[BD_PART_TABLE_GPT]) != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_INVAL,\n                     \"Partition UUIDs unsupported on the device '%s' ('%s')\", disk,\n                     label_name);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    part_num = get_part_num (part, &l_error);\n    if (part_num == -1) {\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    /* /dev/sda1 is the partition number 0 in libfdisk */\n    part_num--;\n\n    status = fdisk_get_partition (cxt, part_num, &pa);\n    if (status != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to get partition '%s' on device '%s': %s\",\n                     part, disk, strerror_l (-status, c_locale));\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    status = fdisk_partition_set_uuid (pa, uuid);\n    if (status != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to set UUID on the partition '%s' on device '%s': %s\",\n                     part, disk, strerror_l (-status, c_locale));\n        fdisk_unref_partition (pa);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    status = fdisk_set_partition (cxt, part_num, pa);\n    if (status != 0) {\n        g_set_error (&l_error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to set UUID on the partition '%s' on device '%s': %s\",\n                     part, disk, strerror_l (-status, c_locale));\n        fdisk_unref_partition (pa);\n        close_context (cxt);\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        return FALSE;\n    }\n\n    fdisk_unref_partition (pa);\n\n    if (!write_label (cxt, NULL, disk, FALSE, &l_error)) {\n        bd_utils_report_finished (progress_id, l_error->message);\n        g_propagate_error (error, l_error);\n        close_context (cxt);\n        return FALSE;\n    }\n\n    close_context (cxt);\n    bd_utils_report_finished (progress_id, \"Completed\");\n    return TRUE;\n}\n\n/**\n * bd_part_set_part_bootable:\n * @disk: device the partition belongs to\n * @part: partition the bootable flag should be set for\n * @bootable: whether to set or unset the bootable flag\n * @error: (out) (optional): place to store error (if any)\n *\n * Returns: whether the @bootable flag was successfully set for @part or not\n *\n * Tech category: %BD_PART_TECH_MBR-%BD_PART_TECH_MODE_MODIFY_PART\n */\ngboolean bd_part_set_part_bootable (const gchar *disk, const gchar *part, gboolean bootable, GError **error) {\n    struct fdisk_context *cxt = NULL;\n    gint part_num = 0;\n    struct fdisk_partition *pa = NULL;\n    gint ret = 0;\n\n    part_num = get_part_num (part, error);\n    if (part_num == -1)\n        return FALSE;\n\n    /* /dev/sda1 is the partition number 0 in libfdisk */\n    part_num--;\n\n    cxt = get_device_context (disk, FALSE, error);\n    if (!cxt)\n        return FALSE;\n\n    ret = fdisk_get_partition (cxt, part_num, &pa);\n    if (ret != 0) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to get partition '%d'.\", part_num);\n        close_context (cxt);\n        return FALSE;\n    }\n\n    ret = fdisk_partition_is_bootable (pa);\n    if ((ret == 1 && bootable) || (ret != 1 && !bootable)) {\n        /* boot flag is already set as desired, no change needed */\n        fdisk_unref_partition (pa);\n        close_context (cxt);\n        return TRUE;\n    }\n\n    ret = fdisk_toggle_partition_flag (cxt, part_num, DOS_FLAG_ACTIVE);\n    if (ret != 0) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to set partition bootable flag: %s\", strerror_l (-ret, c_locale));\n        fdisk_unref_partition (pa);\n        close_context (cxt);\n        return FALSE;\n    }\n\n    if (!write_label (cxt, NULL, disk, FALSE, error)) {\n        fdisk_unref_partition (pa);\n        close_context (cxt);\n        return FALSE;\n    }\n\n    fdisk_unref_partition (pa);\n    close_context (cxt);\n\n    return TRUE;\n}\n\n/**\n * bd_part_set_part_attributes:\n * @disk: device the partition belongs to\n * @part: partition the attributes should be set for\n * @attrs: GPT attributes to set on @part\n * @error: (out) (optional): place to store error (if any)\n *\n * Returns: whether the @attrs GPT attributes were successfully set for @part or not\n *\n * Tech category: %BD_PART_TECH_GPT-%BD_PART_TECH_MODE_MODIFY_PART\n */\ngboolean bd_part_set_part_attributes (const gchar *disk, const gchar *part, guint64 attrs, GError **error) {\n    struct fdisk_context *cxt = NULL;\n    gint part_num = 0;\n    gint ret = 0;\n\n    part_num = get_part_num (part, error);\n    if (part_num == -1)\n        return FALSE;\n\n    /* /dev/sda1 is the partition number 0 in libfdisk */\n    part_num--;\n\n    cxt = get_device_context (disk, FALSE, error);\n    if (!cxt)\n        return FALSE;\n\n    ret = fdisk_gpt_set_partition_attrs (cxt, part_num, attrs);\n    if (ret < 0) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_FAIL,\n                     \"Failed to set GPT attributes: %s\", strerror_l (-ret, c_locale));\n        return FALSE;\n    }\n\n    if (!write_label (cxt, NULL, disk, FALSE, error)) {\n        close_context (cxt);\n        return FALSE;\n    }\n\n    close_context (cxt);\n\n    return TRUE;\n}\n\n/**\n * bd_part_get_part_table_type_str:\n * @type: table type to get string representation for\n * @error: (out) (optional): place to store error (if any)\n *\n * Returns: (transfer none): string representation of @table_type\n *\n * Tech category: the tech according to @type\n */\nconst gchar* bd_part_get_part_table_type_str (BDPartTableType type, GError **error) {\n    if (type >= BD_PART_TABLE_UNDEF) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_INVAL,\n                     \"Invalid partition table type given\");\n        return NULL;\n    }\n\n    return table_type_str[type];\n}\n\n/* string for BD_PART_TYPE_PROTECTED is \"primary\", that's what parted returns... */\nstatic const gchar* const part_types[6] = { \"primary\", \"logical\", \"extended\", \"free\", \"metadata\", \"primary\" };\n\n/**\n * bd_part_get_type_str:\n * @type: type to get string representation for\n * @error: (out) (optional): place to store error (if any)\n *\n * Returns: (transfer none): string representation of @type\n *\n * Tech category: always available\n */\nconst gchar* bd_part_get_type_str (BDPartType type, GError **error) {\n    if (type > BD_PART_TYPE_PROTECTED) {\n        g_set_error (error, BD_PART_ERROR, BD_PART_ERROR_INVAL, \"Invalid partition type given\");\n        return NULL;\n    }\n\n    return part_types[log2i (type) + 1];\n}\n"},
                          "roles": ["analysisTarget",
                                    "tracedFile"]}],
           "results": [{"ruleId": "-Wanalyzer-null-dereference",
                        "taxa": [{"id": "476",
                                  "toolComponent": {"name": "cwe"}}],
                        "properties": {"gcc/analyzer/saved_diagnostic/sm": "malloc",
                                       "gcc/analyzer/saved_diagnostic/ploc": {"enode": 3782},
                                       "gcc/analyzer/saved_diagnostic/var": "l_error.105_2",
                                       "gcc/analyzer/saved_diagnostic/sval": "(struct GError *)0B",
                                       "gcc/analyzer/saved_diagnostic/state": "null",
                                       "gcc/analyzer/saved_diagnostic/idx": 5,
                                       "gcc/analyzer/pending_diagnostic/kind": "null_deref"},
                        "level": "warning",
                        "message": {"text": "dereference of NULL 'l_error'"},
                        "locations": [{"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                 "uriBaseId": "PWD"},
                                                            "region": {"startLine": 1367,
                                                                       "startColumn": 48,
                                                                       "endColumn": 64},
                                                            "contextRegion": {"startLine": 1367,
                                                                              "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                       "logicalLocations": [{"index": 0,
                                                             "fullyQualifiedName": "bd_part_delete_part"}]}],
                        "codeFlows": [{"threadFlows": [{"id": "main",
                                                        "locations": [{"properties": {"gcc/analyzer/checker_event/emission_id": "(1)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1352,
                                                                                                                    "startColumn": 10,
                                                                                                                    "endColumn": 29},
                                                                                                         "contextRegion": {"startLine": 1352,
                                                                                                                           "snippet": {"text": "gboolean bd_part_delete_part (const gchar *disk, const gchar *part, GError **error) {\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "bd_part_delete_part"}],
                                                                                    "message": {"text": "entry to 'bd_part_delete_part'"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 1},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(2)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1359,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 20},
                                                                                                         "contextRegion": {"startLine": 1359,
                                                                                                                           "snippet": {"text": "    GError *l_error = NULL;\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "bd_part_delete_part"}],
                                                                                    "message": {"text": "'l_error' is NULL"}},
                                                                       "kinds": ["release",
                                                                                 "memory"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 2},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(3)",
                                                                                      "gcc/analyzer/checker_event/kind": "call",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 972,
                                                                                                                                 "dst_id": 973}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1365,
                                                                                                                    "startColumn": 16,
                                                                                                                    "endColumn": 45},
                                                                                                         "contextRegion": {"startLine": 1365,
                                                                                                                           "snippet": {"text": "    part_num = get_part_num (part, &l_error);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "bd_part_delete_part"}],
                                                                                    "message": {"text": "calling 'get_part_num' from 'bd_part_delete_part'"}},
                                                                       "kinds": ["call",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 3},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(4)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 135,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 25},
                                                                                                         "contextRegion": {"startLine": 135,
                                                                                                                           "snippet": {"text": "static gint get_part_num (const gchar *part, GError **error) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "entry to 'get_part_num'"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 4},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(5)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_consolidated_cfg_edges"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 139,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 139,
                                                                                                                           "snippet": {"text": "    if (!part || *part == '\\0') {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 5},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(6)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_consolidated_cfg_edges"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 145,
                                                                                                                    "startColumn": 28,
                                                                                                                    "endColumn": 41},
                                                                                                         "contextRegion": {"startLine": 145,
                                                                                                                           "snippet": {"text": "    part_num_str = part + (strlen (part) - 1);\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 6},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(7)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2539,
                                                                                                                                 "dst_id": 2543}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 152,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 152,
                                                                                                                           "snippet": {"text": "    if (part_num == 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 7},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(8)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2539,
                                                                                                                                 "dst_id": 2543}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 156,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 156,
                                                                                                                           "snippet": {"text": "    } else if (part_num < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 8},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(9)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2543,
                                                                                                                                 "dst_id": 2544}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 156,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 156,
                                                                                                                           "snippet": {"text": "    } else if (part_num < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 9},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(10)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2543,
                                                                                                                                 "dst_id": 2544}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 156,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 156,
                                                                                                                           "snippet": {"text": "    } else if (part_num < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 10},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(11)",
                                                                                      "gcc/analyzer/checker_event/kind": "return"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1365,
                                                                                                                    "startColumn": 16,
                                                                                                                    "endColumn": 45},
                                                                                                         "contextRegion": {"startLine": 1365,
                                                                                                                           "snippet": {"text": "    part_num = get_part_num (part, &l_error);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "bd_part_delete_part"}],
                                                                                    "message": {"text": "returning to 'bd_part_delete_part' from 'get_part_num'"}},
                                                                       "kinds": ["return",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 11},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(12)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 973,
                                                                                                                                 "dst_id": 974}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1366,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 1366,
                                                                                                                           "snippet": {"text": "    if (part_num == -1) {\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "bd_part_delete_part"}],
                                                                                    "message": {"text": "following 'true' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 12},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(13)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 973,
                                                                                                                                 "dst_id": 974}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1367,
                                                                                                                    "startColumn": 55,
                                                                                                                    "endColumn": 57},
                                                                                                         "contextRegion": {"startLine": 1367,
                                                                                                                           "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "bd_part_delete_part"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 13},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(14)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1367,
                                                                                                                    "startColumn": 55,
                                                                                                                    "endColumn": 57},
                                                                                                         "contextRegion": {"startLine": 1367,
                                                                                                                           "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "bd_part_delete_part"}],
                                                                                    "message": {"text": "'l_error' is NULL"}},
                                                                       "kinds": ["release",
                                                                                 "memory"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 14},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(15)",
                                                                                      "gcc/analyzer/checker_event/kind": "warning"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1367,
                                                                                                                    "startColumn": 48,
                                                                                                                    "endColumn": 64},
                                                                                                         "contextRegion": {"startLine": 1367,
                                                                                                                           "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "bd_part_delete_part"}],
                                                                                    "message": {"text": "dereference of NULL 'l_error'"}},
                                                                       "kinds": ["danger"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 15}]}]}]},
                       {"ruleId": "-Wanalyzer-null-dereference",
                        "taxa": [{"id": "476",
                                  "toolComponent": {"name": "cwe"}}],
                        "properties": {"gcc/analyzer/saved_diagnostic/sm": "malloc",
                                       "gcc/analyzer/saved_diagnostic/ploc": {"enode": 2763},
                                       "gcc/analyzer/saved_diagnostic/var": "l_error.121_2",
                                       "gcc/analyzer/saved_diagnostic/sval": "(struct GError *)0B",
                                       "gcc/analyzer/saved_diagnostic/state": "null",
                                       "gcc/analyzer/saved_diagnostic/idx": 4,
                                       "gcc/analyzer/pending_diagnostic/kind": "null_deref"},
                        "level": "warning",
                        "message": {"text": "dereference of NULL 'l_error'"},
                        "locations": [{"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                 "uriBaseId": "PWD"},
                                                            "region": {"startLine": 1529,
                                                                       "startColumn": 48,
                                                                       "endColumn": 64},
                                                            "contextRegion": {"startLine": 1529,
                                                                              "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                       "logicalLocations": [{"index": 2,
                                                             "fullyQualifiedName": "bd_part_resize_part"}]}],
                        "codeFlows": [{"threadFlows": [{"id": "main",
                                                        "locations": [{"properties": {"gcc/analyzer/checker_event/emission_id": "(1)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1506,
                                                                                                                    "startColumn": 10,
                                                                                                                    "endColumn": 29},
                                                                                                         "contextRegion": {"startLine": 1506,
                                                                                                                           "snippet": {"text": "gboolean bd_part_resize_part (const gchar *disk, const gchar *part, guint64 size, BDPartAlign align, GError **error) {\n"}}},
                                                                                    "logicalLocations": [{"index": 2,
                                                                                                          "fullyQualifiedName": "bd_part_resize_part"}],
                                                                                    "message": {"text": "entry to 'bd_part_resize_part'"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 1},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(2)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1521,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 20},
                                                                                                         "contextRegion": {"startLine": 1521,
                                                                                                                           "snippet": {"text": "    GError *l_error = NULL;\n"}}},
                                                                                    "logicalLocations": [{"index": 2,
                                                                                                          "fullyQualifiedName": "bd_part_resize_part"}],
                                                                                    "message": {"text": "'l_error' is NULL"}},
                                                                       "kinds": ["release",
                                                                                 "memory"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 2},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(3)",
                                                                                      "gcc/analyzer/checker_event/kind": "call",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 579,
                                                                                                                                 "dst_id": 580}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1527,
                                                                                                                    "startColumn": 16,
                                                                                                                    "endColumn": 45},
                                                                                                         "contextRegion": {"startLine": 1527,
                                                                                                                           "snippet": {"text": "    part_num = get_part_num (part, &l_error);\n"}}},
                                                                                    "logicalLocations": [{"index": 2,
                                                                                                          "fullyQualifiedName": "bd_part_resize_part"}],
                                                                                    "message": {"text": "calling 'get_part_num' from 'bd_part_resize_part'"}},
                                                                       "kinds": ["call",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 3},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(4)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 135,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 25},
                                                                                                         "contextRegion": {"startLine": 135,
                                                                                                                           "snippet": {"text": "static gint get_part_num (const gchar *part, GError **error) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "entry to 'get_part_num'"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 4},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(5)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_consolidated_cfg_edges"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 139,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 139,
                                                                                                                           "snippet": {"text": "    if (!part || *part == '\\0') {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 5},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(6)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_consolidated_cfg_edges"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 145,
                                                                                                                    "startColumn": 28,
                                                                                                                    "endColumn": 41},
                                                                                                         "contextRegion": {"startLine": 145,
                                                                                                                           "snippet": {"text": "    part_num_str = part + (strlen (part) - 1);\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 6},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(7)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2539,
                                                                                                                                 "dst_id": 2543}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 152,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 152,
                                                                                                                           "snippet": {"text": "    if (part_num == 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 7},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(8)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2539,
                                                                                                                                 "dst_id": 2543}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 156,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 156,
                                                                                                                           "snippet": {"text": "    } else if (part_num < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 8},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(9)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2543,
                                                                                                                                 "dst_id": 2544}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 156,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 156,
                                                                                                                           "snippet": {"text": "    } else if (part_num < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 9},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(10)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2543,
                                                                                                                                 "dst_id": 2544}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 156,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 156,
                                                                                                                           "snippet": {"text": "    } else if (part_num < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 10},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(11)",
                                                                                      "gcc/analyzer/checker_event/kind": "return"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1527,
                                                                                                                    "startColumn": 16,
                                                                                                                    "endColumn": 45},
                                                                                                         "contextRegion": {"startLine": 1527,
                                                                                                                           "snippet": {"text": "    part_num = get_part_num (part, &l_error);\n"}}},
                                                                                    "logicalLocations": [{"index": 2,
                                                                                                          "fullyQualifiedName": "bd_part_resize_part"}],
                                                                                    "message": {"text": "returning to 'bd_part_resize_part' from 'get_part_num'"}},
                                                                       "kinds": ["return",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 11},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(12)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 580,
                                                                                                                                 "dst_id": 581}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1528,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 1528,
                                                                                                                           "snippet": {"text": "    if (part_num == -1) {\n"}}},
                                                                                    "logicalLocations": [{"index": 2,
                                                                                                          "fullyQualifiedName": "bd_part_resize_part"}],
                                                                                    "message": {"text": "following 'true' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 12},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(13)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 580,
                                                                                                                                 "dst_id": 581}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1529,
                                                                                                                    "startColumn": 55,
                                                                                                                    "endColumn": 57},
                                                                                                         "contextRegion": {"startLine": 1529,
                                                                                                                           "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                                                                    "logicalLocations": [{"index": 2,
                                                                                                          "fullyQualifiedName": "bd_part_resize_part"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 13},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(14)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1529,
                                                                                                                    "startColumn": 55,
                                                                                                                    "endColumn": 57},
                                                                                                         "contextRegion": {"startLine": 1529,
                                                                                                                           "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                                                                    "logicalLocations": [{"index": 2,
                                                                                                          "fullyQualifiedName": "bd_part_resize_part"}],
                                                                                    "message": {"text": "'l_error' is NULL"}},
                                                                       "kinds": ["release",
                                                                                 "memory"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 14},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(15)",
                                                                                      "gcc/analyzer/checker_event/kind": "warning"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1529,
                                                                                                                    "startColumn": 48,
                                                                                                                    "endColumn": 64},
                                                                                                         "contextRegion": {"startLine": 1529,
                                                                                                                           "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                                                                    "logicalLocations": [{"index": 2,
                                                                                                          "fullyQualifiedName": "bd_part_resize_part"}],
                                                                                    "message": {"text": "dereference of NULL 'l_error'"}},
                                                                       "kinds": ["danger"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 15}]}]}]},
                       {"ruleId": "-Wanalyzer-null-dereference",
                        "taxa": [{"id": "476",
                                  "toolComponent": {"name": "cwe"}}],
                        "properties": {"gcc/analyzer/saved_diagnostic/sm": "malloc",
                                       "gcc/analyzer/saved_diagnostic/ploc": {"enode": 2284},
                                       "gcc/analyzer/saved_diagnostic/var": "l_error.202_9",
                                       "gcc/analyzer/saved_diagnostic/sval": "(struct GError *)0B",
                                       "gcc/analyzer/saved_diagnostic/state": "null",
                                       "gcc/analyzer/saved_diagnostic/idx": 3,
                                       "gcc/analyzer/pending_diagnostic/kind": "null_deref"},
                        "level": "warning",
                        "message": {"text": "dereference of NULL 'l_error'"},
                        "locations": [{"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                 "uriBaseId": "PWD"},
                                                            "region": {"startLine": 1845,
                                                                       "startColumn": 48,
                                                                       "endColumn": 64},
                                                            "contextRegion": {"startLine": 1845,
                                                                              "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                       "logicalLocations": [{"index": 3,
                                                             "fullyQualifiedName": "bd_part_set_part_name"}]}],
                        "codeFlows": [{"threadFlows": [{"id": "main",
                                                        "locations": [{"properties": {"gcc/analyzer/checker_event/emission_id": "(1)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1800,
                                                                                                                    "startColumn": 10,
                                                                                                                    "endColumn": 31},
                                                                                                         "contextRegion": {"startLine": 1800,
                                                                                                                           "snippet": {"text": "gboolean bd_part_set_part_name (const gchar *disk, const gchar *part, const gchar *name, GError **error) {\n"}}},
                                                                                    "logicalLocations": [{"index": 3,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_name"}],
                                                                                    "message": {"text": "entry to 'bd_part_set_part_name'"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 1},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(2)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1809,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 20},
                                                                                                         "contextRegion": {"startLine": 1809,
                                                                                                                           "snippet": {"text": "    GError *l_error = NULL;\n"}}},
                                                                                    "logicalLocations": [{"index": 3,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_name"}],
                                                                                    "message": {"text": "'l_error' is NULL"}},
                                                                       "kinds": ["release",
                                                                                 "memory"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 2},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(3)",
                                                                                      "gcc/analyzer/checker_event/kind": "call",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 380,
                                                                                                                                 "dst_id": 381}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1815,
                                                                                                                    "startColumn": 11,
                                                                                                                    "endColumn": 50},
                                                                                                         "contextRegion": {"startLine": 1815,
                                                                                                                           "snippet": {"text": "    cxt = get_device_context (disk, FALSE, error);\n"}}},
                                                                                    "logicalLocations": [{"index": 3,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_name"}],
                                                                                    "message": {"text": "calling 'get_device_context' from 'bd_part_set_part_name'"}},
                                                                       "kinds": ["call",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 3},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(4)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 192,
                                                                                                                    "startColumn": 30,
                                                                                                                    "endColumn": 48},
                                                                                                         "contextRegion": {"startLine": 192,
                                                                                                                           "snippet": {"text": "static struct fdisk_context* get_device_context (const gchar *disk, gboolean read_only, GError **error) {\n"}}},
                                                                                    "logicalLocations": [{"index": 4,
                                                                                                          "fullyQualifiedName": "get_device_context"}],
                                                                                    "message": {"text": "entry to 'get_device_context'"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 4},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(5)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2455,
                                                                                                                                 "dst_id": 2459}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 196,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 196,
                                                                                                                           "snippet": {"text": "    if (!cxt) {\n"}}},
                                                                                    "logicalLocations": [{"index": 4,
                                                                                                          "fullyQualifiedName": "get_device_context"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 5},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(6)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2455,
                                                                                                                                 "dst_id": 2459}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 202,
                                                                                                                    "startColumn": 11,
                                                                                                                    "endColumn": 53},
                                                                                                         "contextRegion": {"startLine": 202,
                                                                                                                           "snippet": {"text": "    ret = fdisk_assign_device (cxt, disk, read_only);\n"}}},
                                                                                    "logicalLocations": [{"index": 4,
                                                                                                          "fullyQualifiedName": "get_device_context"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 6},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(7)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2460,
                                                                                                                                 "dst_id": 2468}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 203,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 203,
                                                                                                                           "snippet": {"text": "    if (ret != 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 4,
                                                                                                          "fullyQualifiedName": "get_device_context"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 7},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(8)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2460,
                                                                                                                                 "dst_id": 2468}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 210,
                                                                                                                    "startColumn": 5,
                                                                                                                    "endColumn": 35},
                                                                                                         "contextRegion": {"startLine": 210,
                                                                                                                           "snippet": {"text": "    fdisk_disable_dialogs (cxt, 1);\n"}}},
                                                                                    "logicalLocations": [{"index": 4,
                                                                                                          "fullyQualifiedName": "get_device_context"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 8},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(9)",
                                                                                      "gcc/analyzer/checker_event/kind": "return"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1815,
                                                                                                                    "startColumn": 11,
                                                                                                                    "endColumn": 50},
                                                                                                         "contextRegion": {"startLine": 1815,
                                                                                                                           "snippet": {"text": "    cxt = get_device_context (disk, FALSE, error);\n"}}},
                                                                                    "logicalLocations": [{"index": 3,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_name"}],
                                                                                    "message": {"text": "returning to 'bd_part_set_part_name' from 'get_device_context'"}},
                                                                       "kinds": ["return",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 9},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(10)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 381,
                                                                                                                                 "dst_id": 383}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1816,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 1816,
                                                                                                                           "snippet": {"text": "    if (!cxt) {\n"}}},
                                                                                    "logicalLocations": [{"index": 3,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_name"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 10},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(11)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 381,
                                                                                                                                 "dst_id": 383}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1821,
                                                                                                                    "startColumn": 10,
                                                                                                                    "endColumn": 37},
                                                                                                         "contextRegion": {"startLine": 1821,
                                                                                                                           "snippet": {"text": "    lb = fdisk_get_label (cxt, NULL);\n"}}},
                                                                                    "logicalLocations": [{"index": 3,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_name"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 11},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(12)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 384,
                                                                                                                                 "dst_id": 394}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1822,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 1822,
                                                                                                                           "snippet": {"text": "    if (!lb) {\n"}}},
                                                                                    "logicalLocations": [{"index": 3,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_name"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 12},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(13)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 384,
                                                                                                                                 "dst_id": 394}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1831,
                                                                                                                    "startColumn": 18,
                                                                                                                    "endColumn": 43},
                                                                                                         "contextRegion": {"startLine": 1831,
                                                                                                                           "snippet": {"text": "    label_name = fdisk_label_get_name (lb);\n"}}},
                                                                                    "logicalLocations": [{"index": 3,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_name"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 13},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(14)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 397,
                                                                                                                                 "dst_id": 407}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1832,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 1832,
                                                                                                                           "snippet": {"text": "    if (g_strcmp0 (label_name, table_type_str[BD_PART_TABLE_GPT]) != 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 3,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_name"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 14},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(15)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 397,
                                                                                                                                 "dst_id": 407}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1842,
                                                                                                                    "startColumn": 16,
                                                                                                                    "endColumn": 45},
                                                                                                         "contextRegion": {"startLine": 1842,
                                                                                                                           "snippet": {"text": "    part_num = get_part_num (part, &l_error);\n"}}},
                                                                                    "logicalLocations": [{"index": 3,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_name"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 15},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(16)",
                                                                                      "gcc/analyzer/checker_event/kind": "call",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 407,
                                                                                                                                 "dst_id": 408}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1842,
                                                                                                                    "startColumn": 16,
                                                                                                                    "endColumn": 45},
                                                                                                         "contextRegion": {"startLine": 1842,
                                                                                                                           "snippet": {"text": "    part_num = get_part_num (part, &l_error);\n"}}},
                                                                                    "logicalLocations": [{"index": 3,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_name"}],
                                                                                    "message": {"text": "calling 'get_part_num' from 'bd_part_set_part_name'"}},
                                                                       "kinds": ["call",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 16},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(17)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 135,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 25},
                                                                                                         "contextRegion": {"startLine": 135,
                                                                                                                           "snippet": {"text": "static gint get_part_num (const gchar *part, GError **error) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "entry to 'get_part_num'"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 17},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(18)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_consolidated_cfg_edges"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 139,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 139,
                                                                                                                           "snippet": {"text": "    if (!part || *part == '\\0') {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 18},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(19)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_consolidated_cfg_edges"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 145,
                                                                                                                    "startColumn": 28,
                                                                                                                    "endColumn": 41},
                                                                                                         "contextRegion": {"startLine": 145,
                                                                                                                           "snippet": {"text": "    part_num_str = part + (strlen (part) - 1);\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 19},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(20)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2539,
                                                                                                                                 "dst_id": 2543}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 152,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 152,
                                                                                                                           "snippet": {"text": "    if (part_num == 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 20},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(21)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2539,
                                                                                                                                 "dst_id": 2543}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 156,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 156,
                                                                                                                           "snippet": {"text": "    } else if (part_num < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 21},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(22)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2543,
                                                                                                                                 "dst_id": 2544}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 156,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 156,
                                                                                                                           "snippet": {"text": "    } else if (part_num < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 22},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(23)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2543,
                                                                                                                                 "dst_id": 2544}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 156,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 156,
                                                                                                                           "snippet": {"text": "    } else if (part_num < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 23},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(24)",
                                                                                      "gcc/analyzer/checker_event/kind": "return"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1842,
                                                                                                                    "startColumn": 16,
                                                                                                                    "endColumn": 45},
                                                                                                         "contextRegion": {"startLine": 1842,
                                                                                                                           "snippet": {"text": "    part_num = get_part_num (part, &l_error);\n"}}},
                                                                                    "logicalLocations": [{"index": 3,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_name"}],
                                                                                    "message": {"text": "returning to 'bd_part_set_part_name' from 'get_part_num'"}},
                                                                       "kinds": ["return",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 24},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(25)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 408,
                                                                                                                                 "dst_id": 409}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1843,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 1843,
                                                                                                                           "snippet": {"text": "    if (part_num == -1) {\n"}}},
                                                                                    "logicalLocations": [{"index": 3,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_name"}],
                                                                                    "message": {"text": "following 'true' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 25},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(26)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 408,
                                                                                                                                 "dst_id": 409}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1844,
                                                                                                                    "startColumn": 9,
                                                                                                                    "endColumn": 28},
                                                                                                         "contextRegion": {"startLine": 1844,
                                                                                                                           "snippet": {"text": "        close_context (cxt);\n"}}},
                                                                                    "logicalLocations": [{"index": 3,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_name"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 26},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(27)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1845,
                                                                                                                    "startColumn": 55,
                                                                                                                    "endColumn": 57},
                                                                                                         "contextRegion": {"startLine": 1845,
                                                                                                                           "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                                                                    "logicalLocations": [{"index": 3,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_name"}],
                                                                                    "message": {"text": "'l_error' is NULL"}},
                                                                       "kinds": ["release",
                                                                                 "memory"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 27},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(28)",
                                                                                      "gcc/analyzer/checker_event/kind": "warning"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1845,
                                                                                                                    "startColumn": 48,
                                                                                                                    "endColumn": 64},
                                                                                                         "contextRegion": {"startLine": 1845,
                                                                                                                           "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                                                                    "logicalLocations": [{"index": 3,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_name"}],
                                                                                    "message": {"text": "dereference of NULL 'l_error'"}},
                                                                       "kinds": ["danger"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 28}]}]}]},
                       {"ruleId": "-Wanalyzer-null-dereference",
                        "taxa": [{"id": "476",
                                  "toolComponent": {"name": "cwe"}}],
                        "properties": {"gcc/analyzer/saved_diagnostic/sm": "malloc",
                                       "gcc/analyzer/saved_diagnostic/ploc": {"enode": 1754},
                                       "gcc/analyzer/saved_diagnostic/var": "l_error.220_2",
                                       "gcc/analyzer/saved_diagnostic/sval": "(struct GError *)0B",
                                       "gcc/analyzer/saved_diagnostic/state": "null",
                                       "gcc/analyzer/saved_diagnostic/idx": 2,
                                       "gcc/analyzer/pending_diagnostic/kind": "null_deref"},
                        "level": "warning",
                        "message": {"text": "dereference of NULL 'l_error'"},
                        "locations": [{"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                 "uriBaseId": "PWD"},
                                                            "region": {"startLine": 1926,
                                                                       "startColumn": 48,
                                                                       "endColumn": 64},
                                                            "contextRegion": {"startLine": 1926,
                                                                              "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                       "logicalLocations": [{"index": 5,
                                                             "fullyQualifiedName": "bd_part_set_part_type"}]}],
                        "codeFlows": [{"threadFlows": [{"id": "main",
                                                        "locations": [{"properties": {"gcc/analyzer/checker_event/emission_id": "(1)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1913,
                                                                                                                    "startColumn": 10,
                                                                                                                    "endColumn": 31},
                                                                                                         "contextRegion": {"startLine": 1913,
                                                                                                                           "snippet": {"text": "gboolean bd_part_set_part_type (const gchar *disk, const gchar *part, const gchar *type_guid, GError **error) {\n"}}},
                                                                                    "logicalLocations": [{"index": 5,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_type"}],
                                                                                    "message": {"text": "entry to 'bd_part_set_part_type'"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 1},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(2)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1918,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 20},
                                                                                                         "contextRegion": {"startLine": 1918,
                                                                                                                           "snippet": {"text": "    GError *l_error = NULL;\n"}}},
                                                                                    "logicalLocations": [{"index": 5,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_type"}],
                                                                                    "message": {"text": "'l_error' is NULL"}},
                                                                       "kinds": ["release",
                                                                                 "memory"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 2},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(3)",
                                                                                      "gcc/analyzer/checker_event/kind": "call",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 320,
                                                                                                                                 "dst_id": 321}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1924,
                                                                                                                    "startColumn": 16,
                                                                                                                    "endColumn": 45},
                                                                                                         "contextRegion": {"startLine": 1924,
                                                                                                                           "snippet": {"text": "    part_num = get_part_num (part, &l_error);\n"}}},
                                                                                    "logicalLocations": [{"index": 5,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_type"}],
                                                                                    "message": {"text": "calling 'get_part_num' from 'bd_part_set_part_type'"}},
                                                                       "kinds": ["call",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 3},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(4)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 135,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 25},
                                                                                                         "contextRegion": {"startLine": 135,
                                                                                                                           "snippet": {"text": "static gint get_part_num (const gchar *part, GError **error) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "entry to 'get_part_num'"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 4},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(5)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_consolidated_cfg_edges"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 139,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 139,
                                                                                                                           "snippet": {"text": "    if (!part || *part == '\\0') {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 5},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(6)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_consolidated_cfg_edges"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 145,
                                                                                                                    "startColumn": 28,
                                                                                                                    "endColumn": 41},
                                                                                                         "contextRegion": {"startLine": 145,
                                                                                                                           "snippet": {"text": "    part_num_str = part + (strlen (part) - 1);\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 6},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(7)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2539,
                                                                                                                                 "dst_id": 2543}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 152,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 152,
                                                                                                                           "snippet": {"text": "    if (part_num == 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 7},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(8)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2539,
                                                                                                                                 "dst_id": 2543}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 156,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 156,
                                                                                                                           "snippet": {"text": "    } else if (part_num < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 8},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(9)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2543,
                                                                                                                                 "dst_id": 2544}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 156,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 156,
                                                                                                                           "snippet": {"text": "    } else if (part_num < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 9},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(10)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2543,
                                                                                                                                 "dst_id": 2544}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 156,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 156,
                                                                                                                           "snippet": {"text": "    } else if (part_num < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 10},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(11)",
                                                                                      "gcc/analyzer/checker_event/kind": "return"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1924,
                                                                                                                    "startColumn": 16,
                                                                                                                    "endColumn": 45},
                                                                                                         "contextRegion": {"startLine": 1924,
                                                                                                                           "snippet": {"text": "    part_num = get_part_num (part, &l_error);\n"}}},
                                                                                    "logicalLocations": [{"index": 5,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_type"}],
                                                                                    "message": {"text": "returning to 'bd_part_set_part_type' from 'get_part_num'"}},
                                                                       "kinds": ["return",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 11},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(12)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 321,
                                                                                                                                 "dst_id": 322}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1925,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 1925,
                                                                                                                           "snippet": {"text": "    if (part_num == -1) {\n"}}},
                                                                                    "logicalLocations": [{"index": 5,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_type"}],
                                                                                    "message": {"text": "following 'true' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 12},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(13)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 321,
                                                                                                                                 "dst_id": 322}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1926,
                                                                                                                    "startColumn": 55,
                                                                                                                    "endColumn": 57},
                                                                                                         "contextRegion": {"startLine": 1926,
                                                                                                                           "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                                                                    "logicalLocations": [{"index": 5,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_type"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 13},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(14)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1926,
                                                                                                                    "startColumn": 55,
                                                                                                                    "endColumn": 57},
                                                                                                         "contextRegion": {"startLine": 1926,
                                                                                                                           "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                                                                    "logicalLocations": [{"index": 5,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_type"}],
                                                                                    "message": {"text": "'l_error' is NULL"}},
                                                                       "kinds": ["release",
                                                                                 "memory"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 14},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(15)",
                                                                                      "gcc/analyzer/checker_event/kind": "warning"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1926,
                                                                                                                    "startColumn": 48,
                                                                                                                    "endColumn": 64},
                                                                                                         "contextRegion": {"startLine": 1926,
                                                                                                                           "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                                                                    "logicalLocations": [{"index": 5,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_type"}],
                                                                                    "message": {"text": "dereference of NULL 'l_error'"}},
                                                                       "kinds": ["danger"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 15}]}]}]},
                       {"ruleId": "-Wanalyzer-null-dereference",
                        "taxa": [{"id": "476",
                                  "toolComponent": {"name": "cwe"}}],
                        "properties": {"gcc/analyzer/saved_diagnostic/sm": "malloc",
                                       "gcc/analyzer/saved_diagnostic/ploc": {"enode": 1317},
                                       "gcc/analyzer/saved_diagnostic/var": "l_error.231_2",
                                       "gcc/analyzer/saved_diagnostic/sval": "(struct GError *)0B",
                                       "gcc/analyzer/saved_diagnostic/state": "null",
                                       "gcc/analyzer/saved_diagnostic/idx": 1,
                                       "gcc/analyzer/pending_diagnostic/kind": "null_deref"},
                        "level": "warning",
                        "message": {"text": "dereference of NULL 'l_error'"},
                        "locations": [{"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                 "uriBaseId": "PWD"},
                                                            "region": {"startLine": 1985,
                                                                       "startColumn": 48,
                                                                       "endColumn": 64},
                                                            "contextRegion": {"startLine": 1985,
                                                                              "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                       "logicalLocations": [{"index": 6,
                                                             "fullyQualifiedName": "bd_part_set_part_id"}]}],
                        "codeFlows": [{"threadFlows": [{"id": "main",
                                                        "locations": [{"properties": {"gcc/analyzer/checker_event/emission_id": "(1)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1972,
                                                                                                                    "startColumn": 10,
                                                                                                                    "endColumn": 29},
                                                                                                         "contextRegion": {"startLine": 1972,
                                                                                                                           "snippet": {"text": "gboolean bd_part_set_part_id (const gchar *disk, const gchar *part, const gchar *part_id, GError **error) {\n"}}},
                                                                                    "logicalLocations": [{"index": 6,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_id"}],
                                                                                    "message": {"text": "entry to 'bd_part_set_part_id'"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 1},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(2)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1977,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 20},
                                                                                                         "contextRegion": {"startLine": 1977,
                                                                                                                           "snippet": {"text": "    GError *l_error = NULL;\n"}}},
                                                                                    "logicalLocations": [{"index": 6,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_id"}],
                                                                                    "message": {"text": "'l_error' is NULL"}},
                                                                       "kinds": ["release",
                                                                                 "memory"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 2},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(3)",
                                                                                      "gcc/analyzer/checker_event/kind": "call",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 261,
                                                                                                                                 "dst_id": 262}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1983,
                                                                                                                    "startColumn": 16,
                                                                                                                    "endColumn": 45},
                                                                                                         "contextRegion": {"startLine": 1983,
                                                                                                                           "snippet": {"text": "    part_num = get_part_num (part, &l_error);\n"}}},
                                                                                    "logicalLocations": [{"index": 6,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_id"}],
                                                                                    "message": {"text": "calling 'get_part_num' from 'bd_part_set_part_id'"}},
                                                                       "kinds": ["call",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 3},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(4)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 135,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 25},
                                                                                                         "contextRegion": {"startLine": 135,
                                                                                                                           "snippet": {"text": "static gint get_part_num (const gchar *part, GError **error) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "entry to 'get_part_num'"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 4},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(5)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_consolidated_cfg_edges"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 139,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 139,
                                                                                                                           "snippet": {"text": "    if (!part || *part == '\\0') {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 5},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(6)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_consolidated_cfg_edges"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 145,
                                                                                                                    "startColumn": 28,
                                                                                                                    "endColumn": 41},
                                                                                                         "contextRegion": {"startLine": 145,
                                                                                                                           "snippet": {"text": "    part_num_str = part + (strlen (part) - 1);\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 6},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(7)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2539,
                                                                                                                                 "dst_id": 2543}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 152,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 152,
                                                                                                                           "snippet": {"text": "    if (part_num == 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 7},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(8)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2539,
                                                                                                                                 "dst_id": 2543}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 156,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 156,
                                                                                                                           "snippet": {"text": "    } else if (part_num < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 8},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(9)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2543,
                                                                                                                                 "dst_id": 2544}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 156,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 156,
                                                                                                                           "snippet": {"text": "    } else if (part_num < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 9},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(10)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2543,
                                                                                                                                 "dst_id": 2544}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 156,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 156,
                                                                                                                           "snippet": {"text": "    } else if (part_num < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 10},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(11)",
                                                                                      "gcc/analyzer/checker_event/kind": "return"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1983,
                                                                                                                    "startColumn": 16,
                                                                                                                    "endColumn": 45},
                                                                                                         "contextRegion": {"startLine": 1983,
                                                                                                                           "snippet": {"text": "    part_num = get_part_num (part, &l_error);\n"}}},
                                                                                    "logicalLocations": [{"index": 6,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_id"}],
                                                                                    "message": {"text": "returning to 'bd_part_set_part_id' from 'get_part_num'"}},
                                                                       "kinds": ["return",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 11},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(12)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 262,
                                                                                                                                 "dst_id": 263}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1984,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 1984,
                                                                                                                           "snippet": {"text": "    if (part_num == -1) {\n"}}},
                                                                                    "logicalLocations": [{"index": 6,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_id"}],
                                                                                    "message": {"text": "following 'true' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 12},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(13)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 262,
                                                                                                                                 "dst_id": 263}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1985,
                                                                                                                    "startColumn": 55,
                                                                                                                    "endColumn": 57},
                                                                                                         "contextRegion": {"startLine": 1985,
                                                                                                                           "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                                                                    "logicalLocations": [{"index": 6,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_id"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 13},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(14)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1985,
                                                                                                                    "startColumn": 55,
                                                                                                                    "endColumn": 57},
                                                                                                         "contextRegion": {"startLine": 1985,
                                                                                                                           "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                                                                    "logicalLocations": [{"index": 6,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_id"}],
                                                                                    "message": {"text": "'l_error' is NULL"}},
                                                                       "kinds": ["release",
                                                                                 "memory"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 14},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(15)",
                                                                                      "gcc/analyzer/checker_event/kind": "warning"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 1985,
                                                                                                                    "startColumn": 48,
                                                                                                                    "endColumn": 64},
                                                                                                         "contextRegion": {"startLine": 1985,
                                                                                                                           "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                                                                    "logicalLocations": [{"index": 6,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_id"}],
                                                                                    "message": {"text": "dereference of NULL 'l_error'"}},
                                                                       "kinds": ["danger"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 15}]}]}]},
                       {"ruleId": "-Wanalyzer-null-dereference",
                        "taxa": [{"id": "476",
                                  "toolComponent": {"name": "cwe"}}],
                        "properties": {"gcc/analyzer/saved_diagnostic/sm": "malloc",
                                       "gcc/analyzer/saved_diagnostic/ploc": {"enode": 945},
                                       "gcc/analyzer/saved_diagnostic/var": "l_error.243_9",
                                       "gcc/analyzer/saved_diagnostic/sval": "(struct GError *)0B",
                                       "gcc/analyzer/saved_diagnostic/state": "null",
                                       "gcc/analyzer/saved_diagnostic/idx": 0,
                                       "gcc/analyzer/pending_diagnostic/kind": "null_deref"},
                        "level": "warning",
                        "message": {"text": "dereference of NULL 'l_error'"},
                        "locations": [{"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                 "uriBaseId": "PWD"},
                                                            "region": {"startLine": 2076,
                                                                       "startColumn": 48,
                                                                       "endColumn": 64},
                                                            "contextRegion": {"startLine": 2076,
                                                                              "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                       "logicalLocations": [{"index": 7,
                                                             "fullyQualifiedName": "bd_part_set_part_uuid"}]}],
                        "codeFlows": [{"threadFlows": [{"id": "main",
                                                        "locations": [{"properties": {"gcc/analyzer/checker_event/emission_id": "(1)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 2031,
                                                                                                                    "startColumn": 10,
                                                                                                                    "endColumn": 31},
                                                                                                         "contextRegion": {"startLine": 2031,
                                                                                                                           "snippet": {"text": "gboolean bd_part_set_part_uuid (const gchar *disk, const gchar *part, const gchar *uuid, GError **error) {\n"}}},
                                                                                    "logicalLocations": [{"index": 7,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_uuid"}],
                                                                                    "message": {"text": "entry to 'bd_part_set_part_uuid'"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 1},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(2)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 2040,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 20},
                                                                                                         "contextRegion": {"startLine": 2040,
                                                                                                                           "snippet": {"text": "    GError *l_error = NULL;\n"}}},
                                                                                    "logicalLocations": [{"index": 7,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_uuid"}],
                                                                                    "message": {"text": "'l_error' is NULL"}},
                                                                       "kinds": ["release",
                                                                                 "memory"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 2},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(3)",
                                                                                      "gcc/analyzer/checker_event/kind": "call",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 135,
                                                                                                                                 "dst_id": 136}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 2046,
                                                                                                                    "startColumn": 11,
                                                                                                                    "endColumn": 50},
                                                                                                         "contextRegion": {"startLine": 2046,
                                                                                                                           "snippet": {"text": "    cxt = get_device_context (disk, FALSE, error);\n"}}},
                                                                                    "logicalLocations": [{"index": 7,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_uuid"}],
                                                                                    "message": {"text": "calling 'get_device_context' from 'bd_part_set_part_uuid'"}},
                                                                       "kinds": ["call",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 3},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(4)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 192,
                                                                                                                    "startColumn": 30,
                                                                                                                    "endColumn": 48},
                                                                                                         "contextRegion": {"startLine": 192,
                                                                                                                           "snippet": {"text": "static struct fdisk_context* get_device_context (const gchar *disk, gboolean read_only, GError **error) {\n"}}},
                                                                                    "logicalLocations": [{"index": 4,
                                                                                                          "fullyQualifiedName": "get_device_context"}],
                                                                                    "message": {"text": "entry to 'get_device_context'"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 4},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(5)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2455,
                                                                                                                                 "dst_id": 2459}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 196,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 196,
                                                                                                                           "snippet": {"text": "    if (!cxt) {\n"}}},
                                                                                    "logicalLocations": [{"index": 4,
                                                                                                          "fullyQualifiedName": "get_device_context"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 5},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(6)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2455,
                                                                                                                                 "dst_id": 2459}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 202,
                                                                                                                    "startColumn": 11,
                                                                                                                    "endColumn": 53},
                                                                                                         "contextRegion": {"startLine": 202,
                                                                                                                           "snippet": {"text": "    ret = fdisk_assign_device (cxt, disk, read_only);\n"}}},
                                                                                    "logicalLocations": [{"index": 4,
                                                                                                          "fullyQualifiedName": "get_device_context"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 6},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(7)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2460,
                                                                                                                                 "dst_id": 2468}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 203,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 203,
                                                                                                                           "snippet": {"text": "    if (ret != 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 4,
                                                                                                          "fullyQualifiedName": "get_device_context"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 7},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(8)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2460,
                                                                                                                                 "dst_id": 2468}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 210,
                                                                                                                    "startColumn": 5,
                                                                                                                    "endColumn": 35},
                                                                                                         "contextRegion": {"startLine": 210,
                                                                                                                           "snippet": {"text": "    fdisk_disable_dialogs (cxt, 1);\n"}}},
                                                                                    "logicalLocations": [{"index": 4,
                                                                                                          "fullyQualifiedName": "get_device_context"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 8},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(9)",
                                                                                      "gcc/analyzer/checker_event/kind": "return"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 2046,
                                                                                                                    "startColumn": 11,
                                                                                                                    "endColumn": 50},
                                                                                                         "contextRegion": {"startLine": 2046,
                                                                                                                           "snippet": {"text": "    cxt = get_device_context (disk, FALSE, error);\n"}}},
                                                                                    "logicalLocations": [{"index": 7,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_uuid"}],
                                                                                    "message": {"text": "returning to 'bd_part_set_part_uuid' from 'get_device_context'"}},
                                                                       "kinds": ["return",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 9},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(10)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 136,
                                                                                                                                 "dst_id": 138}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 2047,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 2047,
                                                                                                                           "snippet": {"text": "    if (!cxt) {\n"}}},
                                                                                    "logicalLocations": [{"index": 7,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_uuid"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 10},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(11)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 136,
                                                                                                                                 "dst_id": 138}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 2052,
                                                                                                                    "startColumn": 10,
                                                                                                                    "endColumn": 37},
                                                                                                         "contextRegion": {"startLine": 2052,
                                                                                                                           "snippet": {"text": "    lb = fdisk_get_label (cxt, NULL);\n"}}},
                                                                                    "logicalLocations": [{"index": 7,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_uuid"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 11},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(12)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 139,
                                                                                                                                 "dst_id": 149}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 2053,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 2053,
                                                                                                                           "snippet": {"text": "    if (!lb) {\n"}}},
                                                                                    "logicalLocations": [{"index": 7,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_uuid"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 12},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(13)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 139,
                                                                                                                                 "dst_id": 149}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 2062,
                                                                                                                    "startColumn": 18,
                                                                                                                    "endColumn": 43},
                                                                                                         "contextRegion": {"startLine": 2062,
                                                                                                                           "snippet": {"text": "    label_name = fdisk_label_get_name (lb);\n"}}},
                                                                                    "logicalLocations": [{"index": 7,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_uuid"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 13},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(14)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 152,
                                                                                                                                 "dst_id": 162}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 2063,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 2063,
                                                                                                                           "snippet": {"text": "    if (g_strcmp0 (label_name, table_type_str[BD_PART_TABLE_GPT]) != 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 7,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_uuid"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 14},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(15)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 152,
                                                                                                                                 "dst_id": 162}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 2073,
                                                                                                                    "startColumn": 16,
                                                                                                                    "endColumn": 45},
                                                                                                         "contextRegion": {"startLine": 2073,
                                                                                                                           "snippet": {"text": "    part_num = get_part_num (part, &l_error);\n"}}},
                                                                                    "logicalLocations": [{"index": 7,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_uuid"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 15},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(16)",
                                                                                      "gcc/analyzer/checker_event/kind": "call",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 162,
                                                                                                                                 "dst_id": 163}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 2073,
                                                                                                                    "startColumn": 16,
                                                                                                                    "endColumn": 45},
                                                                                                         "contextRegion": {"startLine": 2073,
                                                                                                                           "snippet": {"text": "    part_num = get_part_num (part, &l_error);\n"}}},
                                                                                    "logicalLocations": [{"index": 7,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_uuid"}],
                                                                                    "message": {"text": "calling 'get_part_num' from 'bd_part_set_part_uuid'"}},
                                                                       "kinds": ["call",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 16},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(17)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 135,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 25},
                                                                                                         "contextRegion": {"startLine": 135,
                                                                                                                           "snippet": {"text": "static gint get_part_num (const gchar *part, GError **error) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "entry to 'get_part_num'"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 17},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(18)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_consolidated_cfg_edges"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 139,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 139,
                                                                                                                           "snippet": {"text": "    if (!part || *part == '\\0') {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 18},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(19)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_consolidated_cfg_edges"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 145,
                                                                                                                    "startColumn": 28,
                                                                                                                    "endColumn": 41},
                                                                                                         "contextRegion": {"startLine": 145,
                                                                                                                           "snippet": {"text": "    part_num_str = part + (strlen (part) - 1);\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 19},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(20)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2539,
                                                                                                                                 "dst_id": 2543}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 152,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 152,
                                                                                                                           "snippet": {"text": "    if (part_num == 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 20},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(21)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2539,
                                                                                                                                 "dst_id": 2543}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 156,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 156,
                                                                                                                           "snippet": {"text": "    } else if (part_num < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 21},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(22)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2543,
                                                                                                                                 "dst_id": 2544}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 156,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 156,
                                                                                                                           "snippet": {"text": "    } else if (part_num < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "following 'false' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 22},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(23)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 2543,
                                                                                                                                 "dst_id": 2544}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 156,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 156,
                                                                                                                           "snippet": {"text": "    } else if (part_num < 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "get_part_num"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 23},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(24)",
                                                                                      "gcc/analyzer/checker_event/kind": "return"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 2073,
                                                                                                                    "startColumn": 16,
                                                                                                                    "endColumn": 45},
                                                                                                         "contextRegion": {"startLine": 2073,
                                                                                                                           "snippet": {"text": "    part_num = get_part_num (part, &l_error);\n"}}},
                                                                                    "logicalLocations": [{"index": 7,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_uuid"}],
                                                                                    "message": {"text": "returning to 'bd_part_set_part_uuid' from 'get_part_num'"}},
                                                                       "kinds": ["return",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 24},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(25)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 163,
                                                                                                                                 "dst_id": 164}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 2074,
                                                                                                                    "startColumn": 8,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 2074,
                                                                                                                           "snippet": {"text": "    if (part_num == -1) {\n"}}},
                                                                                    "logicalLocations": [{"index": 7,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_uuid"}],
                                                                                    "message": {"text": "following 'true' branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 25},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(26)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 163,
                                                                                                                                 "dst_id": 164}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 2075,
                                                                                                                    "startColumn": 9,
                                                                                                                    "endColumn": 28},
                                                                                                         "contextRegion": {"startLine": 2075,
                                                                                                                           "snippet": {"text": "        close_context (cxt);\n"}}},
                                                                                    "logicalLocations": [{"index": 7,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_uuid"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "true"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 26},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(27)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 2076,
                                                                                                                    "startColumn": 55,
                                                                                                                    "endColumn": 57},
                                                                                                         "contextRegion": {"startLine": 2076,
                                                                                                                           "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                                                                    "logicalLocations": [{"index": 7,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_uuid"}],
                                                                                    "message": {"text": "'l_error' is NULL"}},
                                                                       "kinds": ["release",
                                                                                 "memory"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 27},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(28)",
                                                                                      "gcc/analyzer/checker_event/kind": "warning"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "part.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 2076,
                                                                                                                    "startColumn": 48,
                                                                                                                    "endColumn": 64},
                                                                                                         "contextRegion": {"startLine": 2076,
                                                                                                                           "snippet": {"text": "        bd_utils_report_finished (progress_id, l_error->message);\n"}}},
                                                                                    "logicalLocations": [{"index": 7,
                                                                                                          "fullyQualifiedName": "bd_part_set_part_uuid"}],
                                                                                    "message": {"text": "dereference of NULL 'l_error'"}},
                                                                       "kinds": ["danger"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 28}]}]}]}],
           "logicalLocations": [{"name": "bd_part_delete_part",
                                 "fullyQualifiedName": "bd_part_delete_part",
                                 "decoratedName": "bd_part_delete_part",
                                 "kind": "function",
                                 "index": 0},
                                {"name": "get_part_num",
                                 "fullyQualifiedName": "get_part_num",
                                 "decoratedName": "get_part_num",
                                 "kind": "function",
                                 "index": 1},
                                {"name": "bd_part_resize_part",
                                 "fullyQualifiedName": "bd_part_resize_part",
                                 "decoratedName": "bd_part_resize_part",
                                 "kind": "function",
                                 "index": 2},
                                {"name": "bd_part_set_part_name",
                                 "fullyQualifiedName": "bd_part_set_part_name",
                                 "decoratedName": "bd_part_set_part_name",
                                 "kind": "function",
                                 "index": 3},
                                {"name": "get_device_context",
                                 "fullyQualifiedName": "get_device_context",
                                 "decoratedName": "get_device_context",
                                 "kind": "function",
                                 "index": 4},
                                {"name": "bd_part_set_part_type",
                                 "fullyQualifiedName": "bd_part_set_part_type",
                                 "decoratedName": "bd_part_set_part_type",
                                 "kind": "function",
                                 "index": 5},
                                {"name": "bd_part_set_part_id",
                                 "fullyQualifiedName": "bd_part_set_part_id",
                                 "decoratedName": "bd_part_set_part_id",
                                 "kind": "function",
                                 "index": 6},
                                {"name": "bd_part_set_part_uuid",
                                 "fullyQualifiedName": "bd_part_set_part_uuid",
                                 "decoratedName": "bd_part_set_part_uuid",
                                 "kind": "function",
                                 "index": 7}]}]}
