public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: "Miloslav Trmač" <mitr@redhat.com>
To: linux-audit <linux-audit@redhat.com>
Subject: [PATCH] Don't free() static data in libauparse
Date: Mon, 02 Jun 2008 14:29:13 +0000	[thread overview]
Message-ID: <1212416953.2746.17.camel@amilo> (raw)

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

Hello,
The "interpretation" code in libuparse stores literal strings as
interpreted data for the second operand of fcntl().  This causes a crash
in free() when freeing the record.

The attached patch fixes the crash.
	Mirek

[-- Attachment #2: audit-1.7.4-fcntl.patch --]
[-- Type: text/x-patch, Size: 370 bytes --]

diff -urN audit/auparse/interpret.c audit-1.7.4/auparse/interpret.c
--- audit/auparse/interpret.c	2008-05-15 23:09:57.000000000 +0200
+++ audit-1.7.4/auparse/interpret.c	2008-06-02 16:04:38.000000000 +0200
@@ -732,7 +732,7 @@
 
 	s = fcntl_i2s(cmd);
 	if (s != NULL)
-		return s;
+		return strdup(s);
 	asprintf(&out, "unknown fcntl command(%d)", cmd);
 	return out;
 }

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



             reply	other threads:[~2008-06-02 14:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-02 14:29 Miloslav Trmač [this message]
2008-06-02 15:42 ` [PATCH] Don't free() static data in libauparse 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=1212416953.2746.17.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