summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/arm64/pauth/exec_target.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/arm64/pauth/exec_target.c')
-rw-r--r--tools/testing/selftests/arm64/pauth/exec_target.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/testing/selftests/arm64/pauth/exec_target.c b/tools/testing/selftests/arm64/pauth/exec_target.c
index 4435600ca400..e597861b26d6 100644
--- a/tools/testing/selftests/arm64/pauth/exec_target.c
+++ b/tools/testing/selftests/arm64/pauth/exec_target.c
@@ -13,7 +13,12 @@ int main(void)
unsigned long hwcaps;
size_t val;
- fread(&val, sizeof(size_t), 1, stdin);
+ size_t size = fread(&val, sizeof(size_t), 1, stdin);
+
+ if (size != 1) {
+ fprintf(stderr, "Could not read input from stdin\n");
+ return EXIT_FAILURE;
+ }
/* don't try to execute illegal (unimplemented) instructions) caller
* should have checked this and keep worker simple