mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
inspect: Fix segfault and error caused by earlier code cleanups.
This fixes commit e128a627fb.
This commit is contained in:
@@ -264,7 +264,7 @@ list_applications_rpm (guestfs_h *g, struct inspect_fs *fs)
|
||||
char *Name = NULL, *Packages = NULL;
|
||||
struct rpm_names_list list = { .names = NULL, .len = 0 };
|
||||
struct guestfs_application_list *apps = NULL;
|
||||
struct read_package_data data = { .list = &list, .apps = apps };
|
||||
struct read_package_data data;
|
||||
|
||||
Name = guestfs___download_to_tmp (g, fs,
|
||||
"/var/lib/rpm/Name", "rpm_Name",
|
||||
@@ -291,6 +291,8 @@ list_applications_rpm (guestfs_h *g, struct inspect_fs *fs)
|
||||
apps->val = NULL;
|
||||
|
||||
/* Read Packages database. */
|
||||
data.list = &list;
|
||||
data.apps = apps;
|
||||
if (guestfs___read_db_dump (g, Packages, &data, read_package) == -1)
|
||||
goto error;
|
||||
|
||||
|
||||
@@ -332,7 +332,7 @@ check_windows_system_registry (guestfs_h *g, struct inspect_fs *fs)
|
||||
char *buf = NULL;
|
||||
size_t buflen;
|
||||
const char *hivepath[] =
|
||||
{ fs->windows_current_control_set, "Services", "Tcpip", "Parameters" };
|
||||
{ NULL /* current control set */, "Services", "Tcpip", "Parameters" };
|
||||
|
||||
if (guestfs_hivex_open (g, system_path,
|
||||
GUESTFS_HIVEX_OPEN_VERBOSE, g->verbose, -1) == -1)
|
||||
@@ -429,6 +429,7 @@ check_windows_system_registry (guestfs_h *g, struct inspect_fs *fs)
|
||||
|
||||
skip_drive_letter_mappings:;
|
||||
/* Get the hostname. */
|
||||
hivepath[0] = fs->windows_current_control_set;
|
||||
for (node = root, i = 0;
|
||||
node > 0 && i < sizeof hivepath / sizeof hivepath[0];
|
||||
++i) {
|
||||
|
||||
Reference in New Issue
Block a user