psacct/psacct-6.6.1-SEGV-when-record-incomplete.patch
Troy Dawson ce45888018 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/psacct#48389e9d466a667bca0f508bfde0f7f07e616317
2020-10-14 16:33:55 -07:00

15 lines
567 B
Diff

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,