|
|
@@ -343,6 +343,11 @@ static unsigned int printer_subsys_count =
|
|
|
|
|
|
#define G_RECORD_SIZE 10000
|
|
|
|
|
|
+/*
|
|
|
+ * Record must have at least 4 bytes - size, indent, line and record_number
|
|
|
+ */
|
|
|
+#define MINIMUM_RECORD_SIZE 4
|
|
|
+
|
|
|
static uint32_t g_record[G_RECORD_SIZE];
|
|
|
|
|
|
/*
|
|
|
@@ -362,6 +367,11 @@ static int logsys_rec_get (int rec_idx) {
|
|
|
exit (EXIT_FAILURE);
|
|
|
}
|
|
|
|
|
|
+ if (rec_size < MINIMUM_RECORD_SIZE) {
|
|
|
+ fprintf (stderr, "rec_size too small. Input file is probably corrupted.\n");
|
|
|
+ exit (EXIT_FAILURE);
|
|
|
+ }
|
|
|
+
|
|
|
if (firstcopy + rec_idx > flt_data_size) {
|
|
|
firstcopy = flt_data_size - rec_idx;
|
|
|
secondcopy -= firstcopy - rec_size;
|