optee_fuzzer icon indicating copy to clipboard operation
optee_fuzzer copied to clipboard

"error: corrupt patch at line 124 "when I applying a patch to the build system,an error occured.

Open ddwupup opened this issue 5 years ago • 9 comments

$ git apply optee_fuzzer/patches/optee-3.3/build.diff optee_fuzzer/patches/optee-3.3/build.diff:37: trailing whitespace. echo "slink /lib/libsqlfs.so libsqlfs.so.1 755 0 0" >> $(fl); \ error: corrupt patch at line 124

why this problem occured and how can I solve it,please?

ddwupup avatar Oct 05 '20 07:10 ddwupup

@ddwupup

You can add \ No newline at end of file at line 125( the tail of the file)

And, remove the extra whitespace at line 37

Then run git apply --ignore-space-change --ignore-whitespace ../afl-tee/patches/optee-3.3/build.diff in the "build" folder

c01dkit avatar Aug 11 '21 12:08 c01dkit

same happens for me with the other patches... Can these be updated or the patch base (agains which I can apply them) be specified? I used -b 3.3.0 for repo checkout

bitwave avatar Nov 11 '21 13:11 bitwave

are u solved this problem ? i can't patch the optee_client and optee_os

Resery avatar Dec 27 '21 06:12 Resery

@ddwupup

You can add \ No newline at end of file at line 125( the tail of the file)

And, remove the extra whitespace at line 37

Then run git apply --ignore-space-change --ignore-whitespace ../afl-tee/patches/optee-3.3/build.diff in the "build" folder

Thank you, I solved it by manually patch the fixed files according to the diffing files.

ddwupup avatar Dec 27 '21 06:12 ddwupup

are u solved this problem ? i can't patch the optee_client and optee_os

You can try this way https://github.com/Riscure/optee_fuzzer/issues/7#issuecomment-896778249 If it doesn't work, you can try to patch the fixed files according to the diffing files, then complies the programs and debug. Good luck!

ddwupup avatar Dec 27 '21 07:12 ddwupup

are u solved this problem ? i can't patch the optee_client and optee_os

You can try this way #7 (comment) If it doesn't work, you can try to patch the fixed files according to the diffing files, then complies the programs and debug. Good luck!

i tired i can patch the build but it doesn't working for optee_os and optee_client This is the erroe message: error: corrupt patch at line xxx

Resery avatar Dec 27 '21 07:12 Resery

For the optee_client.diff patch this command works git apply --recount --ignore-space-change --ignore-whitespace ../afl-tee/patches/optee-3.3/optee_client.diff it ignores the line counts in the patch headers, which are wrong.

bitwave avatar Jan 20 '22 13:01 bitwave

for optee_os.diff remove the line 1264. In the file to be patched, there is not an empty line. Therefore the patch fails. These with git apply --ignore-space-change --ignore-whitespace for the build patch, as mentioned earlier to apply all patches.

bitwave avatar Jan 20 '22 13:01 bitwave

For the optee_client.diff patch this command works git apply --recount --ignore-space-change --ignore-whitespace ../afl-tee/patches/optee-3.3/optee_client.diff it ignores the line counts in the patch headers, which are wrong.

Thank you for this. It was the combo of --recount and --ignore-space-change that got my particular issue resolved.

coderCK2 avatar Jun 12 '23 15:06 coderCK2