public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
* [PATCH] Fix uninitialized data access in audit_log_user_command()
@ 2008-03-24  2:32 Miloslav Trmač
  2008-03-24 12:36 ` Steve Grubb
  0 siblings, 1 reply; 2+ messages in thread
From: Miloslav Trmač @ 2008-03-24  2:32 UTC (permalink / raw)
  To: linux-audit

[-- Attachment #1: Type: text/plain, Size: 117 bytes --]

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

[-- Attachment #2: audit-1.6.9-user_command.patch --]
[-- Type: text/x-patch, Size: 426 bytes --]

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);

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-24 12:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-24  2:32 [PATCH] Fix uninitialized data access in audit_log_user_command() Miloslav Trmač
2008-03-24 12:36 ` Steve Grubb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox