[PATCH] mount.cifs: fix possible use of uninitialized variable

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

 



It's possible to "goto return_i" in this function at several points
before line_buf is set. At that point, the NULL pointer check won't
work correctly and we can end up with a SIGSEGV.

Signed-off-by: Jeff Layton <jlayton@xxxxxxxxx>
---
 mount.cifs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mount.cifs.c b/mount.cifs.c
index 5f29761..3a2b539 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
@@ -636,7 +636,7 @@ parsing_err:
 static int open_cred_file(char *file_name,
 			struct parsed_mount_info *parsed_info)
 {
-	char *line_buf;
+	char *line_buf = NULL;
 	char *temp_val = NULL;
 	FILE *fs = NULL;
 	int i;
-- 
1.7.3.5

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux