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

[PATCH] Fix uninitialized data access in audit_log_user_command()



Hello,
audit_log_user_command() uses uninitialized commname if getcwd() fails.
The attached patch fixes this.
	Mirek
diff -ur audit/lib/audit_logging.c audit-1.6.9/lib/audit_logging.c
--- audit/lib/audit_logging.c	2008-03-24 03:17:30.000000000 +0100
+++ audit-1.6.9/lib/audit_logging.c	2008-03-24 03:23:35.000000000 +0100
@@ -632,7 +632,7 @@
 
 	// We borrow the commname buffer
 	if (getcwd(commname, PATH_MAX) == NULL)
-		strcpy(cwdname, "?");
+		strcpy(commname, "?");
 	strcpy(cwdname, commname);
 	p = commname;
 	len = strlen(commname);

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