]> granicus.if.org Git - sysstat/commit
sar/sadf: Add checks on file's header size read from file
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 11 Feb 2018 10:43:20 +0000 (11:43 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 11 Feb 2018 10:43:20 +0000 (11:43 +0100)
commit84300ccbd6598ea4e0cde6a97c0bb22a11eb953c
tree9ca43971f00bdec25bf944c51f35c6b21f731b82
parent2b38a8887c8c6d056fb4d10c11b7220d1729dbbb
sar/sadf: Add checks on file's header size read from file

sa_open_read_magic() reads file's magic structure and in particular the
size of the header structure to come.
header_size field in file_magic structure exists only with versions
10.3.1 and later. So checking bounds for header_size is done only for
those versions, based on the values of sysstat_version and
sysstat_patchlevel.
With a corrupted datafile (i.e. a file having the right FORMAT_MAGIC
value but values corresponding to older sysstat versions in
sysstat_version and sysstat_patchlevel), the test is not done.
So do it again in check_file_actlst() function.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
sa_common.c