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:
Jan Beulich committed 2026-01-07 14:45:27 +01:00
1 parent cb3ae9445a
commit 62412a235b
2 files changed
+5 -2

No files matched your search

+2
View File
@@ -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-%
+3 -2
View File
@@ -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);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.