diff --git a/src/inspect-apps.c b/src/inspect-apps.c index 67c7dd579..e9f020a84 100644 --- a/src/inspect-apps.c +++ b/src/inspect-apps.c @@ -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; diff --git a/src/inspect-fs-windows.c b/src/inspect-fs-windows.c index 75c7dd982..c3a5aba3c 100644 --- a/src/inspect-fs-windows.c +++ b/src/inspect-fs-windows.c @@ -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) {