Skip to contentSkip to conversation

Don't free() static data in libauparse

PATCH Applied Miloslav Trmač 2 participants 2 messages Jun 2, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Don't free() static data in libauparse

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

auparse/interpret.c +1 -1
diff -urN audit/auparse/interpret.c audit-1.7.4/auparse/interpret.c
@@ -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;
 }
Applied
#1 lore raw
Quoted 3 lines · On Monday 02 June 2008 10:29:13 Miloslav Trmač wrote:

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.

Applied. Thanks!

-Steve