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

[Libguestfs] [nbdkit PATCH 2/8] server: Don't leave uninit variable on failure



It is not good to leak uninitialized variables back to the user on
failure paths.

Signed-off-by: Eric Blake <eblake redhat com>
---
 server/utils.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/server/utils.c b/server/utils.c
index 57910f07..5a2d471a 100644
--- a/server/utils.c
+++ b/server/utils.c
@@ -201,6 +201,8 @@ nbdkit_read_password (const char *value, char **password)
   size_t n;
   FILE *fp;

+  *password = NULL;
+
   /* Read from stdin. */
   if (strcmp (value, "-") == 0) {
     printf ("password: ");
-- 
2.20.1


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