Skip to contentSkip to conversation

Fix uninitialized data access in audit_log_user_command()

PATCH Applied Miloslav Trmač 2 participants 2 messages Mar 24, 2008 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

lib/audit_logging.c +1 -1
diff -ur audit/lib/audit_logging.c audit-1.6.9/lib/audit_logging.c
@@ -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);
Applied
#1 lore raw
Quoted 2 lines · On Sunday 23 March 2008 22:32:39 Miloslav Trmač wrote:

audit_log_user_command() uses uninitialized commname if getcwd() fails. The attached patch fixes this.

Applied. Thanks!

-Steve