public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: "Miloslav Trmač" <mitr@redhat.com>
To: linux-audit@redhat.com
Subject: [PATCH] Fix uninitialized data access in audit_log_user_command()
Date: Mon, 24 Mar 2008 03:32:39 +0100	[thread overview]
Message-ID: <1206325959.17164.35.camel@amilo> (raw)

[-- 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 --]



             reply	other threads:[~2008-03-24  2:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-24  2:32 Miloslav Trmač [this message]
2008-03-24 12:36 ` [PATCH] Fix uninitialized data access in audit_log_user_command() Steve Grubb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1206325959.17164.35.camel@amilo \
    --to=mitr@redhat.com \
    --cc=linux-audit@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox