Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e16a7e commit 037c9acCopy full SHA for 037c9ac
src/libcare-dump.c
@@ -45,6 +45,7 @@ void usage()
45
46
int kpatch_dump_kpatch_header(const char *input_file)
47
{
48
+ int rv;
49
int fdi = -1;
50
int ret = -1;
51
int elf_size;
@@ -67,7 +68,12 @@ int kpatch_dump_kpatch_header(const char *input_file)
67
68
goto cleanup;
69
}
70
- ret = read(fdi, &kp, sizeof(struct kpatch_file));
71
+ rv = read(fdi, &kp, sizeof(struct kpatch_file));
72
+ if (rv <= 0) {
73
+ printf("Read kpatch file '%s' failed.\n", input_file);
74
+ goto cleanup;
75
+ }
76
+ ret = 0;
77
printf("%-25s %s\n", "Patch Name:", input_file);
78
printf("%-25s %s\n", "Magic:", kp.magic);
79
printf("%-25s %s\n", "Patch id:", kp.id);
0 commit comments