Blame SOURCES/psacct-6.6.1-lastcomm-bad-file-sigsegv.patch

0a209a
diff -up acct-6.6.1/file_rd.c.ori acct-6.6.1/file_rd.c
0a209a
--- acct-6.6.1/file_rd.c.ori	2017-03-20 17:03:35.167177224 +0100
0a209a
+++ acct-6.6.1/file_rd.c	2017-03-20 17:03:40.468155269 +0100
0a209a
@@ -118,8 +118,11 @@ char *file_reader_get_entry(struct file_
0a209a
                               ? max_recs
0a209a
                               : fri->buffered_records);
0a209a
 
0a209a
-              /* Move back in the file */
0a209a
+              /* Preventing SEGV when incomplete record appears */
0a209a
+              if (recs_to_read==0)
0a209a
+              goto no_more_records;
0a209a
 
0a209a
+              /* Move back in the file */
0a209a
               (void)fseek(fri->fp, -fri->record_size * recs_to_read,
0a209a
                           SEEK_CUR);
0a209a