[psacct/f19] - Preventing SEGVs when an incomplete record appears (#1017715)

Jaromír Cápík jcapik at fedoraproject.org
Thu Oct 10 12:28:30 UTC 2013


commit 5eb5f9ec2e3a40b7916716f2df1aeaa55a91e34a
Author: Jaromir Capik <jcapik at redhat.com>
Date:   Thu Oct 10 14:28:17 2013 +0200

    - Preventing SEGVs when an incomplete record appears (#1017715)

 psacct-6.6.1-SEGV-when-record-incomplete.patch |   14 ++++++++++++++
 psacct.spec                                    |    8 +++++++-
 2 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/psacct-6.6.1-SEGV-when-record-incomplete.patch b/psacct-6.6.1-SEGV-when-record-incomplete.patch
new file mode 100644
index 0000000..2bfa3f8
--- /dev/null
+++ b/psacct-6.6.1-SEGV-when-record-incomplete.patch
@@ -0,0 +1,14 @@
+diff -Naur acct-6.6.1.orig/file_rd.c acct-6.6.1/file_rd.c
+--- acct-6.6.1.orig/file_rd.c	2011-03-16 23:50:13.000000000 +0100
++++ acct-6.6.1/file_rd.c	2013-10-10 14:21:21.801097725 +0200
+@@ -118,6 +118,10 @@
+                               ? max_recs
+                               : fri->buffered_records);
+ 
++              /* Preventing SEGV when incomplete record appears */
++              if (recs_to_read==0)
++                goto no_more_records;
++
+               /* Move back in the file */
+ 
+               (void)fseek(fri->fp, -fri->record_size * recs_to_read,
diff --git a/psacct.spec b/psacct.spec
index 38bd432..c1e872a 100644
--- a/psacct.spec
+++ b/psacct.spec
@@ -4,7 +4,7 @@
 Summary: Utilities for monitoring process activities
 Name: psacct
 Version: 6.6.1
-Release: 6%{?dist}
+Release: 7%{?dist}
 License: GPLv3+
 Group: Applications/System
 URL: http://www.gnu.org/software/acct/
@@ -23,6 +23,8 @@ Patch4: psacct-6.6.1-unnumberedsubsubsec.patch
 Patch5: psacct-6.6.1-RH-man-page-scan.patch
 # Partial replacement for Patch3: psacct-6.3.2-man-pages.patch
 Patch6: psacct-6.6.1-man-dump-acct.patch
+# Preventing SEGVs when an incomplete record appears
+Patch7: psacct-6.6.1-SEGV-when-record-incomplete.patch
 
 Conflicts: filesystem < 3
 Conflicts: systemd < 39-1
@@ -57,6 +59,7 @@ commands.
 %patch4 -p1 -b .subsubsec
 %patch5 -p1 -b .rh-man-scan
 %patch6 -p1 -b .man-dump-acct
+%patch7 -p1
 
 # fixing 'gets' undeclared
 sed -i 's|.*(gets,.*||g' lib/stdio.in.h
@@ -162,6 +165,9 @@ fi
 
 
 %changelog
+* Thu Oct 10 2013 Jaromir Capik <jcapik at redhat.com> - 6.6.1-7
+- Preventing SEGVs when an incomplete record appears (#1017715)
+
 * Wed Aug 21 2013 Jaromir Capik <jcapik at redhat.com> - 6.6.1-6
 - Unifying the default file paths (#985150)
 


More information about the scm-commits mailing list