diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-09-17 14:03:28 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-09-17 14:50:31 +0100 |
commit | 74283d58cfb62e6cc73bfe0f62ca142ddc1e8fb2 (patch) | |
tree | ba2b6790011fa012e9575de49d89b97aeb604c28 /src | |
parent | 2e17d78178eb085bdf54eb170bf036e0d7143c19 (diff) | |
download | libguestfs-74283d58cfb62e6cc73bfe0f62ca142ddc1e8fb2.tar.gz libguestfs-74283d58cfb62e6cc73bfe0f62ca142ddc1e8fb2.tar.xz libguestfs-74283d58cfb62e6cc73bfe0f62ca142ddc1e8fb2.zip |
inspect: Fix segfault and error caused by earlier code cleanups.
This fixes commit e128a627fb8f39f4f4c11b782cef895bd79f0282.
Diffstat (limited to 'src')
-rw-r--r-- | src/inspect-apps.c | 4 | ||||
-rw-r--r-- | src/inspect-fs-windows.c | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/inspect-apps.c b/src/inspect-apps.c index 67c7dd57..e9f020a8 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 75c7dd98..c3a5aba3 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) { |