inspect: Fix segfault and error caused by earlier code cleanups.

This fixes commit e128a627fb.
This commit is contained in:
Richard W.M. Jones
2012-09-17 14:03:28 +01:00
parent 2e17d78178
commit 74283d58cf
2 changed files with 5 additions and 2 deletions

View File

@@ -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;

View File

@@ -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) {