[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH 1/2] virt-edit: If case_sensitive_path returns an error, exit.



From: "Richard W.M. Jones" <rjones redhat com>

The 'windows_path' function was blindly copied from virt-cat.  In
virt-cat, errors are checked by the caller to 'windows_path'.  But
virt-edit lacks this check.  Change the function in virt-edit to add a
check and exit on error.
---
 edit/virt-edit.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/edit/virt-edit.c b/edit/virt-edit.c
index 73d6f07..f763926 100644
--- a/edit/virt-edit.c
+++ b/edit/virt-edit.c
@@ -646,6 +646,8 @@ windows_path (guestfs_h *g, const char *root, const char *path)
   char *t = guestfs_case_sensitive_path (g, ret);
   free (ret);
   ret = t;
+  if (ret == NULL)
+    exit (EXIT_FAILURE);
 
   return ret;
 }
-- 
1.7.11.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]