]> granicus.if.org Git - sysstat/blobdiff - sa_conv.c
Merge branch 'scop-grep-E'
[sysstat] / sa_conv.c
index db1fade01920f6ff995c11e39f42408f2202d729..ba68ecb0e9a30e9e58a4a2f081a95636d303bad6 100644 (file)
--- a/sa_conv.c
+++ b/sa_conv.c
@@ -1,6 +1,6 @@
 /*
  * sa_conv.c: Convert an old format sa file to the up-to-date format.
- * (C) 1999-2020 by Sebastien GODARD (sysstat <at> orange.fr)
+ * (C) 1999-2021 by Sebastien GODARD (sysstat <at> orange.fr)
  *
  ***************************************************************************
  * This program is free software; you can redistribute it and/or modify it *
@@ -338,8 +338,8 @@ int upgrade_header_section(char dfile[], int fd, int stdfd, struct activity *act
                                a_cpu = TRUE;
                        }
 
-                       /* Size of an activity cannot be zero */
-                       if (!ofal->size)
+                       /* Sanity checks */
+                       if (!ofal->size || (ofal->size > MAX_ITEM_STRUCT_SIZE))
                                goto invalid_header;
 
                        /* Size of activity in file is larger than up-to-date activity size */