mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
x86/cpu-policy: enable build of fuzzing harness by default
... on x86, to make sure its bit-rotting can be limited at least a little. Since on Ubuntu fread()'s return value needs evaluating, adjust the code there to also skip the test when there's no data at all. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
cb3ae9445a
commit
62412a235b
2 files changed
+5
-2
No files matched your search
@@ -5,5 +5,7 @@ SUBDIRS-y :=
|
||||
SUBDIRS-y += libelf
|
||||
SUBDIRS-y += x86_instruction_emulator
|
||||
|
||||
SUBDIRS-$(CONFIG_X86_64) += cpu-policy
|
||||
|
||||
.PHONY: all clean distclean install uninstall
|
||||
all clean distclean install uninstall: %: subdirs-%
|
||||
@@ -133,6 +133,7 @@ int main(int argc, char **argv)
|
||||
#endif
|
||||
{
|
||||
struct cpu_policy *cp = NULL;
|
||||
size_t size;
|
||||
|
||||
if ( fp != stdin )
|
||||
{
|
||||
@@ -150,9 +151,9 @@ int main(int argc, char **argv)
|
||||
if ( !cp )
|
||||
goto skip;
|
||||
|
||||
fread(cp, sizeof(*cp), 1, fp);
|
||||
size = fread(cp, sizeof(*cp), 1, fp);
|
||||
|
||||
if ( !feof(fp) )
|
||||
if ( !size || !feof(fp) )
|
||||
goto skip;
|
||||
|
||||
check_policy(cp);
|
||||
|
||||